summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-09-24 20:29:26 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-09-24 20:29:26 (GMT)
commita8f46df2c29f73947d1ab342d53c5f1e42fbbefe (patch)
tree6f7e4c8b869a1d20328d43a616bc4b83e74d6944 /src/CMakeLists.txt
parent5b07855b2d73b0f55b0e45b46bdbf72389b1a1ca (diff)
downloadhdf5-a8f46df2c29f73947d1ab342d53c5f1e42fbbefe.zip
hdf5-a8f46df2c29f73947d1ab342d53c5f1e42fbbefe.tar.gz
hdf5-a8f46df2c29f73947d1ab342d53c5f1e42fbbefe.tar.bz2
Remove libsettings from pregenerated block
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt67
1 files changed, 27 insertions, 40 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e90e580..7bf976d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -907,46 +907,33 @@ else ()
endif ()
endif ()
-if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c)
- add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
- target_include_directories(H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
- TARGET_C_PROPERTIES (H5make_libsettings STATIC)
- target_link_libraries (H5make_libsettings
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
- INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0">
- )
-
- add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c
- COMMAND $<TARGET_FILE:H5make_libsettings>
- ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c
- DEPENDS H5make_libsettings
- WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
- )
- if (BUILD_SHARED_LIBS)
- if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c)
- add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c
- COMMAND $<TARGET_FILE:H5make_libsettings>
- ARGS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c
- DEPENDS H5make_libsettings
- WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
- )
- else ()
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE)
- endif ()
- endif ()
-else ()
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c PROPERTIES GENERATED TRUE)
- if (BUILD_SHARED_LIBS)
+add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
+target_include_directories(H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
+TARGET_C_PROPERTIES (H5make_libsettings STATIC)
+target_link_libraries (H5make_libsettings
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ INTERFACE $<$<PLATFORM_ID:Emscripten>:"-O0">
+)
+
+add_custom_command (
+ OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
+ COMMAND $<TARGET_FILE:H5make_libsettings>
+ ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c
+ DEPENDS H5make_libsettings
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
+)
+if (BUILD_SHARED_LIBS)
+ if (NOT EXISTS ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
add_custom_command (
- OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c"
- DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c
+ OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
+ COMMAND $<TARGET_FILE:H5make_libsettings>
+ ARGS ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
+ DEPENDS H5make_libsettings
+ WORKING_DIRECTORY ${HDF5_BINARY_DIR}
)
- set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE)
+ else ()
+ set_source_files_properties (${HDF5_BINARY_DIR}/shared/H5lib_settings.c PROPERTIES GENERATED TRUE)
endif ()
endif ()
@@ -957,7 +944,7 @@ option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF)
#-----------------------------------------------------------------------------
# Add H5Tinit source to build - generated by H5detect/CMake at configure time
#-----------------------------------------------------------------------------
-set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_GENERATED_SOURCE_DIR}/H5lib_settings.c)
+set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c)
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
target_include_directories(${HDF5_LIB_TARGET}
@@ -985,7 +972,7 @@ set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries)
set (install_targets ${HDF5_LIB_TARGET})
if (BUILD_SHARED_LIBS)
- set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_GENERATED_SOURCE_DIR}/shared/H5lib_settings.c)
+ set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c)
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS})
target_include_directories(${HDF5_LIBSH_TARGET}