summaryrefslogtreecommitdiffstats
path: root/Tests/ComplexRelativePaths
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-09-23 20:55:16 (GMT)
committerBrad King <brad.king@kitware.com>2006-09-23 20:55:16 (GMT)
commit13380569f37c969e1f3b3c722aa8ebb2551baf86 (patch)
treea7502e5a7a804b0f6de90cc5d1f99eba2e52946a /Tests/ComplexRelativePaths
parent1c429da781083751902fe24e9e1f6ed9ff4ca9e5 (diff)
downloadCMake-13380569f37c969e1f3b3c722aa8ebb2551baf86.zip
CMake-13380569f37c969e1f3b3c722aa8ebb2551baf86.tar.gz
CMake-13380569f37c969e1f3b3c722aa8ebb2551baf86.tar.bz2
ENH: Adding test for running preprocessor rules.
Diffstat (limited to 'Tests/ComplexRelativePaths')
-rw-r--r--Tests/ComplexRelativePaths/Library/CMakeLists.txt11
-rw-r--r--Tests/ComplexRelativePaths/Library/test_preprocess.cmake7
2 files changed, 18 insertions, 0 deletions
diff --git a/Tests/ComplexRelativePaths/Library/CMakeLists.txt b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
index 9d37900..29d7876 100644
--- a/Tests/ComplexRelativePaths/Library/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
@@ -103,3 +103,14 @@ SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1)
INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h)
+# Test generation of preprocessed sources.
+IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+ IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+ ADD_CUSTOM_TARGET(test_preprocess ALL
+ COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
+ COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
diff --git a/Tests/ComplexRelativePaths/Library/test_preprocess.cmake b/Tests/ComplexRelativePaths/Library/test_preprocess.cmake
new file mode 100644
index 0000000..d2d9fc6
--- /dev/null
+++ b/Tests/ComplexRelativePaths/Library/test_preprocess.cmake
@@ -0,0 +1,7 @@
+SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i)
+FILE(READ ${TEST_FILE} CONTENTS)
+IF("${CONTENTS}" MATCHES "Unable to close")
+ MESSAGE(STATUS "${TEST_FILE} created successfully!")
+ELSE("${CONTENTS}" MATCHES "Unable to close")
+ MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!")
+ENDIF("${CONTENTS}" MATCHES "Unable to close")