summaryrefslogtreecommitdiffstats
path: root/Tests/FortranModules/Library
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-22 18:23:39 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-22 18:52:01 (GMT)
commiteb8cd35684f2dc2f53d205d7738e1c01a12a493f (patch)
tree77732180392bf2da1fe0aa6facd25c9fe95e6614 /Tests/FortranModules/Library
parenta41c8724d155f1cd74ce36cdfbd10da0eac5b389 (diff)
downloadCMake-eb8cd35684f2dc2f53d205d7738e1c01a12a493f.zip
CMake-eb8cd35684f2dc2f53d205d7738e1c01a12a493f.tar.gz
CMake-eb8cd35684f2dc2f53d205d7738e1c01a12a493f.tar.bz2
Tests: Split Fortran module testing into separate FortranModules test
The main Fortran test is not granular enough. Split some into another test.
Diffstat (limited to 'Tests/FortranModules/Library')
-rw-r--r--Tests/FortranModules/Library/CMakeLists.txt11
-rw-r--r--Tests/FortranModules/Library/a.f903
-rw-r--r--Tests/FortranModules/Library/b.f902
-rw-r--r--Tests/FortranModules/Library/main.f903
4 files changed, 19 insertions, 0 deletions
diff --git a/Tests/FortranModules/Library/CMakeLists.txt b/Tests/FortranModules/Library/CMakeLists.txt
new file mode 100644
index 0000000..17438ca
--- /dev/null
+++ b/Tests/FortranModules/Library/CMakeLists.txt
@@ -0,0 +1,11 @@
+include_directories(${Library_MODDIR})
+add_library(subdir_mods a.f90 b.f90)
+add_executable(subdir_exe main.f90)
+target_link_libraries(subdir_exe subdir_mods)
+
+# Test module output directory if available.
+if(CMAKE_Fortran_MODDIR_FLAG)
+ set_target_properties(subdir_mods PROPERTIES
+ Fortran_MODULE_DIRECTORY modules
+ )
+endif()
diff --git a/Tests/FortranModules/Library/a.f90 b/Tests/FortranModules/Library/a.f90
new file mode 100644
index 0000000..3031c07
--- /dev/null
+++ b/Tests/FortranModules/Library/a.f90
@@ -0,0 +1,3 @@
+MODULE libraryModuleA
+ USE libraryModuleB
+END MODULE
diff --git a/Tests/FortranModules/Library/b.f90 b/Tests/FortranModules/Library/b.f90
new file mode 100644
index 0000000..ae1edcb
--- /dev/null
+++ b/Tests/FortranModules/Library/b.f90
@@ -0,0 +1,2 @@
+MODULE libraryModuleB
+END MODULE
diff --git a/Tests/FortranModules/Library/main.f90 b/Tests/FortranModules/Library/main.f90
new file mode 100644
index 0000000..2385408
--- /dev/null
+++ b/Tests/FortranModules/Library/main.f90
@@ -0,0 +1,3 @@
+PROGRAM MAINF90
+ USE libraryModuleA
+END PROGRAM MAINF90