summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDF5Macros.cmake
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-09-15 20:38:57 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-09-15 20:38:57 (GMT)
commit9af344117c2d41886da1f54d3f5cff4091c4a943 (patch)
tree9dcb6bf61c2fbc5634b69f554690bb740b8decbd /config/cmake/HDF5Macros.cmake
parentb2f94f9faf805035e4d0e9cb76007204c8250e58 (diff)
parent14e3550348d08d932e0f61a4ae6b8a7afe19a484 (diff)
downloadhdf5-9af344117c2d41886da1f54d3f5cff4091c4a943.zip
hdf5-9af344117c2d41886da1f54d3f5cff4091c4a943.tar.gz
hdf5-9af344117c2d41886da1f54d3f5cff4091c4a943.tar.bz2
[svn-r27794] Reintegration merge of features/autotools_rework branch with trunk
NOTES: - Developers will have to run autogen.sh before building with the autotools. - autogen.sh takes the -p option to mimic the old bin/reconfigure behavior. - The generated error, overflow and version headers have been left in place. - The generated H5LT parser code has also been left in place. - There are no changes for CMake users at this time. Tested on: h5committest
Diffstat (limited to 'config/cmake/HDF5Macros.cmake')
-rw-r--r--config/cmake/HDF5Macros.cmake70
1 files changed, 70 insertions, 0 deletions
diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake
index 976b910..9b36f53 100644
--- a/config/cmake/HDF5Macros.cmake
+++ b/config/cmake/HDF5Macros.cmake
@@ -41,3 +41,73 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype)
endif (APPLE)
endmacro (H5_SET_LIB_OPTIONS)
+
+macro (H5_GEN_PERL_FILES)
+ find_package (Perl)
+ if (PERL_FOUND)
+ add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/H5Edefin.h
+ PRE_BUILD
+ COMMAND ${PERL_EXECUTABLE}
+ ARGS ${HDF5_SOURCE_DIR}/bin/make_err ${HDF5_SOURCE_DIR}/src/H5err.txt
+ DEPENDS ${HDF5_SOURCE_DIR}/src/H5err.txt
+ COMMENT " Creating err header"
+ )
+
+ add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/H5version.h
+ PRE_BUILD
+ COMMAND ${PERL_EXECUTABLE}
+ ARGS ${HDF5_SOURCE_DIR}/bin/make_vers ${HDF5_SOURCE_DIR}/src/H5vers.txt
+ DEPENDS ${HDF5_SOURCE_DIR}/src/H5vers.txt
+ COMMENT " Creating API version macro"
+ )
+
+ add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/H5overflow.h
+ PRE_BUILD
+ COMMAND ${PERL_EXECUTABLE}
+ ARGS ${HDF5_SOURCE_DIR}/bin/make_overflow ${HDF5_SOURCE_DIR}/src/H5overflow.txt
+ DEPENDS ${HDF5_SOURCE_DIR}/src/H5overflow.txt
+ COMMENT " Creating Assignment overflow macro"
+ )
+
+ add_custom_target(run_perl_scripts ALL
+ DEPENDS ${HDF5_BINARY_DIR}/H5Edefin.h ${HDF5_BINARY_DIR}/H5version.h ${HDF5_BINARY_DIR}/H5overflow.h
+ )
+ else (PERL_FOUND)
+ message (STATUS "Cannot generate headers - perl not found")
+ endif (PERL_FOUND)
+endmacro (H5_GEN_PERL_FILES)
+
+macro (H5_GEN_FLEX_FILES)
+ find_package (BISON)
+ if (BISON_FOUND)
+ find_package (FLEX)
+ if (FLEX_FOUND)
+ BISON_TARGET (H5LT_PARSER H5LTparse.y ${CMAKE_CURRENT_BINARY_DIR}/H5LTparse.c COMPILE_FLAGS -d)
+ if (WIN32)
+ FLEX_TARGET (H5LT_SCANNER H5LTanalyze.l ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c COMPILE_FLAGS --wincompat)
+ else (WIN32)
+ FLEX_TARGET (H5LT_SCANNER H5LTanalyze.l ${CMAKE_CURRENT_BINARY_DIR}/H5LTanalyze.c)
+ endif (WIN32)
+ ADD_FLEX_BISON_DEPENDENCY(H5LT_SCANNER H5LT_PARSER)
+
+ if (BISON_H5LT_PARSER_DEFINED AND FLEX_H5LT_SCANNER_DEFINED)
+ set_source_files_properties (${FLEX_H5LT_SCANNER_OUTPUTS}
+ PROPERTIES OBJECT_DEPENDS ${BISON_H5LT_PARSER_OUTPUTS})
+ set (HL_SRCS
+ ${BISON_H5LT_PARSER_OUTPUTS}
+ ${FLEX_H5LT_SCANNER_OUTPUTS}
+ )
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ 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)
+endmacro (H5_GEN_FLEX_FILES)