[cmake-commits] king committed CMakeLists.txt 1.53 1.54 notInAllExe.cxx NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Oct 2 11:14:02 EDT 2006


Update of /cvsroot/CMake/CMake/Tests/Complex/Executable
In directory public:/mounts/ram/cvs-serv23561/Tests/Complex/Executable

Modified Files:
	CMakeLists.txt 
Added Files:
	notInAllExe.cxx 
Log Message:
ENH: Added NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE to avoid building the targets by default.


--- NEW FILE: notInAllExe.cxx ---
extern int notInAllLibFunc();

int main()
{
  return notInAllLibFunc();
}

#if 1
# error "This target should not be compiled by ALL."
#endif

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/Complex/Executable/CMakeLists.txt,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- CMakeLists.txt	15 Sep 2006 18:31:21 -0000	1.53
+++ CMakeLists.txt	2 Oct 2006 15:14:00 -0000	1.54
@@ -101,6 +101,14 @@
   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.
 #



More information about the Cmake-commits mailing list