summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-05-12 00:07:25 (GMT)
committerGitHub <noreply@github.com>2023-05-12 00:07:25 (GMT)
commitec4c67733fa55771edc8102a13adc2ab0b7522ad (patch)
treec81ae47e280a774531858465181917078bc3159a
parent89c1050d10f5c8b92404b8748d56244a32c25fcf (diff)
downloadhdf5-ec4c67733fa55771edc8102a13adc2ab0b7522ad.zip
hdf5-ec4c67733fa55771edc8102a13adc2ab0b7522ad.tar.gz
hdf5-ec4c67733fa55771edc8102a13adc2ab0b7522ad.tar.bz2
Fix CMake generator expression syntax (#2941)
-rw-r--r--.gitignore1
-rw-r--r--c++/src/CMakeLists.txt4
-rw-r--r--c++/test/CMakeLists.txt2
-rw-r--r--config/cmake/HDFMacros.cmake6
-rw-r--r--fortran/examples/CMakeLists.txt4
-rw-r--r--fortran/src/CMakeLists.txt4
-rw-r--r--fortran/test/CMakeLists.txt20
-rw-r--r--release_docs/RELEASE.txt13
-rw-r--r--src/CMakeLists.txt23
-rw-r--r--test/CMakeLists.txt40
-rw-r--r--testpar/CMakeLists.txt8
11 files changed, 69 insertions, 56 deletions
diff --git a/.gitignore b/.gitignore
index 3caf16a..cbaccb2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,4 @@ src/H5overflow.h
src/H5version.h
/.classpath
+/CMakeUserPresets.json
diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
index b872eed..5f58bac 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
@@ -92,7 +92,7 @@ if (BUILD_STATIC_LIBS)
)
target_compile_options(${HDF5_CPP_LIB_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(${HDF5_CPP_LIB_TARGET}
- PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK>"# Parallel/MPI, prevent spurious cpp/cxx warnings
)
TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET})
@@ -111,7 +111,7 @@ if (BUILD_SHARED_LIBS)
target_compile_options(${HDF5_CPP_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(${HDF5_CPP_LIBSH_TARGET}
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
- PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK>"# Parallel/MPI, prevent spurious cpp/cxx warnings
)
TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_CPP_LIBSH_TARGET}
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index 4ffac2f..3511c5f 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -41,7 +41,7 @@ add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ${HDF5_CPP_TEST_SOURCE_DIR}/h5c
target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}")
target_compile_definitions(cpp_testhdf5
- PRIVATE $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK># Parallel/MPI, prevent spurious cpp/cxx warnings
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPICH_SKIP_MPICXX;MPICH_IGNORE_CXX_SEEK>"# Parallel/MPI, prevent spurious cpp/cxx warnings
)
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (cpp_testhdf5 STATIC)
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake
index 9d61d92..7f94d59 100644
--- a/config/cmake/HDFMacros.cmake
+++ b/config/cmake/HDFMacros.cmake
@@ -77,7 +77,7 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
if (${target_type} MATCHES "SHARED")
set (targetfilename $<TARGET_PDB_FILE:${libtarget}>)
else ()
- get_property (target_name TARGET ${libtarget} PROPERTY $<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>)
+ get_property (target_name TARGET ${libtarget} PROPERTY "$<IF:$<OR:$<CONFIG:Debug>,$<CONFIG:Developer>>,OUTPUT_NAME_DEBUG,OUTPUT_NAME_RELWITHDEBINFO>")
set (targetfilename $<TARGET_FILE_DIR:${libtarget}>/${target_name}.pdb)
endif ()
install (
@@ -213,8 +213,8 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (TARGET_C_PROPERTIES wintarget libtype)
target_compile_options(${wintarget} PRIVATE
- $<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
- $<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>
+ "$<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>"
+ "$<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}>"
)
if(MSVC)
set_property(TARGET ${wintarget} APPEND PROPERTY LINK_FLAGS "${WIN_LINK_FLAGS}")
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt
index f5714d7..3aaad08 100644
--- a/fortran/examples/CMakeLists.txt
+++ b/fortran/examples/CMakeLists.txt
@@ -137,7 +137,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
PRIVATE
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
- $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>"
)
set_target_properties (f90_ex_ph5example PROPERTIES
LINKER_LANGUAGE Fortran
@@ -158,7 +158,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND)
PRIVATE
${HDF5_F90_LIBSH_TARGET}
${HDF5_LIBSH_TARGET}
- $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>"
)
set_target_properties (f90_ex_ph5example PROPERTIES
LINKER_LANGUAGE Fortran
diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 095daaa..40aa14f 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -331,7 +331,7 @@ if (BUILD_STATIC_LIBS)
PUBLIC ${HDF5_F90_C_LIB_TARGET}
PRIVATE
${LINK_Fortran_LIBS}
- $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>"
)
# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
# set_property(TARGET ${HDF5_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
@@ -364,7 +364,7 @@ if (BUILD_SHARED_LIBS)
)
target_link_libraries (${HDF5_F90_LIBSH_TARGET}
PUBLIC ${HDF5_F90_C_LIBSH_TARGET}
- PRIVATE ${LINK_Fortran_LIBS} $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>
+ PRIVATE ${LINK_Fortran_LIBS} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_LIBRARIES}>"
)
# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">)
# set_property(TARGET ${HDF5_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>)
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index cdcfc65..820214b 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -224,7 +224,7 @@ if(MSVC)
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static")
- target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (testhdf5_fortran PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -233,7 +233,7 @@ if (NOT BUILD_SHARED_LIBS)
add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET})
else ()
target_include_directories (testhdf5_fortran PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared")
- target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (testhdf5_fortran PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (testhdf5_fortran PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -263,7 +263,7 @@ if(MSVC)
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static")
- target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (testhdf5_fortran_1_8 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -272,7 +272,7 @@ if (NOT BUILD_SHARED_LIBS)
add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET})
else ()
target_include_directories (testhdf5_fortran_1_8 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared")
- target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (testhdf5_fortran_1_8 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (testhdf5_fortran_1_8 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -304,7 +304,7 @@ if(MSVC)
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static")
- target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (fortranlib_test_F03 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -313,7 +313,7 @@ if (NOT BUILD_SHARED_LIBS)
add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET})
else ()
target_include_directories (fortranlib_test_F03 PRIVATE "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared")
- target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (fortranlib_test_F03 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (fortranlib_test_F03 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -336,7 +336,7 @@ if(MSVC)
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
- target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (fflush1 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -345,7 +345,7 @@ if (NOT BUILD_SHARED_LIBS)
add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET})
else ()
target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
- target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (fflush1 PRIVATE ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (fflush1 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -368,7 +368,7 @@ if(MSVC)
endif()
if (NOT BUILD_SHARED_LIBS)
target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static)
- target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (fflush2 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
@@ -377,7 +377,7 @@ if (NOT BUILD_SHARED_LIBS)
add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET})
else ()
target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared)
- target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} $<$<PLATFORM_ID:Windows>:ws2_32.lib>)
+ target_link_libraries (fflush2 PRIVATE ${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<PLATFORM_ID:Windows>:ws2_32.lib>")
set_target_properties (fflush2 PROPERTIES
LINKER_LANGUAGE Fortran
FOLDER test/fortran
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 7a21f8b..8cda997 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -224,7 +224,18 @@ Bug Fixes since HDF5-1.10.10 release
Configuration
-------------
- -
+ - Fixed syntax of generator expressions used by CMake
+
+ Adding quotes around the generator expression should allow CMake to
+ correctly parse the expression. Generator expressions are typically
+ parsed after command arguments. If a generator expression contains
+ spaces, new lines, semicolons or other characters that may be
+ interpreted as command argument separators, the whole expression
+ should be surrounded by quotes when passed to a command. Failure to
+ do so may result in the expression being split and it may no longer
+ be recognized as a generator expression.
+
+ Fixes GitHub issue #2906
Tools
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d210080..0ab761a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1114,18 +1114,18 @@ if (BUILD_STATIC_LIBS)
${HDF_EXTRA_C_FLAGS}
${HDF_EXTRA_FLAGS}
PRIVATE
- $<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:${HDF5_DEBUG_APIS}>
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API>" # Enable tracing of the API
+ "$<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:${HDF5_DEBUG_APIS}>"
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_LIB_TARGET}
PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}
- PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}> "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>"
+ PUBLIC "$<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}>" "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>"
)
if (NOT WIN32)
target_link_libraries (${HDF5_LIB_TARGET}
- PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>"
)
endif ()
set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET})
@@ -1156,15 +1156,16 @@ if (BUILD_SHARED_LIBS)
${HDF_EXTRA_C_FLAGS}
${HDF_EXTRA_FLAGS}
PRIVATE
- $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>
- $<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API> # Enable tracing of the API
- $<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:${HDF5_DEBUG_APIS}>
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>"
+ "$<$<BOOL:${HDF5_ENABLE_TRACE}>:H5_DEBUG_API>" # Enable tracing of the API
+ "$<$<BOOL:${HDF5_ENABLE_DEBUG_APIS}>:${HDF5_DEBUG_APIS}>"
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_LIBSH_TARGET}
- PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
- PUBLIC $<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}> "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>"
+ PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}
+ "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>"
+ PUBLIC "$<$<NOT:$<PLATFORM_ID:Windows>>:${CMAKE_DL_LIBS}>" "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>"
)
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB")
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c6467ba..e7f9e86 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -37,12 +37,12 @@ if (BUILD_STATIC_LIBS)
target_compile_definitions(${HDF5_TEST_LIB_TARGET}
PRIVATE
"H5_TEST_EXPRESS_LEVEL_DEFAULT=${H5_TEST_EXPRESS_LEVEL_DEFAULT}"
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_TEST_LIB_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
- PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ PRIVATE "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>"
)
if (MINGW)
target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
@@ -63,12 +63,12 @@ if (BUILD_SHARED_LIBS)
"H5_BUILT_AS_DYNAMIC_LIB"
PRIVATE
"H5_TEST_EXPRESS_LEVEL_DEFAULT=${H5_TEST_EXPRESS_LEVEL_DEFAULT}"
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
- PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ PRIVATE "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>"
)
if (MINGW)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")
@@ -306,7 +306,7 @@ macro (ADD_H5_EXE file)
target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(${file}
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${file} STATIC)
@@ -350,7 +350,7 @@ add_executable (chunk_info ${HDF5_TEST_SOURCE_DIR}/chunk_info.c)
target_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(chunk_info
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (chunk_info PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -374,7 +374,7 @@ add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c)
target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(direct_chunk
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (direct_chunk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -399,7 +399,7 @@ add_executable (testhdf5 ${testhdf5_SOURCES})
target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(testhdf5
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -423,7 +423,7 @@ add_executable (cache_image ${cache_image_SOURCES})
target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(cache_image
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (cache_image PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -447,7 +447,7 @@ add_executable (ttsafe ${ttsafe_SOURCES})
target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(ttsafe
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (ttsafe PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -455,12 +455,12 @@ if (NOT BUILD_SHARED_LIBS)
target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET})
if (NOT WIN32)
target_link_libraries (ttsafe
- PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>"
)
endif ()
else ()
TARGET_C_PROPERTIES (ttsafe SHARED)
- target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
+ target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>")
endif ()
set_target_properties (ttsafe PROPERTIES FOLDER test)
@@ -477,7 +477,7 @@ add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c)
target_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(thread_id
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (thread_id PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -485,12 +485,12 @@ if (NOT BUILD_SHARED_LIBS)
target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET})
if (NOT WIN32)
target_link_libraries (thread_id
- PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>"
)
endif ()
else ()
TARGET_C_PROPERTIES (thread_id SHARED)
- target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
+ target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>")
endif ()
set_target_properties (thread_id PROPERTIES FOLDER test)
@@ -587,7 +587,7 @@ macro (ADD_H5_VDS_EXE file)
target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(${file}
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${file} STATIC)
@@ -617,7 +617,7 @@ add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(accum_swmr_reader
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -665,7 +665,7 @@ add_executable (use_append_chunk ${use_append_chunk_SOURCES})
target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(use_append_chunk
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -689,7 +689,7 @@ add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(use_append_mchunks
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
@@ -713,7 +713,7 @@ add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(use_disable_mdc_flushes
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index 74f5bd9..d3a3016 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -25,7 +25,7 @@ add_executable (testphdf5 ${testphdf5_SOURCES})
target_compile_options(testphdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(testphdf5
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (testphdf5
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -55,7 +55,7 @@ macro (ADD_H5P_EXE file)
target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_compile_definitions(${file}
PRIVATE
- $<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>
+ "$<$<CONFIG:Developer>:${HDF5_DEVELOPER_DEFS}>"
)
target_include_directories (${file}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
@@ -64,13 +64,13 @@ macro (ADD_H5P_EXE file)
TARGET_C_PROPERTIES (${file} STATIC)
target_link_libraries (${file}
PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>"
- $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>"
)
else ()
TARGET_C_PROPERTIES (${file} SHARED)
target_link_libraries (${file}
PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:MPI::MPI_C>"
- $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ "$<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>"
)
endif ()
set_target_properties (${file} PROPERTIES FOLDER test/par)