diff options
author | Brad King <brad.king@kitware.com> | 2007-11-19 19:27:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-11-19 19:27:43 (GMT) |
commit | 88b31bd007fcbd92495d1989108c5e9ecf810d48 (patch) | |
tree | ceabd1e8936c39f42cecfc7365d1e188938a4c21 /Tests | |
parent | 37e8c118272dc261a01b776bd7683ed0b869aa7a (diff) | |
download | CMake-88b31bd007fcbd92495d1989108c5e9ecf810d48.zip CMake-88b31bd007fcbd92495d1989108c5e9ecf810d48.tar.gz CMake-88b31bd007fcbd92495d1989108c5e9ecf810d48.tar.bz2 |
ENH: Adding test for using HEADER_FILE_ONLY to avoid building a .cxx file.
Diffstat (limited to 'Tests')
6 files changed, 18 insertions, 3 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 12ebd26..1d56f0c 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -19,10 +19,14 @@ ENDIF(COMPLEX_TEST_CMAKELIB) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) LINK_LIBRARIES(${COMPLEX_LIBS}) +# Test forcing a .cxx file to not build. +SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES + HEADER_FILE_ONLY 1) + ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) ADD_EXECUTABLE(complex complex testcflags.c ) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx) +ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx) IF(COMPLEX_TEST_CMAKELIB) TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) ENDIF(COMPLEX_TEST_CMAKELIB) diff --git a/Tests/Complex/Executable/complex_nobuild.cxx b/Tests/Complex/Executable/complex_nobuild.cxx new file mode 100644 index 0000000..6b3c2c1 --- /dev/null +++ b/Tests/Complex/Executable/complex_nobuild.cxx @@ -0,0 +1 @@ +#error "This file should not be compiled." diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 12ebd26..1d56f0c 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -19,10 +19,14 @@ ENDIF(COMPLEX_TEST_CMAKELIB) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) LINK_LIBRARIES(${COMPLEX_LIBS}) +# Test forcing a .cxx file to not build. +SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES + HEADER_FILE_ONLY 1) + ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) ADD_EXECUTABLE(complex complex testcflags.c ) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx) +ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx) IF(COMPLEX_TEST_CMAKELIB) TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) ENDIF(COMPLEX_TEST_CMAKELIB) diff --git a/Tests/ComplexOneConfig/Executable/complex_nobuild.cxx b/Tests/ComplexOneConfig/Executable/complex_nobuild.cxx new file mode 100644 index 0000000..6b3c2c1 --- /dev/null +++ b/Tests/ComplexOneConfig/Executable/complex_nobuild.cxx @@ -0,0 +1 @@ +#error "This file should not be compiled." diff --git a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt index 12ebd26..1d56f0c 100644 --- a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt @@ -19,10 +19,14 @@ ENDIF(COMPLEX_TEST_CMAKELIB) SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) LINK_LIBRARIES(${COMPLEX_LIBS}) +# Test forcing a .cxx file to not build. +SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES + HEADER_FILE_ONLY 1) + ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) ADD_EXECUTABLE(complex complex testcflags.c ) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx) +ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx) IF(COMPLEX_TEST_CMAKELIB) TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmtar) ENDIF(COMPLEX_TEST_CMAKELIB) diff --git a/Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx b/Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx new file mode 100644 index 0000000..6b3c2c1 --- /dev/null +++ b/Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx @@ -0,0 +1 @@ +#error "This file should not be compiled." |