diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-09-29 17:23:55 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-09-29 17:23:55 (GMT) |
commit | e8073c0d80189b1d1c8e5df94abe72b249f5aab8 (patch) | |
tree | a0ff3ef4cca04f9891553ce2700167f233317548 /hl/src | |
parent | ea70d11227bee77e9fc34f0435165365842bd138 (diff) | |
download | hdf5-e8073c0d80189b1d1c8e5df94abe72b249f5aab8.zip hdf5-e8073c0d80189b1d1c8e5df94abe72b249f5aab8.tar.gz hdf5-e8073c0d80189b1d1c8e5df94abe72b249f5aab8.tar.bz2 |
[svn-r27910] Rework flex-bison generated files to eliminate dual depends when building both shared and static
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/CMakeLists.txt | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index fd99ce8..1821ec0 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -6,53 +6,47 @@ if (HDF5_GENERATE_HEADERS) if (BISON_FOUND) find_package (FLEX) if (FLEX_FOUND) - BISON_TARGET (H5LT_PARSER H5LTparse.y ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c COMPILE_FLAGS "-d -pH5LTyy") + 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}/H5LTanalyze.c COMPILE_FLAGS "--wincompat --nounistd -PH5LTyy") + 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}/H5LTanalyze.c COMPILE_FLAGS "--nounistd -PH5LTyy") + 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}) - set (HL_SRCS - ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c - ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c - ) - set (HL_HEADERS - ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.h - ) - set_source_files_properties (${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c GENERATED) - set_source_files_properties (${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c GENERATED) - set_source_files_properties (${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.h GENERATED) add_custom_command ( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c.timestamp + OUTPUT H5LTparse.c H5LTparse.h COMMAND "${CMAKE_COMMAND}" - -D "FILE_PARSE=H5LTparse.c" + -D "GEN_DIR=genLT" + -D "FILE_PARSE=H5LTparse" -P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c" + DEPENDS "genLT/H5LTparse.c" WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) add_custom_command ( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c.timestamp + OUTPUT H5LTanalyze.c COMMAND "${CMAKE_COMMAND}" + -D "GEN_DIR=genLT" -D "FILE_ANALYZE=H5LTanalyze.c" -P "${HDF_RESOURCES_DIR}/HDF5_Process_Flex_Files.cmake" - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c" + DEPENDS "genLT/H5LTanalyze.c" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target (process_gen_H5LT + DEPENDS H5LTparse.c H5LTanalyze.c WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - add_custom_target (process_gen_H5LT DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c.timestamp ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c.timestamp) -# add_custom_target (process_gen_H5LT -# COMMAND "${CMAKE_COMMAND}" -# -D "FILE_PARSE=${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c" -# -D "FILE_ANALYSE=${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c" -# -P "${HDF5_RESOURCE_DIR}/HDF5_Process_Flex_Files.cmake" -# DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c" -# COMMENT "Prepending pragma statements" -# ) + 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) |