summaryrefslogtreecommitdiffstats
path: root/fortran/test/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/test/CMakeLists.txt')
-rw-r--r--fortran/test/CMakeLists.txt21
1 files changed, 10 insertions, 11 deletions
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 3f049af..9c68860 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -31,13 +31,12 @@ set_target_properties (H5_test_buildiface PROPERTIES
Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
-if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared")
- set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
-endif ()
-if (NOT ONLY_SHARED_LIBS)
+if (NOT BUILD_SHARED_LIBS)
file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/static")
set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/static/${HDF_CFG_BUILD_TYPE})
+else ()
+ file (MAKE_DIRECTORY "${HDF5_FORTRAN_TESTS_BINARY_DIR}/shared")
+ set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${HDF_CFG_BUILD_TYPE})
endif ()
#-----------------------------------------------------------------------------
@@ -51,9 +50,9 @@ if (NOT BUILD_SHARED_LIBS)
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} STATIC)
- target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE
- ${HDF5_F90_C_LIB_TARGET}
- ${HDF5_TEST_LIB_TARGET}
+ target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET}
+ PRIVATE ${HDF5_F90_C_LIB_TARGET}
+ PUBLIC ${HDF5_TEST_LIB_TARGET}
)
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} STATIC 0)
set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
@@ -70,9 +69,9 @@ else ()
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB"
)
TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED)
- target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE
- ${HDF5_F90_C_LIBSH_TARGET}
- ${HDF5_TEST_LIBSH_TARGET}
+ target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET}
+ PRIVATE ${HDF5_F90_C_LIBSH_TARGET}
+ PUBLIC ${HDF5_TEST_LIBSH_TARGET}
)
H5_SET_LIB_OPTIONS (${HDF5_F90_C_TEST_LIBSH_TARGET} ${HDF5_F90_C_TEST_LIB_NAME} SHARED "F")
set_target_properties (${HDF5_F90_C_TEST_LIBSH_TARGET} PROPERTIES