[svn-r28336] Remove flex/bison generation

This commit is contained in:
Allen Byrne 2015-11-13 11:42:57 -05:00
parent f7b73969f3
commit 59ba9f2bc5

View File

@ -1,85 +1,16 @@
cmake_minimum_required (VERSION 3.1.0)
PROJECT (HDF5_HL_SRC)
if (HDF5_GENERATE_HEADERS)
file (MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/genLT")
find_package (BISON)
if (BISON_FOUND)
find_package (FLEX)
if (FLEX_FOUND)
BISON_TARGET (H5LT_PARSER H5LTparse.y ${CMAKE_CURRENT_BINARY_DIR}/genLT/H5LTparse.c COMPILE_FLAGS "-d -pH5LTyy")
if (WIN32)
FLEX_TARGET (H5LT_SCANNER H5LTanalyze.l ${CMAKE_CURRENT_BINARY_DIR}/genLT/H5LTanalyze.c COMPILE_FLAGS "--wincompat --nounistd -PH5LTyy")
else (WIN32)
FLEX_TARGET (H5LT_SCANNER H5LTanalyze.l ${CMAKE_CURRENT_BINARY_DIR}/genLT/H5LTanalyze.c COMPILE_FLAGS "--nounistd -PH5LTyy")
endif (WIN32)
ADD_FLEX_BISON_DEPENDENCY(H5LT_SCANNER H5LT_PARSER)
if (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.h
PRE_BUILD
COMMAND "${CMAKE_COMMAND}"
-D "GEN_DIR=genLT"
-D "FILE_PARSE=H5LTparse"
-P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake"
DEPENDS "${BISON_H5LT_PARSER_OUTPUTS}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command (
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c
PRE_BUILD
COMMAND "${CMAKE_COMMAND}"
-D "GEN_DIR=genLT"
-D "FILE_ANALYZE=H5LTanalyze.c"
-P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake"
DEPENDS "${FLEX_H5LT_SCANNER_OUTPUTS}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target (process_gen_H5LT
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
set (HL_SRCS
${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c
${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c
)
set (HL_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.h
)
else (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED)
message (STATUS "Error during generate of files")
endif (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED)
else (FLEX_FOUND)
message (STATUS "Cannot generate files - flex not found")
endif (FLEX_FOUND)
else (BISON_FOUND)
message (STATUS "Cannot generate files - bison not found")
endif (BISON_FOUND)
else (HDF5_GENERATE_HEADERS)
set (HL_SRCS
${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c
${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c
)
set (HL_HEADERS
${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h
)
endif (HDF5_GENERATE_HEADERS)
#-----------------------------------------------------------------------------
# List Source files
#-----------------------------------------------------------------------------
set (HL_SRCS
${HL_SRCS}
${HDF5_HL_SRC_SOURCE_DIR}/H5DO.c
${HDF5_HL_SRC_SOURCE_DIR}/H5DS.c
${HDF5_HL_SRC_SOURCE_DIR}/H5IM.c
${HDF5_HL_SRC_SOURCE_DIR}/H5LT.c
#${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c
#${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c
${HDF5_HL_SRC_SOURCE_DIR}/H5LTanalyze.c
${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.c
${HDF5_HL_SRC_SOURCE_DIR}/H5PT.c
${HDF5_HL_SRC_SOURCE_DIR}/H5TB.c
)
@ -89,7 +20,7 @@ set (HL_HEADERS
${HDF5_HL_SRC_SOURCE_DIR}/H5DOpublic.h
${HDF5_HL_SRC_SOURCE_DIR}/H5DSpublic.h
${HDF5_HL_SRC_SOURCE_DIR}/H5IMpublic.h
#${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h
${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h
${HDF5_HL_SRC_SOURCE_DIR}/H5LTpublic.h
${HDF5_HL_SRC_SOURCE_DIR}/H5PTpublic.h
${HDF5_HL_SRC_SOURCE_DIR}/H5TBpublic.h