summaryrefslogtreecommitdiffstats
path: root/Tests/Fortran
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-02-24 19:32:31 (GMT)
committerBrad King <brad.king@kitware.com>2009-02-24 19:32:31 (GMT)
commitff32962a682387ada24a7485a1bd21a3fc1b19d4 (patch)
tree40e54183224937af5d68cf6c26bf4feff6cefed1 /Tests/Fortran
parent66f2edbe635b6f0ae740a1a614cbddc831ce383e (diff)
downloadCMake-ff32962a682387ada24a7485a1bd21a3fc1b19d4.zip
CMake-ff32962a682387ada24a7485a1bd21a3fc1b19d4.tar.gz
CMake-ff32962a682387ada24a7485a1bd21a3fc1b19d4.tar.bz2
ENH: Test included header in Fortran preprocessing
This extends the Fortran preprocessing test to include a header file through a preprocessor directive.
Diffstat (limited to 'Tests/Fortran')
-rw-r--r--Tests/Fortran/CMakeLists.txt1
-rw-r--r--Tests/Fortran/include/test_preprocess.h5
-rw-r--r--Tests/Fortran/test_preprocess.F906
3 files changed, 7 insertions, 5 deletions
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index e8515c4..e4fc4c2 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -127,6 +127,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
in_interface/module.f90)
add_definitions(-DFOO -DBAR=1)
+ include_directories(${testf_SOURCE_DIR}/include)
add_executable(test_preprocess test_preprocess.F90)
set(TEST_MODULE_DEPENDS 1)
diff --git a/Tests/Fortran/include/test_preprocess.h b/Tests/Fortran/include/test_preprocess.h
new file mode 100644
index 0000000..29ac4b6
--- /dev/null
+++ b/Tests/Fortran/include/test_preprocess.h
@@ -0,0 +1,5 @@
+#ifdef BAR
+ PRINT * , 'BAR was defined via ADD_DEFINITIONS'
+#else
+ PRINT *, 'If you can read this something went wrong'
+#endif
diff --git a/Tests/Fortran/test_preprocess.F90 b/Tests/Fortran/test_preprocess.F90
index 374a6ff..e4f1fbe 100644
--- a/Tests/Fortran/test_preprocess.F90
+++ b/Tests/Fortran/test_preprocess.F90
@@ -46,10 +46,6 @@ PROGRAM PPTEST
#endif
! 0 ; <empty>
-#ifdef BAR
- PRINT * , 'BAR was defined via ADD_DEFINITIONS'
-#else
- PRINT *, 'If you can read this something went wrong'
-#endif
+#include "test_preprocess.h"
END PROGRAM