diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2014-05-21 14:29:41 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2014-05-21 14:29:41 (GMT) |
commit | a8b48bc7f5355b951b30bc656f7c7c03b69c0329 (patch) | |
tree | 1f13bb34aec10f18e3c54a3101027bdcc1327724 | |
parent | b6733f1109e1c4833c08150c61eaa4c208ad2bf9 (diff) | |
download | hdf5-a8b48bc7f5355b951b30bc656f7c7c03b69c0329.zip hdf5-a8b48bc7f5355b951b30bc656f7c7c03b69c0329.tar.gz hdf5-a8b48bc7f5355b951b30bc656f7c7c03b69c0329.tar.bz2 |
[svn-r25208] Make the header generation optional and depend on finding perl executable. Needed because window does not have perl.
-rw-r--r-- | src/CMakeLists.txt | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b6c11a..8fd232b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -805,37 +805,43 @@ add_custom_command ( WORKING_DIRECTORY ${HDF5_BINARY_DIR} ) -set (CMDPERL perl) -add_custom_command ( - OUTPUT ${HDF5_BINARY_DIR}/H5Edefin.h - PRE_BUILD - COMMAND ${CMDPERL} - 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 ${CMDPERL} - 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 ${CMDPERL} - 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 -) +if (GENERATE_ERROR_HEADERS) + find_pacakge (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) +endif (GENERATE_ERROR_HEADERS) #----------------------------------------------------------------------------- # Add H5Tinit source to build - generated by H5Detect/CMake at configure time |