From aef8110c36773c11283f998c38998d364be9b054 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Wed, 9 Oct 2002 15:54:34 -0400 Subject: added test of SET CACHE FORCE --- Tests/Complex/CMakeLists.txt | 6 ++++++ Tests/Complex/Executable/complex.cxx | 6 ++++++ Tests/Complex/cmTestConfigure.h.in | 3 +++ Tests/ComplexOneConfig/CMakeLists.txt | 6 ++++++ Tests/ComplexOneConfig/Executable/complex.cxx | 6 ++++++ Tests/ComplexOneConfig/cmTestConfigure.h.in | 3 +++ Tests/ComplexRelativePaths/CMakeLists.txt | 6 ++++++ Tests/ComplexRelativePaths/Executable/complex.cxx | 6 ++++++ Tests/ComplexRelativePaths/cmTestConfigure.h.in | 3 +++ 9 files changed, 45 insertions(+) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index 849ec3c..bcc56a5 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -68,6 +68,12 @@ LINK_DIRECTORIES( ) # +# check for SET CACHE FORCE +# +SET(FORCE_TEST 1 CACHE STRING "a test") +SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) + +# # Lib and exe path # SET (LIBRARY_OUTPUT_PATH diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index c5969cb..7aa4140 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -809,6 +809,12 @@ int main() cmFailed("IF inside a FOREACH block is broken"); #endif +#ifdef FORCE_TEST + cmFailed("CMake SET CACHE FORCE"); +#else + cmPassed("CMake SET CACHE FORCE"); +#endif + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index 350a9c0..0d380b1 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -64,3 +64,6 @@ // Test IF inside FOREACH #cmakedefine IF_INSIDE_FOREACH_THEN_EXECUTED #cmakedefine IF_INSIDE_FOREACH_ELSE_EXECUTED + +// Test SET CACHE FORCE +#cmakedefine FORCE_TEST diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index 849ec3c..bcc56a5 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -68,6 +68,12 @@ LINK_DIRECTORIES( ) # +# check for SET CACHE FORCE +# +SET(FORCE_TEST 1 CACHE STRING "a test") +SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) + +# # Lib and exe path # SET (LIBRARY_OUTPUT_PATH diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index c5969cb..7aa4140 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -809,6 +809,12 @@ int main() cmFailed("IF inside a FOREACH block is broken"); #endif +#ifdef FORCE_TEST + cmFailed("CMake SET CACHE FORCE"); +#else + cmPassed("CMake SET CACHE FORCE"); +#endif + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index 350a9c0..0d380b1 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -64,3 +64,6 @@ // Test IF inside FOREACH #cmakedefine IF_INSIDE_FOREACH_THEN_EXECUTED #cmakedefine IF_INSIDE_FOREACH_ELSE_EXECUTED + +// Test SET CACHE FORCE +#cmakedefine FORCE_TEST diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt index 849ec3c..bcc56a5 100644 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/CMakeLists.txt @@ -68,6 +68,12 @@ LINK_DIRECTORIES( ) # +# check for SET CACHE FORCE +# +SET(FORCE_TEST 1 CACHE STRING "a test") +SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) + +# # Lib and exe path # SET (LIBRARY_OUTPUT_PATH diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index c5969cb..7aa4140 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -809,6 +809,12 @@ int main() cmFailed("IF inside a FOREACH block is broken"); #endif +#ifdef FORCE_TEST + cmFailed("CMake SET CACHE FORCE"); +#else + cmPassed("CMake SET CACHE FORCE"); +#endif + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in index 350a9c0..0d380b1 100644 --- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in +++ b/Tests/ComplexRelativePaths/cmTestConfigure.h.in @@ -64,3 +64,6 @@ // Test IF inside FOREACH #cmakedefine IF_INSIDE_FOREACH_THEN_EXECUTED #cmakedefine IF_INSIDE_FOREACH_ELSE_EXECUTED + +// Test SET CACHE FORCE +#cmakedefine FORCE_TEST -- cgit v0.12