From 531f4d839d92f3991fed30b1587eddabb949a2b0 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 5 Jan 2018 14:30:23 -0600 Subject: Fix link_libs and static CRT fortran --- config/cmake_ext_mod/HDFUseFortran.cmake | 8 ++++++++ testpar/CMakeLists.txt | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 7bf4d81..5be2c49 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -15,6 +15,14 @@ #------------------------------------------------------------------------------- ENABLE_LANGUAGE (Fortran) +#------------------------------------------------------------------------------- +# Fix Fortran flags if we are compiling staticly on Windows using +# Windows_MT.cmake from config/cmake/UserMacros +#------------------------------------------------------------------------------- +if (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +endif () + #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 1043cd6..629216f 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -29,7 +29,7 @@ set (testphdf5_SRCS add_executable (testphdf5 ${testphdf5_SRCS}) TARGET_NAMING (testphdf5 STATIC) TARGET_C_PROPERTIES (testphdf5 STATIC " " " ") -target_link_libraries (testphdf5 ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) +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 () @@ -39,7 +39,7 @@ MACRO (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) TARGET_NAMING (${file} STATIC) TARGET_C_PROPERTIES (${file} STATIC " " " ") - target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} PUBLIC ${HDF5_LIB_TARGET}) + 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 () -- cgit v0.12