summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt68
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