diff options
author | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-05-08 22:17:45 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2018-05-08 22:17:45 (GMT) |
commit | b69bd0771eba5810db3db25217d5f32dc479185e (patch) | |
tree | c783a54f7cd8ef2ff504299749f5e18486a0363d /c++ | |
parent | 525b9f40e5c112b777a28d207ccb6fd454f156fc (diff) | |
parent | 0cc480d952e2e215f006fc172485fcbabc0f599f (diff) | |
download | hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.zip hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.gz hdf5-b69bd0771eba5810db3db25217d5f32dc479185e.tar.bz2 |
Merge branch 'develop' into hdf5_1_10.sync
Diffstat (limited to 'c++')
-rw-r--r-- | c++/CMakeLists.txt | 28 | ||||
-rw-r--r-- | c++/examples/CMakeLists.txt | 4 | ||||
-rw-r--r-- | c++/src/CMakeLists.txt | 17 | ||||
-rw-r--r-- | c++/test/CMakeLists.txt | 17 |
4 files changed, 36 insertions, 30 deletions
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} |