diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-05-22 15:23:16 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-05-22 15:23:16 (GMT) |
commit | e96ef71034fbeadcf2ed244b15a14b7151529d29 (patch) | |
tree | 0b07ebf5d12fc46ebfb5ae353a3d0ebad5033a85 /testpar/CMakeLists.txt | |
parent | e1e63edd359e3753c374440bdb295010c348e9bc (diff) | |
download | hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.zip hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.tar.gz hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.tar.bz2 |
HDFFV-9739 and cmake improvements merge from develop
Diffstat (limited to 'testpar/CMakeLists.txt')
-rw-r--r-- | testpar/CMakeLists.txt | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index b1b9ce1..e843811 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,14 +1,7 @@ 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,20 +21,24 @@ set (testphdf5_SOURCES #-- Adding test for testhdf5 add_executable (testphdf5 ${testphdf5_SOURCES}) -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) - target_link_libraries (testphdf5 PRIVATE ${MPI_C_LIBRARIES}) -endif () +target_include_directories(testphdf5 + PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" +) +TARGET_C_PROPERTIES (testphdf5 STATIC) +target_link_libraries (testphdf5 + PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}> +) set_target_properties (testphdf5 PROPERTIES FOLDER test/par) MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) - 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) - target_link_libraries (${file} PRIVATE ${MPI_C_LIBRARIES}) - endif () + target_include_directories(${file} + PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" + ) + TARGET_C_PROPERTIES (${file} STATIC) + target_link_libraries (${file} + PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} $<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}> + ) set_target_properties (${file} PROPERTIES FOLDER test/par) ENDMACRO (ADD_H5P_EXE file) |