summaryrefslogtreecommitdiffstats
path: root/Tests/Fortran/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-12-28 16:50:29 (GMT)
committerBrad King <brad.king@kitware.com>2007-12-28 16:50:29 (GMT)
commitf4fb1a4f91ead40d04cfed4a570e25821a1e37ef (patch)
treee6144adf433a3fb8bcac63aadea946ed04a9d94c /Tests/Fortran/CMakeLists.txt
parent81f6e86f12721da4eb9d0d0b4de290a7ef8f55e2 (diff)
downloadCMake-f4fb1a4f91ead40d04cfed4a570e25821a1e37ef.zip
CMake-f4fb1a4f91ead40d04cfed4a570e25821a1e37ef.tar.gz
CMake-f4fb1a4f91ead40d04cfed4a570e25821a1e37ef.tar.bz2
ENH: Add tests of Fortran module dependencies across directories and on external modules. Tests based on cases provided by Maik in issue #5809.
Diffstat (limited to 'Tests/Fortran/CMakeLists.txt')
-rw-r--r--Tests/Fortran/CMakeLists.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index a8b861c..fc22a01 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -22,5 +22,34 @@ IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
in_interface/main.f90
in_interface/module.f90)
+ # Build the external project separately using a custom target.
+ # Make sure it uses the same build configuration as this test.
+ IF(CMAKE_CONFIGURATION_TYPES)
+ SET(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
+ ELSE(CMAKE_CONFIGURATION_TYPES)
+ SET(External_CONFIG_TYPE)
+ ENDIF(CMAKE_CONFIGURATION_TYPES)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${testf_BINARY_DIR}/ExternalProject
+ COMMAND ${CMAKE_CTEST_COMMAND}
+ ARGS ${External_CONFIG_TYPE}
+ --build-and-test
+ ${testf_SOURCE_DIR}/External
+ ${testf_BINARY_DIR}/External
+ --build-noclean
+ --build-two-config
+ --build-project ExtFort
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-options -DCMAKE_Fortran_COMPILER:STRING=${CMAKE_Fortran_COMPILER}
+ -DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}
+ -DCMAKE_Fortran_FLAGS_DEBUG:STRING=${CMAKE_Fortran_FLAGS_DEBUG}
+ -DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}
+ -DCMAKE_Fortran_FLAGS_MINSIZEREL:STRING=${CMAKE_Fortran_FLAGS_MINSIZEREL}
+ -DCMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_Fortran_FLAGS_RELWITHDEBINFO}
+ )
+ ADD_CUSTOM_TARGET(ExternalTarget ALL DEPENDS ${testf_BINARY_DIR}/ExternalProject)
+
ADD_SUBDIRECTORY(Library)
+ ADD_SUBDIRECTORY(Executable)
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)