summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Complex/Executable/CMakeLists.txt8
-rw-r--r--Tests/Complex/Executable/notInAllExe.cxx10
-rw-r--r--Tests/Complex/Library/CMakeLists.txt3
-rw-r--r--Tests/Complex/Library/notInAllLib.cxx5
-rw-r--r--Tests/ComplexOneConfig/Executable/CMakeLists.txt8
-rw-r--r--Tests/ComplexOneConfig/Executable/notInAllExe.cxx10
-rw-r--r--Tests/ComplexOneConfig/Library/CMakeLists.txt3
-rw-r--r--Tests/ComplexOneConfig/Library/notInAllLib.cxx5
-rw-r--r--Tests/ComplexRelativePaths/Executable/CMakeLists.txt8
-rw-r--r--Tests/ComplexRelativePaths/Executable/notInAllExe.cxx10
-rw-r--r--Tests/ComplexRelativePaths/Library/CMakeLists.txt3
-rw-r--r--Tests/ComplexRelativePaths/Library/notInAllLib.cxx5
12 files changed, 78 insertions, 0 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index 61624c9..e2caf6a 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -101,6 +101,14 @@ ADD_CUSTOM_COMMAND(
DEPENDS ${CMAKE_COMMAND}
)
+# Test creating an executable that is not built by default.
+ADD_EXECUTABLE(notInAllExe NOT_IN_ALL notInAllExe.cxx)
+TARGET_LINK_LIBRARIES(notInAllExe notInAllLib)
+
+# Test creating a custom target that builds not-in-all targets.
+ADD_CUSTOM_TARGET(notInAllCustom)
+ADD_DEPENDENCIES(notInAllCustom notInAllExe)
+
#
# Output the files required by 'complex' to a file.
#
diff --git a/Tests/Complex/Executable/notInAllExe.cxx b/Tests/Complex/Executable/notInAllExe.cxx
new file mode 100644
index 0000000..70275cd
--- /dev/null
+++ b/Tests/Complex/Executable/notInAllExe.cxx
@@ -0,0 +1,10 @@
+extern int notInAllLibFunc();
+
+int main()
+{
+ return notInAllLibFunc();
+}
+
+#if 1
+# error "This target should not be compiled by ALL."
+#endif
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 55d6ddb..d07bf48 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -103,6 +103,9 @@ 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 creating a library that is not built by default.
+ADD_LIBRARY(notInAllLib NOT_IN_ALL notInAllLib.cxx)
+
# Test generation of preprocessed sources.
IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
diff --git a/Tests/Complex/Library/notInAllLib.cxx b/Tests/Complex/Library/notInAllLib.cxx
new file mode 100644
index 0000000..5d928f4
--- /dev/null
+++ b/Tests/Complex/Library/notInAllLib.cxx
@@ -0,0 +1,5 @@
+int notInAllLibFunc() { return 0; }
+
+#if 1
+# error "This target should not be compiled by ALL."
+#endif
diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
index 61624c9..e2caf6a 100644
--- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt
@@ -101,6 +101,14 @@ ADD_CUSTOM_COMMAND(
DEPENDS ${CMAKE_COMMAND}
)
+# Test creating an executable that is not built by default.
+ADD_EXECUTABLE(notInAllExe NOT_IN_ALL notInAllExe.cxx)
+TARGET_LINK_LIBRARIES(notInAllExe notInAllLib)
+
+# Test creating a custom target that builds not-in-all targets.
+ADD_CUSTOM_TARGET(notInAllCustom)
+ADD_DEPENDENCIES(notInAllCustom notInAllExe)
+
#
# Output the files required by 'complex' to a file.
#
diff --git a/Tests/ComplexOneConfig/Executable/notInAllExe.cxx b/Tests/ComplexOneConfig/Executable/notInAllExe.cxx
new file mode 100644
index 0000000..70275cd
--- /dev/null
+++ b/Tests/ComplexOneConfig/Executable/notInAllExe.cxx
@@ -0,0 +1,10 @@
+extern int notInAllLibFunc();
+
+int main()
+{
+ return notInAllLibFunc();
+}
+
+#if 1
+# error "This target should not be compiled by ALL."
+#endif
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index 55d6ddb..d07bf48 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -103,6 +103,9 @@ 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 creating a library that is not built by default.
+ADD_LIBRARY(notInAllLib NOT_IN_ALL notInAllLib.cxx)
+
# Test generation of preprocessed sources.
IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
diff --git a/Tests/ComplexOneConfig/Library/notInAllLib.cxx b/Tests/ComplexOneConfig/Library/notInAllLib.cxx
new file mode 100644
index 0000000..5d928f4
--- /dev/null
+++ b/Tests/ComplexOneConfig/Library/notInAllLib.cxx
@@ -0,0 +1,5 @@
+int notInAllLibFunc() { return 0; }
+
+#if 1
+# error "This target should not be compiled by ALL."
+#endif
diff --git a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt
index 61624c9..e2caf6a 100644
--- a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt
@@ -101,6 +101,14 @@ ADD_CUSTOM_COMMAND(
DEPENDS ${CMAKE_COMMAND}
)
+# Test creating an executable that is not built by default.
+ADD_EXECUTABLE(notInAllExe NOT_IN_ALL notInAllExe.cxx)
+TARGET_LINK_LIBRARIES(notInAllExe notInAllLib)
+
+# Test creating a custom target that builds not-in-all targets.
+ADD_CUSTOM_TARGET(notInAllCustom)
+ADD_DEPENDENCIES(notInAllCustom notInAllExe)
+
#
# Output the files required by 'complex' to a file.
#
diff --git a/Tests/ComplexRelativePaths/Executable/notInAllExe.cxx b/Tests/ComplexRelativePaths/Executable/notInAllExe.cxx
new file mode 100644
index 0000000..70275cd
--- /dev/null
+++ b/Tests/ComplexRelativePaths/Executable/notInAllExe.cxx
@@ -0,0 +1,10 @@
+extern int notInAllLibFunc();
+
+int main()
+{
+ return notInAllLibFunc();
+}
+
+#if 1
+# error "This target should not be compiled by ALL."
+#endif
diff --git a/Tests/ComplexRelativePaths/Library/CMakeLists.txt b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
index 55d6ddb..d07bf48 100644
--- a/Tests/ComplexRelativePaths/Library/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
@@ -103,6 +103,9 @@ 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 creating a library that is not built by default.
+ADD_LIBRARY(notInAllLib NOT_IN_ALL notInAllLib.cxx)
+
# Test generation of preprocessed sources.
IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
diff --git a/Tests/ComplexRelativePaths/Library/notInAllLib.cxx b/Tests/ComplexRelativePaths/Library/notInAllLib.cxx
new file mode 100644
index 0000000..5d928f4
--- /dev/null
+++ b/Tests/ComplexRelativePaths/Library/notInAllLib.cxx
@@ -0,0 +1,5 @@
+int notInAllLibFunc() { return 0; }
+
+#if 1
+# error "This target should not be compiled by ALL."
+#endif