From 7aa35093b8f96ef75bbf9160a55739be4861b9ea Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Mon, 22 Apr 2002 11:51:26 -0400 Subject: fixed for remove COMMAND --- Tests/Complex/CMakeLists.txt | 8 +++++++- Tests/Complex/Executable/CMakeLists.txt | 11 ++++++++--- Tests/Complex/Executable/cmVersion.h.in | 1 + Tests/Complex/Executable/complex.cxx | 13 +++++++++++++ Tests/Complex/cmTestConfigure.h.in | 4 +++- Tests/ComplexOneConfig/CMakeLists.txt | 8 +++++++- Tests/ComplexOneConfig/Executable/CMakeLists.txt | 11 ++++++++--- Tests/ComplexOneConfig/Executable/cmVersion.h.in | 1 + Tests/ComplexOneConfig/Executable/complex.cxx | 13 +++++++++++++ Tests/ComplexOneConfig/cmTestConfigure.h.in | 4 +++- Tests/ComplexRelativePaths/CMakeLists.txt | 8 +++++++- Tests/ComplexRelativePaths/Executable/CMakeLists.txt | 11 ++++++++--- Tests/ComplexRelativePaths/Executable/cmVersion.h.in | 1 + Tests/ComplexRelativePaths/Executable/complex.cxx | 13 +++++++++++++ Tests/ComplexRelativePaths/cmTestConfigure.h.in | 4 +++- 15 files changed, 96 insertions(+), 15 deletions(-) create mode 100644 Tests/Complex/Executable/cmVersion.h.in create mode 100644 Tests/ComplexOneConfig/Executable/cmVersion.h.in create mode 100644 Tests/ComplexRelativePaths/Executable/cmVersion.h.in diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index d80d654..609a43e 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -3,7 +3,6 @@ # PROJECT (Complex) -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) # @@ -139,6 +138,13 @@ IF (WIN32) ENDIF (WIN32) # +# Test a set and a remove +# +SET(REMOVE_STRING a b c d e f) +SET(removeVar1 c e) +REMOVE(REMOVE_STRING ${removeVar1} f) + +# # Configure file # (plug vars to #define so that they can be tested) # diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 1533f3e..165e7cd 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -1,9 +1,10 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 1.3) # # Create exe. # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET_SOURCE_FILES_PROPERTIES(complex - COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS") +SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS + "-DFILE_HAS_EXTRA_COMPILE_FLAGS") ADD_EXECUTABLE(complex complex) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -19,7 +20,7 @@ LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source) TARGET_LINK_LIBRARIES(complex CMakeLib debug CMakeLib - optimized CMakeLib) + optimized CgMakeLib) # # Output the files required by 'complex' to a file. @@ -36,4 +37,8 @@ SUBDIRS(Temp) INSTALL_TARGETS(/tmp complex) INSTALL_PROGRAMS(/tmp complex) +CONFIGURE_FILE( + ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in + ${Complex_BINARY_DIR}/cmVersion.h) + SOURCE_GROUP(A_GROUP ".cxx") diff --git a/Tests/Complex/Executable/cmVersion.h.in b/Tests/Complex/Executable/cmVersion.h.in new file mode 100644 index 0000000..de7522d --- /dev/null +++ b/Tests/Complex/Executable/cmVersion.h.in @@ -0,0 +1 @@ +#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 7d86179..89c3436 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -1,4 +1,5 @@ #include "cmTestConfigure.h" +#include "cmVersion.h" #include "ExtraSources/file1.h" #include "file2.h" #include "sharedFile.h" @@ -655,6 +656,18 @@ int main() { cmFailed("CMAKE_MINIMUM_REQUIRED_VERSION is not set to the expected 1.3"); } + + // ---------------------------------------------------------------------- + // Test REMOVE command + if (strcmp("a;b;d",REMOVE_STRING)) + { + cmPassed("REMOVE is working"); + } + else + { + cmFailed("REMOVE is not working"); + } + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/Complex/cmTestConfigure.h.in b/Tests/Complex/cmTestConfigure.h.in index 58a3f60..ed111fb 100644 --- a/Tests/Complex/cmTestConfigure.h.in +++ b/Tests/Complex/cmTestConfigure.h.in @@ -54,4 +54,6 @@ #if defined(_WIN32) && !defined(__CYGWIN__) #define REGISTRY_TEST_PATH "${REGISTRY_TEST_PATH}" #endif -#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" + +// Test Remove command +#define REMOVE_STRING "${REMOVE_STRING}" diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index d80d654..609a43e 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -3,7 +3,6 @@ # PROJECT (Complex) -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) # @@ -139,6 +138,13 @@ IF (WIN32) ENDIF (WIN32) # +# Test a set and a remove +# +SET(REMOVE_STRING a b c d e f) +SET(removeVar1 c e) +REMOVE(REMOVE_STRING ${removeVar1} f) + +# # Configure file # (plug vars to #define so that they can be tested) # diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 1533f3e..165e7cd 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -1,9 +1,10 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 1.3) # # Create exe. # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET_SOURCE_FILES_PROPERTIES(complex - COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS") +SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS + "-DFILE_HAS_EXTRA_COMPILE_FLAGS") ADD_EXECUTABLE(complex complex) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -19,7 +20,7 @@ LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source) TARGET_LINK_LIBRARIES(complex CMakeLib debug CMakeLib - optimized CMakeLib) + optimized CgMakeLib) # # Output the files required by 'complex' to a file. @@ -36,4 +37,8 @@ SUBDIRS(Temp) INSTALL_TARGETS(/tmp complex) INSTALL_PROGRAMS(/tmp complex) +CONFIGURE_FILE( + ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in + ${Complex_BINARY_DIR}/cmVersion.h) + SOURCE_GROUP(A_GROUP ".cxx") diff --git a/Tests/ComplexOneConfig/Executable/cmVersion.h.in b/Tests/ComplexOneConfig/Executable/cmVersion.h.in new file mode 100644 index 0000000..de7522d --- /dev/null +++ b/Tests/ComplexOneConfig/Executable/cmVersion.h.in @@ -0,0 +1 @@ +#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 7d86179..89c3436 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -1,4 +1,5 @@ #include "cmTestConfigure.h" +#include "cmVersion.h" #include "ExtraSources/file1.h" #include "file2.h" #include "sharedFile.h" @@ -655,6 +656,18 @@ int main() { cmFailed("CMAKE_MINIMUM_REQUIRED_VERSION is not set to the expected 1.3"); } + + // ---------------------------------------------------------------------- + // Test REMOVE command + if (strcmp("a;b;d",REMOVE_STRING)) + { + cmPassed("REMOVE is working"); + } + else + { + cmFailed("REMOVE is not working"); + } + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexOneConfig/cmTestConfigure.h.in b/Tests/ComplexOneConfig/cmTestConfigure.h.in index 58a3f60..ed111fb 100644 --- a/Tests/ComplexOneConfig/cmTestConfigure.h.in +++ b/Tests/ComplexOneConfig/cmTestConfigure.h.in @@ -54,4 +54,6 @@ #if defined(_WIN32) && !defined(__CYGWIN__) #define REGISTRY_TEST_PATH "${REGISTRY_TEST_PATH}" #endif -#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" + +// Test Remove command +#define REMOVE_STRING "${REMOVE_STRING}" diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt index d80d654..609a43e 100644 --- a/Tests/ComplexRelativePaths/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/CMakeLists.txt @@ -3,7 +3,6 @@ # PROJECT (Complex) -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) # @@ -139,6 +138,13 @@ IF (WIN32) ENDIF (WIN32) # +# Test a set and a remove +# +SET(REMOVE_STRING a b c d e f) +SET(removeVar1 c e) +REMOVE(REMOVE_STRING ${removeVar1} f) + +# # Configure file # (plug vars to #define so that they can be tested) # diff --git a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt index 1533f3e..165e7cd 100644 --- a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt @@ -1,9 +1,10 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 1.3) # # Create exe. # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET_SOURCE_FILES_PROPERTIES(complex - COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS") +SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS + "-DFILE_HAS_EXTRA_COMPILE_FLAGS") ADD_EXECUTABLE(complex complex) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) @@ -19,7 +20,7 @@ LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source) TARGET_LINK_LIBRARIES(complex CMakeLib debug CMakeLib - optimized CMakeLib) + optimized CgMakeLib) # # Output the files required by 'complex' to a file. @@ -36,4 +37,8 @@ SUBDIRS(Temp) INSTALL_TARGETS(/tmp complex) INSTALL_PROGRAMS(/tmp complex) +CONFIGURE_FILE( + ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in + ${Complex_BINARY_DIR}/cmVersion.h) + SOURCE_GROUP(A_GROUP ".cxx") diff --git a/Tests/ComplexRelativePaths/Executable/cmVersion.h.in b/Tests/ComplexRelativePaths/Executable/cmVersion.h.in new file mode 100644 index 0000000..de7522d --- /dev/null +++ b/Tests/ComplexRelativePaths/Executable/cmVersion.h.in @@ -0,0 +1 @@ +#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index 7d86179..89c3436 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -1,4 +1,5 @@ #include "cmTestConfigure.h" +#include "cmVersion.h" #include "ExtraSources/file1.h" #include "file2.h" #include "sharedFile.h" @@ -655,6 +656,18 @@ int main() { cmFailed("CMAKE_MINIMUM_REQUIRED_VERSION is not set to the expected 1.3"); } + + // ---------------------------------------------------------------------- + // Test REMOVE command + if (strcmp("a;b;d",REMOVE_STRING)) + { + cmPassed("REMOVE is working"); + } + else + { + cmFailed("REMOVE is not working"); + } + // ---------------------------------------------------------------------- // Summary diff --git a/Tests/ComplexRelativePaths/cmTestConfigure.h.in b/Tests/ComplexRelativePaths/cmTestConfigure.h.in index 58a3f60..ed111fb 100644 --- a/Tests/ComplexRelativePaths/cmTestConfigure.h.in +++ b/Tests/ComplexRelativePaths/cmTestConfigure.h.in @@ -54,4 +54,6 @@ #if defined(_WIN32) && !defined(__CYGWIN__) #define REGISTRY_TEST_PATH "${REGISTRY_TEST_PATH}" #endif -#define CMAKE_MINIMUM_REQUIRED_VERSION "${CMAKE_MINIMUM_REQUIRED_VERSION}" + +// Test Remove command +#define REMOVE_STRING "${REMOVE_STRING}" -- cgit v0.12