diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-10-11 16:31:09 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-10-11 16:31:09 (GMT) |
commit | d69b541c2009e534d746622345268595b2ca614c (patch) | |
tree | c866aeec274e54a75638df266ce4e81c4105fb03 /src/CMakeLists.txt | |
parent | 39b3b52a941dd5e012e5a472ef940d624941833b (diff) | |
download | hdf5-d69b541c2009e534d746622345268595b2ca614c.zip hdf5-d69b541c2009e534d746622345268595b2ca614c.tar.gz hdf5-d69b541c2009e534d746622345268595b2ca614c.tar.bz2 |
TRILABS-34 add batch option. Also fix cmakedefine01 usage
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7045012..49a84df 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -898,24 +898,43 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c) INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0"> ) - add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect> - ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c - DEPENDS H5detect - WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} - ) - if (BUILD_SHARED_LIBS) - if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c) + option (HDF5_BATCH_DETECT "Use batch file to execute H5detect" OFF) + if (HDF5_BATCH_DETECT) + add_custom_command ( + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + COMMAND ${HDF5_BATCH_DETECT_CMD} + ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + DEPENDS H5detect + WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} + ) + if (BUILD_SHARED_LIBS) add_custom_command ( - OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect> - ARGS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c - DEPENDS H5detect - WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}/shared + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c" + DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ) - else () - set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) + endif () + else () + add_custom_command ( + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}H5detect + ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c + DEPENDS H5detect + WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR} + ) + if (BUILD_SHARED_LIBS) + if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c) + add_custom_command ( + OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}H5detect + ARGS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c + DEPENDS H5detect + WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}/shared + ) + else () + set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE) + endif () endif () endif () else () @@ -942,7 +961,7 @@ target_link_libraries (H5make_libsettings add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings> + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}H5make_libsettings ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_BINARY_DIR} @@ -950,7 +969,7 @@ add_custom_command ( if (BUILD_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings> + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}H5make_libsettings ARGS ${HDF5_BINARY_DIR}/shared/H5lib_settings.c DEPENDS H5make_libsettings WORKING_DIRECTORY ${HDF5_BINARY_DIR} |