From 88b31bd007fcbd92495d1989108c5e9ecf810d48 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 19 Nov 2007 14:27:43 -0500 Subject: ENH: Adding test for using HEADER_FILE_ONLY to avoid building a .cxx file. --- Tests/Complex/Executable/CMakeLists.txt | 6 +++++- Tests/Complex/Executable/complex_nobuild.cxx | 1 + Tests/ComplexOneConfig/Executable/CMakeLists.txt | 6 +++++- Tests/ComplexOneConfig/Executable/complex_nobuild.cxx | 1 + Tests/ComplexRelativePaths/Executable/CMakeLists.txt | 6 +++++- Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx | 1 + 6 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 Tests/Complex/Executable/complex_nobuild.cxx create mode 100644 Tests/ComplexOneConfig/Executable/complex_nobuild.cxx create mode 100644 Tests/ComplexRelativePaths/Executable/complex_nobuild.cxx 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." -- cgit v0.12