summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fortran/src/H5config_f.inc.cmake2
-rw-r--r--src/CMakeLists.txt55
2 files changed, 38 insertions, 19 deletions
diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake
index aa3d135..3dd3c8c 100644
--- a/fortran/src/H5config_f.inc.cmake
+++ b/fortran/src/H5config_f.inc.cmake
@@ -12,7 +12,7 @@
! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure
! Define if we have parallel support
-#cmakedefine01 H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
+#cmakedefine01 H5_HAVE_PARALLEL
#if H5_HAVE_PARALLEL == 0
#undef H5_HAVE_PARALLEL
#endif
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}