summaryrefslogtreecommitdiffstats
path: root/fortran/testpar
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-05-22 15:23:16 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-05-22 15:23:16 (GMT)
commite96ef71034fbeadcf2ed244b15a14b7151529d29 (patch)
tree0b07ebf5d12fc46ebfb5ae353a3d0ebad5033a85 /fortran/testpar
parente1e63edd359e3753c374440bdb295010c348e9bc (diff)
downloadhdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.zip
hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.tar.gz
hdf5-e96ef71034fbeadcf2ed244b15a14b7151529d29.tar.bz2
HDFFV-9739 and cmake improvements merge from develop
Diffstat (limited to 'fortran/testpar')
-rw-r--r--fortran/testpar/CMakeLists.txt37
1 files changed, 26 insertions, 11 deletions
diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt
index 979d305..0fe641f 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
@@ -16,18 +16,33 @@ add_executable (parallel_test
hyper.f90
mdset.f90
)
-TARGET_FORTRAN_PROPERTIES (parallel_test STATIC " " " ")
+target_include_directories (parallel_test
+ PRIVATE
+ ${TESTPAR_INCLUDES}
+)
+target_compile_options(parallel_test
+ PRIVATE
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}>
+)
target_link_libraries (parallel_test
- ${HDF5_F90_TEST_LIB_TARGET}
- ${HDF5_F90_LIB_TARGET}
- ${HDF5_LIB_TARGET}
- ${LINK_Fortran_LIBS}
+ PRIVATE
+ ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_Fortran_LIBS}
+ $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"ws2_32.lib">
+)
+#set_property(TARGET parallel_test APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE">
+#)
+#set_property(TARGET parallel_test APPEND PROPERTY
+# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}>
+#)
+if(MSVC)
+ set_property(TARGET parallel_test PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
+endif()
+set_target_properties (parallel_test PROPERTIES
+ FOLDER test/fortran
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static
)
-if (WIN32 AND MSVC)
- target_link_libraries (parallel_test "ws2_32.lib")
endif ()
-target_include_directories (parallel_test PRIVATE ${TESTPAR_INCLUDES})
-set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran)
-set_target_properties (parallel_test PROPERTIES FOLDER test/fortran)
include (CMakeTests.cmake)