summaryrefslogtreecommitdiffstats
path: root/Tests/ComplexOneConfig/Executable
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-02 15:14:00 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-02 15:14:00 (GMT)
commit1d9f287af758b4a9cf8c35463ce98af1169cccf6 (patch)
tree6b437cb7c5e9de4ae2ea2d7c357095a2026b0e9a /Tests/ComplexOneConfig/Executable
parent603b47c87a6b7bbf99dfd13e4b874ee51e528434 (diff)
downloadCMake-1d9f287af758b4a9cf8c35463ce98af1169cccf6.zip
CMake-1d9f287af758b4a9cf8c35463ce98af1169cccf6.tar.gz
CMake-1d9f287af758b4a9cf8c35463ce98af1169cccf6.tar.bz2
ENH: Added NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE to avoid building the targets by default.
Diffstat (limited to 'Tests/ComplexOneConfig/Executable')
-rw-r--r--Tests/ComplexOneConfig/Executable/CMakeLists.txt8
-rw-r--r--Tests/ComplexOneConfig/Executable/notInAllExe.cxx10
2 files changed, 18 insertions, 0 deletions
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