diff options
Diffstat (limited to 'fortran')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 49 | ||||
-rw-r--r-- | fortran/src/CMakeLists.txt | 143 | ||||
-rw-r--r-- | fortran/test/CMakeLists.txt | 58 | ||||
-rw-r--r-- | fortran/testpar/CMakeLists.txt | 5 |
4 files changed, 112 insertions, 143 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 1f59f32..2bf0bf6 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -8,7 +8,7 @@ PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Define Sources @@ -41,57 +41,52 @@ set (F2003_examples foreach (example ${examples}) add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") - if (WIN32) - set_property (TARGET f90_ex_${example} - APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS - ) - endif (WIN32) + TARGET_FORTRAN_PROPERTIES (f90_ex_${example} ${LIB_TYPE} " " " ") target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (f90_ex_${example} PROPERTIES FOLDER examples/fortran) + target_include_directories (f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f90_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endforeach (example ${examples}) if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") - if (WIN32) - set_property (TARGET f03_ex_${example} - APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS - ) - endif (WIN32) + TARGET_FORTRAN_PROPERTIES (f03_ex_${example} ${LIB_TYPE} " " " ") target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) + target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f03_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran03 + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endforeach (example ${F2003_examples}) endif (HDF5_ENABLE_F2003) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") - if (WIN32) - set_property (TARGET f90_ex_ph5example - APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS - ) - endif (WIN32) + TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example ${LIB_TYPE} " " " ") target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) - set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) + target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f90_ex_ph5example PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) if (BUILD_TESTING) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 22a091e..c015072 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -54,7 +54,10 @@ if (WIN32 AND MSVC) LINK_FLAGS "/SUBSYSTEM:CONSOLE" ) endif (WIN32 AND MSVC) -set_target_properties (H5test_FortranHavekind PROPERTIES LINKER_LANGUAGE Fortran) +set_target_properties (H5test_FortranHavekind PROPERTIES + LINKER_LANGUAGE Fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) set (CMD $<TARGET_FILE:H5test_FortranHavekind>) add_custom_command ( @@ -142,7 +145,7 @@ set (f90CStub_C_HDRS ) add_library (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) -TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} " " " ") +TARGET_C_PROPERTIES (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} " " " ") target_link_libraries (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) @@ -247,8 +250,7 @@ if (WIN32) HDF5F90_WINDOWS ) endif (WIN32) -TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +TARGET_FORTRAN_PROPERTIES (${HDF5_F90_LIB_TARGET} ${LIB_TYPE} " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET}) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) target_link_libraries (${HDF5_F90_LIB_TARGET} ${MPI_Fortran_LIBRARIES}) @@ -259,6 +261,7 @@ set_target_properties (${HDF5_F90_LIB_TARGET} PROPERTIES FOLDER libraries/fortran LINKER_LANGUAGE Fortran INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) #----------------------------------------------------------------------------- @@ -278,100 +281,50 @@ install ( ) if (WIN32) - install ( - FILES - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5fortran_types.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/hdf5.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5global.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5a.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5d.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5e.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5f.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5g.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5i.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5l.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5lib.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5o.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5p.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5r.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5s.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5t.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5z.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5a_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5d_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5e_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5f_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5l_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5lib_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5o_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5p_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5r_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5t_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5_dble_interface.mod - DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT - fortheaders - ) - if (H5_TEST_KIND_NAME) - install ( - FILES - ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/${H5_TEST_KIND_NAME}.mod - DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT - fortheaders - ) - endif (H5_TEST_KIND_NAME) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}) else (WIN32) - install ( - FILES - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5fortran_types.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/hdf5.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5global.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5f.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5a.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5d.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5e.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5f.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5g.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5i.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5l.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5lib.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5o.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5p.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5r.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5s.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5t.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5z.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5a_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5d_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5e_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5f_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5l_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5lib_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5o_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5p_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5r_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5t_provisional.mod - ${CMAKE_Fortran_MODULE_DIRECTORY}/h5_dble_interface.mod - DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT - fortheaders - ) - if (H5_TEST_KIND_NAME) - install ( - FILES - ${CMAKE_Fortran_MODULE_DIRECTORY}/${H5_TEST_KIND_NAME}.mod - DESTINATION - ${HDF5_INSTALL_INCLUDE_DIR} - COMPONENT - fortheaders - ) - endif (H5_TEST_KIND_NAME) + set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}) endif (WIN32) +set (mod_files + ${MOD_BUILD_DIR}/h5fortran_types.mod + ${MOD_BUILD_DIR}/hdf5.mod + ${MOD_BUILD_DIR}/h5global.mod + ${MOD_BUILD_DIR}/h5a.mod + ${MOD_BUILD_DIR}/h5d.mod + ${MOD_BUILD_DIR}/h5e.mod + ${MOD_BUILD_DIR}/h5f.mod + ${MOD_BUILD_DIR}/h5g.mod + ${MOD_BUILD_DIR}/h5i.mod + ${MOD_BUILD_DIR}/h5l.mod + ${MOD_BUILD_DIR}/h5lib.mod + ${MOD_BUILD_DIR}/h5o.mod + ${MOD_BUILD_DIR}/h5p.mod + ${MOD_BUILD_DIR}/h5r.mod + ${MOD_BUILD_DIR}/h5s.mod + ${MOD_BUILD_DIR}/h5t.mod + ${MOD_BUILD_DIR}/h5z.mod + ${MOD_BUILD_DIR}/h5a_provisional.mod + ${MOD_BUILD_DIR}/h5d_provisional.mod + ${MOD_BUILD_DIR}/h5e_provisional.mod + ${MOD_BUILD_DIR}/h5f_provisional.mod + ${MOD_BUILD_DIR}/h5l_provisional.mod + ${MOD_BUILD_DIR}/h5lib_provisional.mod + ${MOD_BUILD_DIR}/h5o_provisional.mod + ${MOD_BUILD_DIR}/h5p_provisional.mod + ${MOD_BUILD_DIR}/h5r_provisional.mod + ${MOD_BUILD_DIR}/h5t_provisional.mod + ${MOD_BUILD_DIR}/h5_dble_interface.mod +) +install ( + FILES + ${mod_files} + DESTINATION + ${HDF5_INSTALL_INCLUDE_DIR} + COMPONENT + fortheaders +) + #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 3395906..2893156 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -4,14 +4,14 @@ PROJECT (HDF5_FORTRAN_TESTS C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Test Lib #----------------------------------------------------------------------------- add_library (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} t.c) set_source_files_properties (t.c PROPERTIES LANGUAGE C) -TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} " " " ") +TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIB_TARGET} ${LIB_TYPE} " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} @@ -46,8 +46,7 @@ if (WIN32) endif (BUILD_SHARED_LIBS) set_property (TARGET ${HDF5_F90_TEST_LIB_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS) endif (WIN32) -TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} " " ${SHARED_LINK_FLAGS}) -set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran) +TARGET_FORTRAN_PROPERTIES (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} " " ${SHARED_LINK_FLAGS}) target_link_libraries (${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_C_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -58,6 +57,7 @@ set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test/fortran LINKER_LANGUAGE Fortran INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) #----------------------------------------------------------------------------- @@ -83,7 +83,7 @@ add_executable (testhdf5_fortran tHDF5.f90 ) TARGET_NAMING (testhdf5_fortran ${LIB_TYPE}) -TARGET_FORTRAN_PROPERTIES (testhdf5_fortran " " " ") +TARGET_FORTRAN_PROPERTIES (testhdf5_fortran ${LIB_TYPE} " " " ") target_link_libraries (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -92,8 +92,12 @@ target_link_libraries (testhdf5_fortran if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran "ws2_32.lib") endif (WIN32 AND MSVC) -set_target_properties (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) -set_target_properties (testhdf5_fortran PROPERTIES FOLDER test/fortran) +target_include_directories (testhdf5_fortran PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_target_properties (testhdf5_fortran PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) #-- Adding test for testhdf5_fortran_1_8 add_executable (testhdf5_fortran_1_8 @@ -105,7 +109,7 @@ add_executable (testhdf5_fortran_1_8 tHDF5_1_8.f90 ) TARGET_NAMING (testhdf5_fortran_1_8 ${LIB_TYPE}) -TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 " " " ") +TARGET_FORTRAN_PROPERTIES (testhdf5_fortran_1_8 ${LIB_TYPE} " " " ") target_link_libraries (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -114,8 +118,12 @@ target_link_libraries (testhdf5_fortran_1_8 if (WIN32 AND MSVC) target_link_libraries (testhdf5_fortran_1_8 "ws2_32.lib") endif (WIN32 AND MSVC) -set_target_properties (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) -set_target_properties (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) +target_include_directories (testhdf5_fortran_1_8 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_target_properties (testhdf5_fortran_1_8 PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) #-- Adding test for fortranlib_test_F03 if (HDF5_ENABLE_F2003) @@ -130,7 +138,7 @@ if (HDF5_ENABLE_F2003) tHDF5_F03.f90 ) TARGET_NAMING (fortranlib_test_F03 ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 " " " ") + TARGET_FORTRAN_PROPERTIES (fortranlib_test_F03 ${LIB_TYPE} " " " ") target_link_libraries (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -139,14 +147,18 @@ if (HDF5_ENABLE_F2003) if (WIN32 AND MSVC) target_link_libraries (fortranlib_test_F03 "ws2_32.lib") endif (WIN32 AND MSVC) - set_target_properties (fortranlib_test_F03 PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) + target_include_directories (fortranlib_test_F03 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (fortranlib_test_F03 PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endif (HDF5_ENABLE_F2003) #-- Adding test for fflush1 add_executable (fflush1 fflush1.f90) TARGET_NAMING (fflush1 ${LIB_TYPE}) -TARGET_FORTRAN_PROPERTIES (fflush1 " " " ") +TARGET_FORTRAN_PROPERTIES (fflush1 ${LIB_TYPE} " " " ") target_link_libraries (fflush1 ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} @@ -155,13 +167,17 @@ target_link_libraries (fflush1 if (WIN32 AND MSVC) target_link_libraries (fflush1 "ws2_32.lib") endif (WIN32 AND MSVC) -set_target_properties (fflush1 PROPERTIES LINKER_LANGUAGE Fortran) -set_target_properties (fflush1 PROPERTIES FOLDER test/fortran) +target_include_directories (fflush1 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_target_properties (fflush1 PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) #-- Adding test for fflush2 add_executable (fflush2 fflush2.f90) TARGET_NAMING (fflush2 ${LIB_TYPE}) -TARGET_FORTRAN_PROPERTIES (fflush2 " " " ") +TARGET_FORTRAN_PROPERTIES (fflush2 ${LIB_TYPE} " " " ") target_link_libraries (fflush2 ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -170,7 +186,11 @@ target_link_libraries (fflush2 if (WIN32 AND MSVC) target_link_libraries (fflush2 "ws2_32.lib") endif (WIN32 AND MSVC) -set_target_properties (fflush2 PROPERTIES LINKER_LANGUAGE Fortran) -set_target_properties (fflush2 PROPERTIES FOLDER test/fortran) +target_include_directories (fflush2 PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) +set_target_properties (fflush2 PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} +) include (CMakeTests.cmake) diff --git a/fortran/testpar/CMakeLists.txt b/fortran/testpar/CMakeLists.txt index dfe9ce7..98ef6c8 100644 --- a/fortran/testpar/CMakeLists.txt +++ b/fortran/testpar/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT (HDF5_FORTRAN_TESTPAR C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Add Tests @@ -17,7 +17,7 @@ add_executable (parallel_test mdset.f90 ) TARGET_NAMING (parallel_test ${LIB_TYPE}) -TARGET_FORTRAN_PROPERTIES (parallel_test " " " ") +TARGET_FORTRAN_PROPERTIES (parallel_test ${LIB_TYPE} " " " ") target_link_libraries (parallel_test ${HDF5_F90_TEST_LIB_TARGET} ${HDF5_F90_LIB_TARGET} @@ -27,6 +27,7 @@ target_link_libraries (parallel_test if (WIN32 AND MSVC) target_link_libraries (parallel_test "ws2_32.lib") endif (WIN32 AND MSVC) +target_include_directories (parallel_test PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}) set_target_properties (parallel_test PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (parallel_test PROPERTIES FOLDER test/fortran) |