diff options
72 files changed, 486 insertions, 609 deletions
diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index 4a09d2d..622f0cf 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -23,16 +23,6 @@ if (WIN32) find_program (WIX_EXECUTABLE candle PATHS "${CPACK_WIX_ROOT}/bin") endif () -#----------------------------------------------------------------------------- -# Add file(s) to CMake Install -#----------------------------------------------------------------------------- -if (NOT HDF5_INSTALL_NO_DEVELOPMENT) - install ( - FILES ${PROJECT_BINARY_DIR}/H5pubconf.h - DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT headers - ) -endif () #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da475a..d3afc41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5 C CXX) +project (HDF5 C) #----------------------------------------------------------------------------- # Instructions for use : Normal Build @@ -555,11 +555,6 @@ endif () include (${HDF_RESOURCES_DIR}/HDFCompilerFlags.cmake) #----------------------------------------------------------------------------- -# All libs/tests/examples need the main include directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - -#----------------------------------------------------------------------------- # Option to Enable MPI Parallel #----------------------------------------------------------------------------- set (CMAKE_MODULE_PATH ${HDF_RESOURCES_DIR} ${HDF_RESOURCES_EXT_DIR} ${CMAKE_MODULE_PATH}) diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index 2c161f1..80bd810 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -1,31 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - -#----------------------------------------------------------------------------- -# Generate configure file -#----------------------------------------------------------------------------- -configure_file (${HDF_RESOURCES_DIR}/H5cxx_config.h.in - ${HDF5_BINARY_DIR}/H5cxx_pubconf.h -) - -#----------------------------------------------------------------------------- -# Setup Include directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_CPP_SOURCE_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR}) - -#----------------------------------------------------------------------------- -# Parallel/MPI, prevent spurious cpp/cxx warnings -#----------------------------------------------------------------------------- -if (H5_HAVE_PARALLEL) - add_definitions ("-DMPICH_SKIP_MPICXX") - add_definitions ("-DMPICH_IGNORE_CXX_SEEK") -endif () +project (HDF5_CPP CXX) add_subdirectory (src) diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 22ecb19..e05d6f0 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_EXAMPLES) +project (HDF5_CPP_EXAMPLES CXX) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed @@ -34,6 +34,7 @@ set (tutr_examples foreach (example ${examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) + set_property(TARGET cpp_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) @@ -41,6 +42,7 @@ endforeach () foreach (example ${tutr_examples}) add_executable (cpp_ex_${example} ${HDF5_CPP_EXAMPLES_SOURCE_DIR}/${example}.cpp) + set_property(TARGET cpp_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (cpp_ex_${example} STATIC " " " ") target_link_libraries (cpp_ex_${example} ${HDF5_CPP_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 35e7590..eae86a3 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -1,5 +1,18 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_SRC) +project (HDF5_CPP_SRC CXX) + +#----------------------------------------------------------------------------- +# Parallel/MPI, prevent spurious cpp/cxx warnings +#----------------------------------------------------------------------------- +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif () + +#----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate configure file @@ -83,6 +96,7 @@ set (CPP_HDRS ) add_library (${HDF5_CPP_LIB_TARGET} STATIC ${CPP_SOURCES} ${CPP_HDRS}) +set_property(TARGET ${HDF5_CPP_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_CPP_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_CPP_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIB_TARGET}") @@ -95,6 +109,7 @@ set (install_targets ${HDF5_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_CPP_LIBSH_TARGET} SHARED ${CPP_SOURCES} ${CPP_HDRS}) + set_property(TARGET ${HDF5_CPP_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_CPP_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_CPP_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_CPP_LIBSH_TARGET}") diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index b4fb0fc..abc7952 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -1,5 +1,19 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_CPP_TEST) +project (HDF5_CPP_TEST CXX) + +#----------------------------------------------------------------------------- +# Parallel/MPI, prevent spurious cpp/cxx warnings +#----------------------------------------------------------------------------- +if (H5_HAVE_PARALLEL) + add_definitions ("-DMPICH_SKIP_MPICXX") + add_definitions ("-DMPICH_IGNORE_CXX_SEEK") +endif () + +#----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +add_definitions (${HDF_EXTRA_C_FLAGS}) + # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed # with "cpp_". This allows for easier filtering of the test suite when @@ -37,6 +51,7 @@ set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) +set_property(TARGET cpp_testhdf5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (cpp_testhdf5 STATIC " " " ") target_link_libraries (cpp_testhdf5 ${HDF5_CPP_LIB_TARGET} diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 7d73c09..f61953d 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -254,18 +254,3 @@ H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting # Check if pointer alignments are enforced # H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") - -# ----------------------------------------------------------------------- -# wrapper script variables -# -set (prefix ${CMAKE_INSTALL_PREFIX}) -set (exec_prefix "\${prefix}") -set (libdir "${exec_prefix}/lib") -set (includedir "\${prefix}/include") -set (host_os ${CMAKE_HOST_SYSTEM_NAME}) -set (CC ${CMAKE_C_COMPILER}) -set (CXX ${CMAKE_CXX_COMPILER}) -set (FC ${CMAKE_Fortran_COMPILER}) -foreach (LINK_LIB ${LINK_LIBS}) - set (LIBS "${LIBS} -l${LINK_LIB}") -endforeach () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 56277fa..1ba090c 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -50,8 +50,10 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + endif () endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) @@ -65,7 +67,9 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif () endif () endif () @@ -212,13 +216,17 @@ if (HDF5_ENABLE_ALL_WARNINGS) if (HDF5_ENABLE_DEV_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4668") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + endif () else () string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () endif () else () if (CMAKE_COMPILER_IS_GNUCC) @@ -235,8 +243,10 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + endif () else () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") @@ -252,8 +262,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") endif () @@ -267,8 +279,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") endif () @@ -282,8 +296,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") endif () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 3797768..0153254 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -14,7 +14,6 @@ #----------------------------------------------------------------------------- include (CheckFunctionExists) include (CheckIncludeFile) -include (CheckIncludeFileCXX) include (CheckIncludeFiles) include (CheckLibraryExists) include (CheckSymbolExists) @@ -23,6 +22,7 @@ include (CheckVariableExists) include (CheckFortranFunctionExists) include (TestBigEndian) if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) + include (CheckIncludeFileCXX) include (TestForSTDNamespace) endif () diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4da8405..05646d8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_EXAMPLES) +project (HDF5_EXAMPLES C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below @@ -46,11 +46,13 @@ set (examples foreach (example ${examples}) add_executable (${example} ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) + set_property(TARGET ${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${example} STATIC " " " ") target_link_libraries (${example} ${HDF5_LIB_TARGET}) set_target_properties (${example} PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (${example}-shared ${HDF5_EXAMPLES_SOURCE_DIR}/${example}.c) + set_property(TARGET ${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${example}-shared SHARED " " " ") target_link_libraries (${example}-shared ${HDF5_LIBSH_TARGET}) set_target_properties (${example}-shared PROPERTIES FOLDER examples) @@ -59,11 +61,13 @@ endforeach () if (H5_HAVE_PARALLEL) add_executable (ph5example ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) + set_property(TARGET ph5example APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ph5example STATIC " " " ") target_link_libraries (ph5example ${HDF5_LIB_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example PROPERTIES FOLDER examples) if (BUILD_SHARED_LIBS) add_executable (ph5example-shared ${HDF5_EXAMPLES_SOURCE_DIR}/ph5example.c) + set_property(TARGET ph5example-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ph5example-shared SHARED " " " ") target_link_libraries (ph5example-shared ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) set_target_properties (ph5example-shared PROPERTIES FOLDER examples) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 8c7b8f6..31edad2 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_F90 C CXX Fortran) +project (HDF5_F90 C Fortran) if (H5_HAVE_PARALLEL) if (MPI_Fortran_LINK_FLAGS) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 8b7333a..187acc1 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -1,16 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) +project (HDF5_F90_EXAMPLES C Fortran) # -------------------------------------------------------------------- # Notes: When creating examples they should be prefixed # with "f90_ex_". This allows for easier filtering of the examples. # -------------------------------------------------------------------- #----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) - -#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- set (examples @@ -46,6 +41,7 @@ foreach (example ${examples}) ${HDF5_LIB_TARGET} ) target_include_directories (f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET f90_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -59,6 +55,7 @@ foreach (example ${examples}) ${HDF5_LIBSH_TARGET} ) target_include_directories (f90_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET f90_ex_${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (f90_ex_${example}-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -75,6 +72,7 @@ foreach (example ${F2003_examples}) ${HDF5_LIB_TARGET} ) target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET f03_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 @@ -88,6 +86,7 @@ foreach (example ${F2003_examples}) ${HDF5_LIBSH_TARGET} ) target_include_directories (f03_ex_${example}-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET f03_ex_${example}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (f03_ex_${example}-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran03 @@ -104,6 +103,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ${HDF5_LIB_TARGET} ) target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET f90_ex_ph5example APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran @@ -117,6 +117,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) ${HDF5_LIBSH_TARGET} ) target_include_directories (f90_ex_ph5example-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET f90_ex_ph5example-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (f90_ex_ph5example-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER examples/fortran diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 03c12ac..71b7d41 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -project (HDF5_F90_SRC C CXX Fortran) +project (HDF5_F90_SRC C Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows @@ -32,7 +32,7 @@ if (HAVE_FLOAT128) set (CMAKE_H5_HAVE_FLOAT128 1) endif () -configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${CMAKE_BINARY_DIR}/H5config_f.inc @ONLY) +configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${HDF5_F90_BINARY_DIR}/H5config_f.inc @ONLY) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.in ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY) set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) @@ -46,7 +46,7 @@ set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID) add_executable (H5_buildiface ${HDF5_F90_SRC_SOURCE_DIR}/H5_buildiface.F90 ) - +target_include_directories(H5_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5_buildiface @@ -71,13 +71,12 @@ endif () file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) -INCLUDE_DIRECTORIES (${HDF5_F90_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${CMAKE_Fortran_MODULE_DIRECTORY}) - #----------------------------------------------------------------------------- add_executable (H5match_types ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h ${HDF5_F90_SRC_SOURCE_DIR}/H5match_types.c ) +target_include_directories(H5match_types PRIVATE "${HDF5_BINARY_DIR};${HDF5_SRC_DIR};${HDF5_F90_BINARY_DIR}") add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/static/H5f90i_gen.h ${HDF5_F90_BINARY_DIR}/static/H5fortran_types.F90 @@ -132,7 +131,7 @@ set (f90CStub_C_SHHDRS ) add_library (${HDF5_F90_C_LIB_TARGET} STATIC ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) -target_include_directories(${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) +set_property(TARGET ${HDF5_F90_C_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") @@ -146,7 +145,7 @@ set (install_targets ${HDF5_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_SHHDRS}) - target_include_directories(${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) + set_property(TARGET ${HDF5_F90_C_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIBSH_TARGET}") @@ -250,7 +249,7 @@ set (SHARED_LINK_FLAGS " ") TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET}) target_link_libraries (${HDF5_F90_LIB_TARGET} PRIVATE ${LINK_Fortran_LIBS}) -target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR}") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () @@ -279,7 +278,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET}) target_link_libraries (${HDF5_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) - target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC "${HDF5_F90_SRC_SOURCE_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR}") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index a5f5464..7f538f1 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_FORTRAN_TESTS_SOURCE_DIR} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +project (HDF5_FORTRAN_TESTS C Fortran) #----------------------------------------------------------------------------- # Setup the Fortran auto-detection utilities @@ -14,7 +9,7 @@ INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_FORTRAN_TESTS_SOUR add_executable (H5_test_buildiface ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90 ) - +target_include_directories(H5_test_buildiface PRIVATE ${HDF5_BINARY_DIR} ${HDF5_F90_BINARY_DIR}) if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5_test_buildiface @@ -44,7 +39,7 @@ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) -target_include_directories(${HDF5_F90_C_TEST_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) +set_property(TARGET ${HDF5_F90_C_TEST_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} @@ -58,7 +53,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES ) if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) - target_include_directories(${HDF5_F90_C_TEST_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) + set_property(TARGET ${HDF5_F90_C_TEST_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} @@ -128,6 +123,7 @@ target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_TEST_LIB_NAME} STATIC 0) target_include_directories (${HDF5_F90_TEST_LIB_TARGET} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE Fortran @@ -155,6 +151,7 @@ if (BUILD_SHARED_LIBS) ) H5_SET_LIB_OPTIONS (${HDF5_F90_TEST_LIBSH_TARGET} ${HDF5_F90_TEST_LIB_NAME} SHARED "F") target_include_directories (${HDF5_F90_TEST_LIBSH_TARGET} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET ${HDF5_F90_TEST_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (${HDF5_F90_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE Fortran @@ -203,6 +200,7 @@ if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran "ws2_32.lib") endif () target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET testhdf5_fortran APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -238,6 +236,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (testhdf5_fortran-shared "ws2_32.lib") endif () target_include_directories (testhdf5_fortran-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET testhdf5_fortran-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (testhdf5_fortran-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -265,6 +264,7 @@ if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") endif () target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET testhdf5_fortran_1_8 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -291,6 +291,7 @@ if (BUILD_SHARED_LIBS) target_link_libraries (testhdf5_fortran_1_8-shared "ws2_32.lib") endif () target_include_directories (testhdf5_fortran_1_8-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET testhdf5_fortran_1_8-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (testhdf5_fortran_1_8-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -320,6 +321,7 @@ if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03 "ws2_32.lib") endif () target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET fortranlib_test_F03 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static") set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran @@ -349,6 +351,7 @@ if (BUILD_SHARED_LIBS) endif () target_include_directories (fortranlib_test_F03-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET fortranlib_test_F03-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared") set_target_properties (fortranlib_test_F03-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/fortran diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index 979d305..fe5827d 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) +project (HDF5_FORTRAN_TESTPAR C Fortran) #----------------------------------------------------------------------------- # Setup include Directories diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 54d5976..2a71b47 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -1,16 +1,9 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL C CXX) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - +project (HDF5_HL C) #----------------------------------------------------------------------------- # List Source files #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SOURCE_DIR}/src ) add_subdirectory (src) diff --git a/hl/c++/CMakeLists.txt b/hl/c++/CMakeLists.txt index 71e5bb3..a62d9d4 100644 --- a/hl/c++/CMakeLists.txt +++ b/hl/c++/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP) +project (HDF5_HL_CPP CXX) #----------------------------------------------------------------------------- # Main HL lib is in /src diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 25158f2..1760d71 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -1,16 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP_EXAMPLES) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_DIR}/src) +project (HDF5_HL_CPP_EXAMPLES CXX) # -------------------------------------------------------------------- # Add in the examples for the Packet Table codes # -------------------------------------------------------------------- add_executable (ptExampleFL ${HDF5_HL_CPP_EXAMPLES_SOURCE_DIR}/ptExampleFL.cpp) +set_property(TARGET ptExampleFL APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ptExampleFL STATIC " " " ") target_link_libraries ( ptExampleFL diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index bfafe7f..10a0c1e 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -1,16 +1,15 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP_SRC) +project (HDF5_HL_CPP_SRC CXX) #----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_CPP_SRC_SOURCE_DIR}) set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) +set_property(TARGET ${HDF5_HL_CPP_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_CPP_LIB_TARGET} PUBLIC ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIB_TARGET}") @@ -23,6 +22,7 @@ set (install_targets ${HDF5_HL_CPP_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_CPP_LIBSH_TARGET} SHARED ${HDF5_HL_CPP_SOURCES}) + set_property(TARGET ${HDF5_HL_CPP_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_CPP_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_CPP_LIBSH_TARGET} PUBLIC ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_CPP_LIBSH_TARGET}") diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index b48d147..710e218 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -1,21 +1,8 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_CPP_TEST) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/c++/src) - -# -------------------------------------------------------------------- -# Add in the unit tests for the packet table c++ wrapper -# -------------------------------------------------------------------- - -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) -INCLUDE_DIRECTORIES (${HDF5_HL_SRC_DIR}/test) -INCLUDE_DIRECTORIES (${HDF5_CPP_SRC_DIR}/src) +project (HDF5_HL_CPP_TEST CXX) add_executable (hl_ptableTest ${HDF5_HL_CPP_TEST_SOURCE_DIR}/ptableTest.cpp) +set_property(TARGET hl_ptableTest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/test;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_ptableTest STATIC " " " ") target_link_libraries ( hl_ptableTest diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 79dfee1..79250e6 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_EXAMPLES ) +project (HDF5_HL_EXAMPLES C) #----------------------------------------------------------------------------- # Define Sources @@ -28,6 +28,7 @@ set (examples foreach (example ${examples}) add_executable (hl_ex_${example} ${HDF5_HL_EXAMPLES_SOURCE_DIR}/${example}.c) + set_property(TARGET hl_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_ex_${example} STATIC " " " ") target_link_libraries (hl_ex_${example} ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) diff --git a/hl/fortran/CMakeLists.txt b/hl/fortran/CMakeLists.txt index 7955de2..3c82574 100644 --- a/hl/fortran/CMakeLists.txt +++ b/hl/fortran/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_F90 C CXX Fortran) +project (HDF5_HL_F90 C Fortran) #----------------------------------------------------------------------------- # List Source files diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 411ceea..af92efc 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -1,13 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES ( - ${HDF5_F90_BINARY_DIR} - ${HDF5_F90_SRC_DIR}/src -) +project (HDF5_HL_F90_EXAMPLES C Fortran) set (examples exlite @@ -23,6 +15,7 @@ foreach (example ${examples}) ${HDF5_LIB_TARGET} ) target_include_directories (hl_f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran) diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index f1e0c3a..41adb6e 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -project (HDF5_HL_F90_SRC C CXX Fortran) +project (HDF5_HL_F90_SRC C Fortran) #----------------------------------------------------------------------------- # configure def file for shared libs on windows @@ -18,7 +18,7 @@ endif () add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90 ) - +target_include_directories(H5HL_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) set_target_properties (H5HL_buildiface @@ -44,18 +44,6 @@ file (MAKE_DIRECTORY "${HDF5_HL_F90_BINARY_DIR}/static") set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE}) #----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES ( - ${HDF5_HL_SRC_DIR}/src - ${HDF5_F90_SRC_DIR}/src - ${HDF5_HL_F90_SRC_SOURCE_DIR} - ${HDF5_F90_BINARY_DIR} - ${CMAKE_Fortran_MODULE_DIRECTORY} - ${MOD_BUILD_DIR} -) - -#----------------------------------------------------------------------------- # hl_f90CStub lib #----------------------------------------------------------------------------- set (HDF5_HL_F90_C_SOURCES @@ -70,7 +58,8 @@ set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) -target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/static) +target_include_directories(${HDF5_HL_F90_C_LIB_TARGET} PUBLIC "${HDF5_F90_BINARY_DIR}/static") +set_property(TARGET ${HDF5_HL_F90_C_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_C_LIB_TARGET} PUBLIC ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") @@ -84,7 +73,8 @@ set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) - target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_BINARY_DIR}/shared) + target_include_directories(${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC "${HDF5_F90_BINARY_DIR}/shared") + set_property(TARGET ${HDF5_HL_F90_C_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIBSH_TARGET}") @@ -165,10 +155,11 @@ endif () add_library (${HDF5_HL_F90_LIB_TARGET} STATIC ${HDF5_HL_F90_F_SOURCES}) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) -target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC "${CMAKE_Fortran_MODULE_DIRECTORY}/static") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () +set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR}") set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} STATIC 0) set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES @@ -194,7 +185,8 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIBSH_TARGET} SHARED " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_link_libraries (${HDF5_HL_F90_LIBSH_TARGET} PRIVATE ${LINK_Fortran_LIBS}) - target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC "${CMAKE_Fortran_MODULE_DIRECTORY}/shared") + set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR}") if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_include_directories (${HDF5_HL_F90_LIBSH_TARGET} PUBLIC ${MPI_Fortran_INCLUDE_DIRS}) endif () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 5c83d03..e82bb2b 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -1,16 +1,16 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_FORTRAN_TESTS C CXX Fortran) +project (HDF5_HL_FORTRAN_TESTS C Fortran) #----------------------------------------------------------------------------- # Add Tests #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #-- Adding test for hl_f90_tstds add_executable (hl_f90_tstds tstds.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds STATIC " " " ") target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tstds APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -18,6 +18,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") target_link_libraries (hl_f90_tstds-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstds-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tstds-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstds-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran @@ -30,6 +31,7 @@ add_executable (hl_f90_tstlite tstlite.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite STATIC " " " ") target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tstlite APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -37,6 +39,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") target_link_libraries (hl_f90_tstlite-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tstlite-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tstlite-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstlite-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran @@ -49,6 +52,7 @@ add_executable (hl_f90_tstimage tstimage.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage STATIC " " " ") target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET}) target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tstimage APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -56,6 +60,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") target_link_libraries (hl_f90_tstimage-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}) target_include_directories (hl_f90_tstimage-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tstimage-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tstimage-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran @@ -68,6 +73,7 @@ add_executable (hl_f90_tsttable tsttable.F90) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable STATIC " " " ") target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET}) target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_property(TARGET hl_f90_tsttable APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) if (BUILD_SHARED_LIBS) @@ -75,6 +81,7 @@ if (BUILD_SHARED_LIBS) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") target_link_libraries (hl_f90_tsttable-shared ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET}) target_include_directories (hl_f90_tsttable-shared PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/shared) + set_property(TARGET hl_f90_tsttable-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src") set_target_properties (hl_f90_tsttable-shared PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index 7204b13..bec40ec 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_SRC) +project (HDF5_HL_SRC C) #----------------------------------------------------------------------------- # List Source files @@ -30,6 +30,7 @@ set (HL_HEADERS ) add_library (${HDF5_HL_LIB_TARGET} STATIC ${HL_SOURCES} ${HL_HEADERS}) +set_property(TARGET ${HDF5_HL_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_HL_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} STATIC 0) @@ -42,6 +43,7 @@ set (install_targets ${HDF5_HL_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_LIBSH_TARGET} SHARED ${HL_SOURCES} ${HL_HEADERS}) + set_property(TARGET ${HDF5_HL_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_HL_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIBSH_TARGET} ${HDF5_HL_LIB_NAME} SHARED "HL") diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 6b3c764..0acb2f4 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TEST) +project (HDF5_HL_TEST C) # -------------------------------------------------------------------- # Notes: When creating unit test executables they should be prefixed # with "hl_". This allows for easier filtering of the test suite when @@ -14,14 +14,12 @@ PROJECT (HDF5_HL_TEST) set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -include_directories (${CMAKE_CURRENT_BINARY_DIR}) -include_directories (${HDF5_TEST_SRC_DIR}) - # -------------------------------------------------------------------- # Macro used to add a unit test # -------------------------------------------------------------------- MACRO (HL_ADD_EXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + set_property(TARGET hl_${hl_name} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_${hl_name} STATIC " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIB_TARGET} @@ -33,6 +31,7 @@ ENDMACRO () MACRO (HL_ADD_SHEXE hl_name) add_executable (hl_${hl_name} ${hl_name}.c) + set_property(TARGET hl_${hl_name} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_${hl_name} SHARED " " " ") target_link_libraries (hl_${hl_name} ${HDF5_HL_LIBSH_TARGET} @@ -53,6 +52,7 @@ HL_ADD_EXE (test_dset_append) # test_packet has two source files add_executable (hl_test_packet test_packet.c test_packet_vlen.c) +set_property(TARGET hl_test_packet APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_test_packet STATIC " " " ") target_link_libraries (hl_test_packet ${HDF5_HL_LIB_TARGET} @@ -67,6 +67,7 @@ set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_gen_test_ds gen_test_ds.c) + set_property(TARGET hl_gen_test_ds APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_gen_test_ds STATIC " " " ") target_link_libraries (hl_gen_test_ds ${HDF5_HL_LIB_TARGET} @@ -76,6 +77,7 @@ if (HDF5_BUILD_GENERATORS) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) add_executable (hl_gen_test_ld gen_test_ld.c) + set_property(TARGET hl_gen_test_ld APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_gen_test_ld STATIC " " " ") target_link_libraries (hl_gen_test_ld ${HDF5_HL_LIB_TARGET} diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 67e0ccb..c2889c3 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TOOLS C CXX) +project (HDF5_HL_TOOLS C) add_subdirectory (gif2h5) diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 2697dfd..977d78c 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TOOLS_GIF2H5) +project (HDF5_HL_TOOLS_GIF2H5 C) #----------------------------------------------------------------------------- # Define Sources @@ -14,10 +14,8 @@ set (GIF2H5_SOURCES ) #-- Add gif2hdf5 program -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}) - add_executable (gif2h5 ${GIF2H5_SOURCES}) +set_property(TARGET gif2h5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (gif2h5 STATIC " " " ") target_link_libraries (gif2h5 ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (gif2h5 PROPERTIES FOLDER tools/hl) @@ -29,6 +27,7 @@ set (hdf2gif_SOURCES ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdfgifwr.c ) add_executable (h52gif ${hdf2gif_SOURCES}) +set_property(TARGET h52gif APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h52gif STATIC " " " ") target_link_libraries (h52gif ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h52gif PROPERTIES FOLDER tools/hl) @@ -42,6 +41,7 @@ if (BUILD_TESTING) # -------------------------------------------------------------------- if (HDF5_BUILD_GENERATORS) add_executable (hl_h52gifgentest ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/h52gifgentst.c) + set_property(TARGET hl_h52gifgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_h52gifgentest STATIC " " " ") target_link_libraries (hl_h52gifgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index 5de655e..b3bd856 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_HL_TOOLS_H5WATCH) +project (HDF5_HL_TOOLS_H5WATCH C) #----------------------------------------------------------------------------- # Define Sources @@ -9,25 +9,21 @@ set (H5WATCH_SOURCES ) #-- Add h5watch program -include_directories (${HDF5_TOOLS_DIR}/lib) -include_directories (${HDF5_HL_TOOLS_DIR}/src) -include_directories (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}) - add_executable (h5watch ${H5WATCH_SOURCES}) +set_property(TARGET h5watch APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5watch STATIC " " " ") target_link_libraries (h5watch ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5watch PROPERTIES FOLDER tools/hl) if (BUILD_TESTING) - include_directories (${HDF5_TEST_SRC_DIR}) - include_directories(${HDF5_HL_SRC_DIR}/test) #-- Add swmr_check_compat_vfd program set (hl_swmr_check_compat_vfd_SOURCES ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c ) add_executable (hl_swmr_check_compat_vfd ${hl_swmr_check_compat_vfd_SOURCES}) + set_property(TARGET hl_swmr_check_compat_vfd APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (hl_swmr_check_compat_vfd STATIC " " " ") - target_link_libraries (hl_swmr_check_compat_vfd ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + target_link_libraries (hl_swmr_check_compat_vfd ${HDF5_LIB_TARGET}) set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) #-- Add extend_dset program @@ -35,11 +31,13 @@ if (BUILD_TESTING) ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c ) add_executable (extend_dset ${extend_dset_SOURCES}) + set_property(TARGET extend_dset APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/test;${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (extend_dset STATIC " " " ") target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) + set_property(TARGET h5watchgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5watchgentest STATIC " " " ") target_link_libraries (h5watchgentest ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index fc057f7..ffc3b94 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -1,8 +1,9 @@ cmake_minimum_required (VERSION 3.10) -PROJECT ( HDF5_JAVA C Java ) +project (HDF5_JAVA C Java) set (CMAKE_MODULE_PATH "${HDF_RESOURCES_DIR};${HDF_RESOURCES_EXT_DIR}") find_package (Java) + #----------------------------------------------------------------------------- # Include some macros for reusable code #----------------------------------------------------------------------------- @@ -13,7 +14,6 @@ find_package (JNI) message ("JNI_LIBRARIES=${JNI_LIBRARIES}") message ("JNI_INCLUDE_DIRS=${JNI_INCLUDE_DIRS}") -INCLUDE_DIRECTORIES ( ${JNI_INCLUDE_DIRS} ) if (WIN32) set (HDF_JRE_DIRECTORY "C:/Program Files/Java/jre8") @@ -25,13 +25,14 @@ endif () # Include the main src and config directories #----------------------------------------------------------------------------- set (HDF5_JAVA_INCLUDE_DIRECTORIES + ${JNI_INCLUDE_DIRS} ${HDF5_JAVA_JNI_SRC_DIR} ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ) -INCLUDE_DIRECTORIES (${HDF5_JAVA_INCLUDE_DIRECTORIES}) -set (CMAKE_JAVA_INCLUDE_PATH "") +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_INCLUDE_DIRECTORIES}") +set (CMAKE_JAVA_INCLUDE_PATH "") #----------------------------------------------------------------------------- # Traverse source subdirectory diff --git a/java/examples/CMakeLists.txt b/java/examples/CMakeLists.txt index 3d1e30e..828b96a 100644 --- a/java/examples/CMakeLists.txt +++ b/java/examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES) +project (HDFJAVA_EXAMPLES Java) add_subdirectory (datasets) add_subdirectory (datatypes) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index 6a90cd1..5ac241a 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_DATASETS Java) +project (HDFJAVA_EXAMPLES_DATASETS Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5Ex_D_Alloc H5Ex_D_Checksum diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 73111ed..4a8b2a4 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_DATATYPES Java) +project (HDFJAVA_EXAMPLES_DATATYPES Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5Ex_T_Array H5Ex_T_ArrayAttribute diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 6b55359..2c5d33b 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_GROUPS Java) +project (HDFJAVA_EXAMPLES_GROUPS Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5Ex_G_Create H5Ex_G_Iterate diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index 65db3fe..8d56b86 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -1,13 +1,8 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDFJAVA_EXAMPLES_INTRO Java) +project (HDFJAVA_EXAMPLES_INTRO Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) - set (HDF_JAVA_EXAMPLES H5_CreateAttribute H5_CreateDataset diff --git a/java/src/CMakeLists.txt b/java/src/CMakeLists.txt index 0c00923..3f80d8f 100644 --- a/java/src/CMakeLists.txt +++ b/java/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT ( HDF5_JAVA_SRC C Java ) +project (HDF5_JAVA_SRC C) #----------------------------------------------------------------------------- # Traverse source subdirectory diff --git a/java/src/hdf/CMakeLists.txt b/java/src/hdf/CMakeLists.txt index ecff984..161ddf1 100644 --- a/java/src/hdf/CMakeLists.txt +++ b/java/src/hdf/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_HDF) +project (HDF5_JAVA_HDF C) add_subdirectory (hdf5lib) diff --git a/java/src/hdf/hdf5lib/CMakeLists.txt b/java/src/hdf/hdf5lib/CMakeLists.txt index 9506fc1..c171ea8 100644 --- a/java/src/hdf/hdf5lib/CMakeLists.txt +++ b/java/src/hdf/hdf5lib/CMakeLists.txt @@ -1,14 +1,9 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_HDF_HDF5 Java) +project (HDF5_JAVA_HDF_HDF5 Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_HDF_HDF5_SOURCE_DIR} - ${HDF5_JAVA_HDF_HDF5_BINARY_DIR} - ${HDF5_JAVA_LIB_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${HDF5_JAVA_HDF5_LIB_CORENAME}.dir/hdf/hdf5lib -) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_HDF_HDF5_SOURCE_DIR};${HDF5_JAVA_HDF_HDF5_BINARY_DIR};${HDF5_JAVA_LIB_DIR};${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${HDF5_JAVA_HDF5_LIB_CORENAME}.dir/hdf/hdf5lib") SET_GLOBAL_VARIABLE (HDF5_JAVA_SOURCE_PACKAGES "${HDF5_JAVA_SOURCE_PACKAGES};hdf.hdf5lib.callbacks;hdf.hdf5lib.exceptions;hdf.hdf5lib.structs;hdf.hdf5lib" diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index 21e9d22..dc9cc01 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_JNI C CXX) +project (HDF5_JAVA_JNI C) set (HDF5_JAVA_JNI_CSRCS ${HDF5_JAVA_JNI_SOURCE_DIR}/exceptionImp.c @@ -44,12 +44,11 @@ set (HDF5_JAVA_JNI_CHDRS ${HDF5_JAVA_JNI_SOURCE_DIR}/nativeData.h ) -INCLUDE_DIRECTORIES( ${HDF5_JAVA_JNI_SOURCE_DIR} ) - set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) ########### JNI libraries always must be built shared ############### add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS}) +target_include_directories(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE ${HDF5_BINARY_DIR} ${HDF5_JAVA_JNI_SOURCE_DIR}) TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni) diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index c48cf01..5cded3b 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -1,12 +1,9 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_JAVA_TEST Java) +project (HDF5_JAVA_TEST Java) set (CMAKE_VERBOSE_MAKEFILE 1) -INCLUDE_DIRECTORIES ( - ${HDF5_JAVA_JNI_BINARY_DIR} - ${HDF5_JAVA_HDF5_LIB_DIR} -) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_JNI_BINARY_DIR};${HDF5_JAVA_HDF5_LIB_DIR}") set (HDF5_JAVA_TEST_SOURCES TestH5.java diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 169a06f..1c38c84 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -188,7 +188,7 @@ string(TOLOWER ${LIB_TYPE} SEARCH_TYPE) find_package (HDF5 NAMES hdf5 COMPONENTS C ${SEARCH_TYPE}) # find_package (HDF5) # Find non-cmake built HDF5 -INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR}) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIR}") set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_${LIB_TYPE}_LIBRARY}) set (example hdf_example) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e8a897..435fe9a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_SRC C CXX) +project (HDF5_SRC C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below @@ -858,6 +858,7 @@ endif () # specific type checks inside #----------------------------------------------------------------------------- add_executable (H5detect ${HDF5_SRC_DIR}/H5detect.c) +target_include_directories(H5detect PRIVATE ${HDF5_BINARY_DIR}) TARGET_C_PROPERTIES (H5detect STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5detect "ws2_32.lib") @@ -874,6 +875,7 @@ add_custom_command ( ) add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) +target_include_directories(H5make_libsettings PRIVATE ${HDF5_BINARY_DIR}) TARGET_C_PROPERTIES (H5make_libsettings STATIC " " " ") if (MSVC OR MINGW) target_link_libraries (H5make_libsettings "ws2_32.lib") @@ -896,6 +898,7 @@ add_custom_command ( set (gen_SRCS ${HDF5_BINARY_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} PUBLIC "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) @@ -905,14 +908,16 @@ set_global_variable (HDF5_LIBRARIES_TO_EXPORT ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_LIB_TARGET} ${HDF5_LIB_NAME} STATIC 0) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES FOLDER libraries - INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include> ) +## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,O,S,ST,T,Z" +#all_packages="AC,B2,CX,D,F,HL,I,O,S,ST,T,Z" option (HDF5_ENABLE_DEBUG_APIS "Turn on extra debug output in all packages" OFF) if (HDF5_ENABLE_DEBUG_APIS) set_target_properties (${HDF5_LIB_TARGET} PROPERTIES COMPILE_DEFINITIONS - "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5B2_DEBUG;H5AC_DEBUG" + "H5Z_DEBUG;H5T_DEBUG;H5ST_DEBUG;H5S_DEBUG;H5O_DEBUG;H5I_DEBUG;H5HL_DEBUG;H5F_DEBUG;H5D_DEBUG;H5CX_DEBUG;H5B2_DEBUG;H5AC_DEBUG" ) endif () set (install_targets ${HDF5_LIB_TARGET}) @@ -935,6 +940,7 @@ if (BUILD_SHARED_LIBS) ) set (shared_gen_SRCS ${HDF5_BINARY_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} PUBLIC "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) @@ -973,6 +979,7 @@ if (NOT HDF5_INSTALL_NO_DEVELOPMENT) FILES ${H5_PUBLIC_HEADERS} ${H5_GENERATED_HEADERS} + ${HDF5_BINARY_DIR}/H5pubconf.h DESTINATION ${HDF5_INSTALL_INCLUDE_DIR} COMPONENT diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ec560f2..3756dc0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TEST) +project (HDF5_TEST C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below @@ -9,9 +9,8 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) #----------------------------------------------------------------------------- # Generate the H5srcdir_str.h file containing user settings needed by compilation #----------------------------------------------------------------------------- -set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +set (srcdir ${HDF5_TEST_SOURCE_DIR}) configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) ################################################################################# # Define Test Library Sources @@ -30,6 +29,7 @@ set (TEST_LIB_HEADERS ) add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) +set_property(TARGET ${HDF5_TEST_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "ws2_32.lib") @@ -47,6 +47,7 @@ set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES if (BUILD_SHARED_LIBS) add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS}) + set_property(TARGET ${HDF5_TEST_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "ws2_32.lib") @@ -94,10 +95,9 @@ endif () set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) + set_property(TARGET ${HDF5_TEST_PLUGIN_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") @@ -120,10 +120,9 @@ endif () set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}") set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}") set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c) + set_property(TARGET ${HDF5_TEST_PLUGIN_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB") @@ -251,11 +250,13 @@ set (H5_TESTS macro (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) + set_property(TARGET ${file} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) + set_property(TARGET ${file}-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR}") TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") target_link_libraries (${file}-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (${file}-shared PROPERTIES FOLDER test) @@ -280,11 +281,13 @@ endforeach () #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SOURCES}) +set_property(TARGET testhdf5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (testhdf5-shared ${testhdf5_SOURCES}) + set_property(TARGET testhdf5-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") target_link_libraries (testhdf5-shared PUBLIC ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (testhdf5-shared PROPERTIES FOLDER test) @@ -292,11 +295,13 @@ endif () #-- Adding test for cache_image add_executable (cache_image ${cache_image_SOURCES}) +set_property(TARGET cache_image APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (cache_image STATIC " " " ") target_link_libraries (cache_image ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache_image PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (cache_image-shared ${cache_image_SOURCES}) + set_property(TARGET cache_image-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (cache_image-shared SHARED " " " ") target_link_libraries (cache_image-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (cache_image-shared PROPERTIES FOLDER test) @@ -304,11 +309,13 @@ endif () #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) +set_property(TARGET ttsafe APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (ttsafe-shared ${ttsafe_SOURCES}) + set_property(TARGET ttsafe-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (ttsafe-shared PROPERTIES FOLDER test) @@ -387,6 +394,7 @@ endforeach () # This has to be copied to the test directory for execve() to find it # and it can't be renamed (i.e., no <foo>-shared). add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c) +set_property(TARGET accum_swmr_reader APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (accum_swmr_reader STATIC " " " ") target_link_libraries (accum_swmr_reader ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) @@ -402,11 +410,13 @@ endif () ############################################################################## if (BUILD_SHARED_LIBS) add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) + set_property(TARGET filter_plugin APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (filter_plugin SHARED " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) else () add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c) + set_property(TARGET filter_plugin APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (filter_plugin STATIC " " " ") target_link_libraries (filter_plugin ${HDF5_TEST_LIB_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) @@ -417,11 +427,13 @@ endif () ############################################################################## set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) add_executable (use_append_chunk ${use_append_chunk_SOURCES}) +set_property(TARGET use_append_chunk APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (use_append_chunk STATIC " " " ") target_link_libraries (use_append_chunk ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (use_append_chunk PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES}) + set_property(TARGET use_append_chunk-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (use_append_chunk-shared SHARED " " " ") target_link_libraries (use_append_chunk-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test) @@ -429,11 +441,13 @@ endif () set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) +set_property(TARGET use_append_mchunks APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (use_append_mchunks STATIC " " " ") target_link_libraries (use_append_mchunks ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (use_append_mchunks PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES}) + set_property(TARGET use_append_mchunks-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED " " " ") target_link_libraries (use_append_mchunks-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test) @@ -441,11 +455,13 @@ endif () set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) +set_property(TARGET use_disable_mdc_flushes APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC " " " ") target_link_libraries (use_disable_mdc_flushes ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) if (BUILD_SHARED_LIBS) add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES}) + set_property(TARGET use_disable_mdc_flushes-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED " " " ") target_link_libraries (use_disable_mdc_flushes-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 04cc41f..7b93311 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1008,6 +1008,7 @@ endif () if (HDF5_BUILD_GENERATORS) macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) + set_property(TARGET ${genfile} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index b1b9ce1..326c34f 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,13 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TEST_PAR) +project (HDF5_TEST_PAR C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below #----------------------------------------------------------------------------- add_definitions (${HDF_EXTRA_C_FLAGS}) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib ) #----------------------------------------------------------------------------- # Define Tests #----------------------------------------------------------------------------- @@ -28,6 +26,7 @@ set (testphdf5_SOURCES #-- Adding test for testhdf5 add_executable (testphdf5 ${testphdf5_SOURCES}) +set_property(TARGET testphdf5 APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") target_link_libraries (testphdf5 PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) @@ -37,6 +36,7 @@ set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) + set_property(TARGET ${file} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} PUBLIC ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 5576f5c..1047138 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS) +project (HDF5_TOOLS C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below @@ -11,11 +11,6 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- add_subdirectory (lib) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) - #-- Add the test sources add_subdirectory (src) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index e5a6439..090c8a4 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_LIB) +project (HDF5_TOOLS_LIB C) #----------------------------------------------------------------------------- # Apply Definitions to compiler in this directory and below @@ -38,6 +38,8 @@ set (H5_TOOLS_LIB_HDRS ) add_library (${HDF5_TOOLS_LIB_TARGET} STATIC ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) +target_include_directories(${HDF5_TOOLS_LIB_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}") +set_property(TARGET ${HDF5_TOOLS_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TOOLS_LIB_TARGET} STATIC " " " ") target_link_libraries (${HDF5_TOOLS_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) @@ -54,6 +56,8 @@ set (install_targets ${HDF5_TOOLS_LIB_TARGET}) if (BUILD_SHARED_LIBS) add_library (${HDF5_TOOLS_LIBSH_TARGET} SHARED ${H5_TOOLS_LIB_SOURCES} ${H5_TOOLS_LIB_HDRS}) + target_include_directories(${HDF5_TOOLS_LIBSH_TARGET} INTERFACE "${HDF5_TOOLS_LIB_SOURCE_DIR}") + set_property(TARGET ${HDF5_TOOLS_LIBSH_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TOOLS_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TOOLS_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) if (HDF5_ENABLE_PARALLEL AND MPI_C_FOUND) diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt index 9364658..757c9cd 100644 --- a/tools/src/CMakeLists.txt +++ b/tools/src/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) +project (HDF5_TOOLS_SRC C) #-- Add the h5diff and test executables add_subdirectory (h5diff) diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 8423e5a..9fe6a5f 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5COPY) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5COPY C) # -------------------------------------------------------------------- # Add the h5copy and test executables # -------------------------------------------------------------------- add_executable (h5copy ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) +set_property(TARGET h5copy APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5copy STATIC " " " ") target_link_libraries (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5copy PROPERTIES FOLDER tools) @@ -19,6 +15,7 @@ set (H5_DEP_EXECUTABLES h5copy) if (BUILD_SHARED_LIBS) add_executable (h5copy-shared ${HDF5_TOOLS_SRC_H5COPY_SOURCE_DIR}/h5copy.c) + set_property(TARGET h5copy-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5copy-shared SHARED " " " ") target_link_libraries (h5copy-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5copy-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 9e9f1ea..fd8ede3 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5DIFF) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5DIFF C) # -------------------------------------------------------------------- # Add the h5diff executables @@ -13,6 +8,7 @@ add_executable (h5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) +set_property(TARGET h5diff APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5diff STATIC " " " ") target_link_libraries (h5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5diff PROPERTIES FOLDER tools) @@ -25,6 +21,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c ) + set_property(TARGET h5diff-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5diff-shared SHARED " " " ") target_link_libraries (h5diff-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5diff-shared PROPERTIES FOLDER tools) @@ -38,6 +35,7 @@ if (H5_HAVE_PARALLEL) ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/ph5diff_main.c ) + set_property(TARGET ph5diff APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (ph5diff STATIC " " " ") target_link_libraries (ph5diff ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (ph5diff PROPERTIES FOLDER tools) diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index 1133218..6f74ac6 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5DUMP) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5DUMP C) # -------------------------------------------------------------------- # Add the h5dump executables @@ -14,6 +9,7 @@ add_executable (h5dump ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) +set_property(TARGET h5dump APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5dump STATIC " " " ") target_link_libraries (h5dump ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dump PROPERTIES FOLDER tools) @@ -27,6 +23,7 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c ) + set_property(TARGET h5dump-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5dump-shared SHARED " " " ") target_link_libraries (h5dump-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5dump-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 4acc999..beebeac 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5FC) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5FC C) # -------------------------------------------------------------------- # Add the h5format_convert executables # -------------------------------------------------------------------- add_executable (h5format_convert ${HDF5_TOOLS_SRC_H5FC_SOURCE_DIR}/h5format_convert.c) +set_property(TARGET h5format_convert APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5format_convert STATIC " " " ") target_link_libraries (h5format_convert ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5format_convert PROPERTIES FOLDER tools) diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index d628c9b..d79c4f8 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5IMPORT) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5IMPORT C) # -------------------------------------------------------------------- # Add the h5import executables # -------------------------------------------------------------------- add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) +set_property(TARGET h5import APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5import STATIC " " " ") target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) #set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 59caf44..c40405b 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -1,21 +1,18 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5JAM) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5JAM C) # -------------------------------------------------------------------- # Add the h5jam executables # -------------------------------------------------------------------- add_executable (h5jam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5jam.c) +set_property(TARGET h5jam APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5jam STATIC " " " ") target_link_libraries (h5jam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5jam PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5jam") add_executable (h5unjam ${HDF5_TOOLS_SRC_H5JAM_SOURCE_DIR}/h5unjam.c) +set_property(TARGET h5unjam APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5unjam STATIC " " " ") target_link_libraries (h5unjam ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5unjam PROPERTIES FOLDER tools) diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index e9ecd44..af3a552 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5LS) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5LS C) #----------------------------------------------------------------------------- # Add the h5ls executable #----------------------------------------------------------------------------- add_executable (h5ls ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) +set_property(TARGET h5ls APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5ls STATIC " " " ") target_link_libraries (h5ls ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5ls PROPERTIES FOLDER tools) @@ -19,6 +15,7 @@ set (H5_DEP_EXECUTABLES h5ls) if (BUILD_SHARED_LIBS) add_executable (h5ls-shared ${HDF5_TOOLS_SRC_H5LS_SOURCE_DIR}/h5ls.c) + set_property(TARGET h5ls-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5ls-shared SHARED " " " ") target_link_libraries (h5ls-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5ls-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 211c947..631b426 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,11 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5REPACK) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) +project (HDF5_TOOLS_SRC_H5REPACK C) # -------------------------------------------------------------------- # Add h5Repack executables @@ -21,6 +15,7 @@ set (REPACK_COMMON_SOURCES ) add_executable (h5repack ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) +set_property(TARGET h5repack APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repack STATIC " " " ") target_link_libraries (h5repack ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repack PROPERTIES FOLDER tools) @@ -30,6 +25,7 @@ set (H5_DEP_EXECUTABLES h5repack) if (BUILD_SHARED_LIBS) add_executable (h5repack-shared ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_main.c) + set_property(TARGET h5repack-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repack-shared SHARED " " " ") target_link_libraries (h5repack-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5repack-shared PROPERTIES FOLDER tools) diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index 7842aa8..2f7e957 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -1,15 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_H5STAT) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_H5STAT C) # -------------------------------------------------------------------- # Add the h5stat executables # -------------------------------------------------------------------- add_executable (h5stat ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) +set_property(TARGET h5stat APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5stat STATIC " " " ") target_link_libraries (h5stat ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5stat PROPERTIES FOLDER tools) @@ -19,6 +15,7 @@ set (H5_DEP_EXECUTABLES h5stat) if (BUILD_SHARED_LIBS) add_executable (h5stat-shared ${HDF5_TOOLS_SRC_H5STAT_SOURCE_DIR}/h5stat.c) + set_property(TARGET h5stat-shared APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5stat-shared SHARED " " " ") target_link_libraries (h5stat-shared ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5stat-shared PROPERTIES FOLDER tools) diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 948c6d4..021912e 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -1,34 +1,33 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_SRC_MISC) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_SRC_MISC C) # -------------------------------------------------------------------- # Add the misc executables # -------------------------------------------------------------------- #-- Misc Executables add_executable (h5debug ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5debug.c) +set_property(TARGET h5debug APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5debug STATIC " " " ") target_link_libraries (h5debug ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5debug PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5debug") add_executable (h5repart ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5repart.c) +set_property(TARGET h5repart APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repart STATIC " " " ") target_link_libraries (h5repart ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5repart") add_executable (h5mkgrp ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5mkgrp.c) +set_property(TARGET h5mkgrp APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5mkgrp STATIC " " " ") target_link_libraries (h5mkgrp ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5mkgrp PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5mkgrp") add_executable (h5clear ${HDF5_TOOLS_SRC_MISC_SOURCE_DIR}/h5clear.c) +set_property(TARGET h5clear APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5clear STATIC " " " ") target_link_libraries (h5clear ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5clear PROPERTIES FOLDER tools) diff --git a/tools/test/CMakeLists.txt b/tools/test/CMakeLists.txt index f194d7a..f4106fc 100644 --- a/tools/test/CMakeLists.txt +++ b/tools/test/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) +project (HDF5_TOOLS_TEST C) #-- Add the h5diff tests add_subdirectory (h5diff) diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 9a171ba..583f808 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -1,17 +1,12 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5COPY) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_TEST_H5COPY C) # -------------------------------------------------------------------- # Add the h5copy test executables # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c) + set_property(TARGET h5copygentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5copygentest STATIC " " " ") target_link_libraries (h5copygentest ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) @@ -26,10 +21,9 @@ if (BUILD_SHARED_LIBS) set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy") set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c) + set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index dd7da66..edab48b 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -1,22 +1,18 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5DIFF) +project (HDF5_TOOLS_TEST_H5DIFF C) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5diff and test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) + set_property(TARGET h5diffgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") + target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - # -------------------------------------------------------------------- - # Add the h5diff and test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c) - TARGET_C_PROPERTIES (h5diffgentest STATIC " " " ") - target_link_libraries (h5diffgentest ${HDF5_LIB_TARGET}) - set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - - #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) - endif () + #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) +endif () #----------------------------------------------------------------------------- # If plugin library tests can be tested @@ -25,10 +21,9 @@ if (BUILD_SHARED_LIBS) set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff") set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c) + set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 4ea1738..b9f110f 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -1,55 +1,50 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5DUMP) +project (HDF5_TOOLS_TEST_H5DUMP C) #----------------------------------------------------------------------------- -# Setup include Directories +# If plugin library tests can be tested #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") - - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different +set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump") +set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") +set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) + +add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") +target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + +# make plugins dir +file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") +#----------------------------------------------------------------------------- +# Copy plugin library to a plugins folder +#----------------------------------------------------------------------------- +add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" - ) +) - # -------------------------------------------------------------------- - # Add the h5dump test executable - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) - TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") - target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) +# -------------------------------------------------------------------- +# Add the h5dump test executable +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c) + set_property(TARGET h5dumpgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5dumpgentest STATIC " " " ") + target_link_libraries (h5dumpgentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) - endif () + #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) +endif () - include (CMakeTests.cmake) +include (CMakeTests.cmake) - include (CMakeTestsPBITS.cmake) +include (CMakeTestsPBITS.cmake) - include (CMakeTestsVDS.cmake) +include (CMakeTestsVDS.cmake) - include (CMakeTestsXML.cmake) +include (CMakeTestsXML.cmake) diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index a27c78a..37449f2 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -1,26 +1,23 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5FC) +project (HDF5_TOOLS_TEST_H5FC C) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5format_convert test executables +# -------------------------------------------------------------------- +add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) +set_property(TARGET h5fc_chk_idx APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (h5fc_chk_idx STATIC " " " ") +target_link_libraries (h5fc_chk_idx ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) - # -------------------------------------------------------------------- - # Add the h5format_convert test executables - # -------------------------------------------------------------------- - add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c) - TARGET_C_PROPERTIES (h5fc_chk_idx STATIC " " " ") - target_link_libraries (h5fc_chk_idx ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) +if (HDF5_BUILD_GENERATORS) + add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) + set_property(TARGET h5fc_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5fc_gentest STATIC " " " ") + target_link_libraries (h5fc_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) - if (HDF5_BUILD_GENERATORS) - add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) - TARGET_C_PROPERTIES (h5fc_gentest STATIC " " " ") - target_link_libraries (h5fc_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5fc_gentest COMMAND $<TARGET_FILE:h5fc_gentest>) +endif () - #add_test (NAME h5fc_gentest COMMAND $<TARGET_FILE:h5fc_gentest>) - endif () - - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index 2cb212a..37029c4 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -1,17 +1,13 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5IMPORT) +project (HDF5_TOOLS_TEST_H5IMPORT C) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5import executables +# -------------------------------------------------------------------- +add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) +set_property(TARGET h5importtest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (h5importtest STATIC " " " ") +target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5importtest PROPERTIES FOLDER tools) - # -------------------------------------------------------------------- - # Add the h5import executables - # -------------------------------------------------------------------- - add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c) - TARGET_C_PROPERTIES (h5importtest STATIC " " " ") - target_link_libraries (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5importtest PROPERTIES FOLDER tools) - - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index b623860..2f01aa3 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -1,31 +1,29 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5JAM) +project (HDF5_TOOLS_TEST_H5JAM C) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5jam test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) + set_property(TARGET h5jamgentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") + target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) + set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - # -------------------------------------------------------------------- - # Add the h5jam test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c) - TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") - target_link_libraries (h5jamgentest ${HDF5_LIB_TARGET}) - set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - - #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) - endif () + #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) +endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) +set_property(TARGET getub APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (getub STATIC " " " ") target_link_libraries (getub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (getub PROPERTIES FOLDER tools) add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c) +set_property(TARGET tellub APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (tellub STATIC " " " ") target_link_libraries (tellub ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (tellub PROPERTIES FOLDER tools) - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index 5e7d2e2..8da3f4d 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -1,39 +1,33 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5LS) +project (HDF5_TOOLS_TEST_H5LS C) #----------------------------------------------------------------------------- -# Setup include Directories +# If plugin library tests can be tested #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls") +set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") +set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) +add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") +target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") - - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different - "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" - "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" - ) +# make plugins dir +file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") +#----------------------------------------------------------------------------- +# Copy plugin library to a plugins folder +#----------------------------------------------------------------------------- +add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different + "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" + "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" +) - include (CMakeTests.cmake) +include (CMakeTests.cmake) - include (CMakeTestsVDS.cmake) +include (CMakeTestsVDS.cmake) diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index dbe80f7..1381fd7 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -1,17 +1,11 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5REPACK) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/src/h5repack) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) +project (HDF5_TOOLS_TEST_H5REPACK C) # -------------------------------------------------------------------- # Add h5Repack test executables # -------------------------------------------------------------------- add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c) +set_property(TARGET testh5repack_detect_szip APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC " " " ") target_link_libraries (testh5repack_detect_szip ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) @@ -26,52 +20,53 @@ set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c ) add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c) +set_property(TARGET h5repacktest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5repacktest STATIC " " " ") target_link_libraries (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5repacktest PROPERTIES FOLDER tools) - #----------------------------------------------------------------------------- - # If plugin library tests can be tested - #----------------------------------------------------------------------------- - set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") - set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) - set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers") - set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}") - set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME}) - add_definitions (${HDF_EXTRA_C_FLAGS}) - INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) +#----------------------------------------------------------------------------- +# If plugin library tests can be tested +#----------------------------------------------------------------------------- +set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd") +set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}") +set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME}) +set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers") +set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}") +set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME}) - add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") +add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED " " " ") +target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") - add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c) - TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED " " " ") - target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TEST_LIB_TARGET}) - H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") +add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c) +set_property(TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED " " " ") +target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TEST_LIB_TARGET}) +H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") - # make plugins dir - file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") - #----------------------------------------------------------------------------- - # Copy plugin library to a plugins folder - #----------------------------------------------------------------------------- - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different +# make plugins dir +file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") +#----------------------------------------------------------------------------- +# Copy plugin library to a plugins folder +#----------------------------------------------------------------------------- +add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>" - ) - add_custom_command ( - TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different +) +add_custom_command ( + TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>" "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>" - ) +) - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index 5f645097..3d171fc 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -1,21 +1,17 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_H5STAT) +project (HDF5_TOOLS_TEST_H5STAT C) -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +# -------------------------------------------------------------------- +# Add the h5stat test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) + set_property(TARGET h5stat_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") + target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) + set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) - # -------------------------------------------------------------------- - # Add the h5stat test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c) - TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ") - target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET}) - set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) +endif () - #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) - endif () - - include (CMakeTests.cmake) +include (CMakeTests.cmake) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 084751a..baf1dea 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -1,41 +1,40 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_MISC) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) - - # -------------------------------------------------------------------- - # Add the misc test executables - # -------------------------------------------------------------------- - if (HDF5_BUILD_GENERATORS) - add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) - TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") - target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) - - add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) - TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") - target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) - #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $<TARGET_FILE:h5clear_gentest>) - - add_subdirectory (vds) - - endif () - - add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) - TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") - target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5repart_test PROPERTIES FOLDER tools) - - add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) - TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") - target_link_libraries (clear_open_chk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (clear_open_chk PROPERTIES FOLDER tools) - - include (CMakeTestsRepart.cmake) - include (CMakeTestsClear.cmake) - include (CMakeTestsMkgrp.cmake) +project (HDF5_TOOLS_TEST_MISC C) + +# -------------------------------------------------------------------- +# Add the misc test executables +# -------------------------------------------------------------------- +if (HDF5_BUILD_GENERATORS) + add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c) + set_property(TARGET h5repart_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5repart_gentest STATIC " " " ") + target_link_libraries (h5repart_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) + #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) + + add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) + set_property(TARGET h5clear_gentest APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") + TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") + target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) + #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $<TARGET_FILE:h5clear_gentest>) + + add_subdirectory (vds) + +endif () + +add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c) +set_property(TARGET h5repart_test APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (h5repart_test STATIC " " " ") +target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (h5repart_test PROPERTIES FOLDER tools) + +add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) +set_property(TARGET clear_open_chk APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") +target_link_libraries (clear_open_chk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +set_target_properties (clear_open_chk PROPERTIES FOLDER tools) + +include (CMakeTestsRepart.cmake) +include (CMakeTestsClear.cmake) +include (CMakeTestsMkgrp.cmake) diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 50aade4..586be6c 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,13 +1,9 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_MISC_VDS) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) +project (HDF5_TOOLS_TEST_MISC_VDS C) MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) + set_property(TARGET ${genfile} APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (${genfile} STATIC " " " ") target_link_libraries (${genfile} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 5104b90..b7c9263 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -1,16 +1,5 @@ cmake_minimum_required (VERSION 3.10) -PROJECT (HDF5_TOOLS_TEST_PERFORM ) - -#----------------------------------------------------------------------------- -# Apply Definitions to compiler in this directory and below -#----------------------------------------------------------------------------- -add_definitions (${HDF_EXTRA_C_FLAGS}) - -#----------------------------------------------------------------------------- -# Setup include Directories -#----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib ) +project (HDF5_TOOLS_TEST_PERFORM C) # -------------------------------------------------------------------- # Add the executables @@ -21,6 +10,7 @@ set (h5perf_serial_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial ${h5perf_serial_SOURCES}) +set_property(TARGET h5perf_serial APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf_serial STATIC " " " ") target_link_libraries (h5perf_serial ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial PROPERTIES FOLDER perform) @@ -32,6 +22,7 @@ if (HDF5_BUILD_PERFORM_STANDALONE) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c ) add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES}) + set_property(TARGET h5perf_serial_alone APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf_serial_alone STATIC " " " ") target_link_libraries (h5perf_serial_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) @@ -44,9 +35,10 @@ endif () set (chunk_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c ) -ADD_EXECUTABLE(chunk ${chunk_SOURCES}) +add_executable(chunk ${chunk_SOURCES}) +set_property(TARGET chunk APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (chunk STATIC " " " ") -TARGET_LINK_LIBRARIES(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) +target_link_libraries(chunk ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (chunk PROPERTIES FOLDER perform) #-- Adding test for iopipe @@ -54,6 +46,7 @@ set (iopipe_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c ) add_executable (iopipe ${iopipe_SOURCES}) +set_property(TARGET iopipe APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (iopipe STATIC " " " ") target_link_libraries (iopipe ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (iopipe PROPERTIES FOLDER perform) @@ -63,24 +56,27 @@ set (overhead_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c ) add_executable (overhead ${overhead_SOURCES}) +set_property(TARGET overhead APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (overhead STATIC " " " ") target_link_libraries (overhead ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (overhead PROPERTIES FOLDER perform) #-- Adding test for perf_meta - set (perf_meta_SOURCES - ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c - ) - add_executable (perf_meta ${perf_meta_SOURCES}) - TARGET_C_PROPERTIES (perf_meta STATIC " " " ") - target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - set_target_properties (perf_meta PROPERTIES FOLDER perform) +set (perf_meta_SOURCES + ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c +) +add_executable (perf_meta ${perf_meta_SOURCES}) +set_property(TARGET perf_meta APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") +TARGET_C_PROPERTIES (perf_meta STATIC " " " ") +target_link_libraries (perf_meta ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) +set_target_properties (perf_meta PROPERTIES FOLDER perform) #-- Adding test for zip_perf set (zip_perf_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c ) add_executable (zip_perf ${zip_perf_SOURCES}) +set_property(TARGET zip_perf APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (zip_perf STATIC " " " ") target_link_libraries (zip_perf ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (zip_perf PROPERTIES FOLDER perform) @@ -92,6 +88,7 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf ${h5perf_SOURCES}) + set_property(TARGET h5perf APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf STATIC " " " ") target_link_libraries (h5perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf PROPERTIES FOLDER perform) @@ -103,6 +100,7 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING) ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c ) add_executable (h5perf_alone ${h5perf_alone_SOURCES}) + set_property(TARGET h5perf_alone APPEND PROPERTY INCLUDE_DIRECTORIES "${HDF5_SRC_DIR};${HDF5_BINARY_DIR}") TARGET_C_PROPERTIES (h5perf_alone STATIC " " " ") target_link_libraries (h5perf_alone ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (h5perf_alone PROPERTIES FOLDER perform) |