[cmake-commits] hoffman committed CMakeLists.txt 1.30 1.30.6.2

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Oct 13 10:52:12 EDT 2006


Update of /cvsroot/CMake/CMake/Tests/ComplexOneConfig/Library
In directory public:/mounts/ram/cvs-serv31017/Tests/ComplexOneConfig/Library

Modified Files:
      Tag: CMake-2-4
	CMakeLists.txt 
Log Message:
ENH: merge changes from the main tree to the 2.4 branch


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/ComplexOneConfig/Library/CMakeLists.txt,v
retrieving revision 1.30
retrieving revision 1.30.6.2
diff -u -d -r1.30 -r1.30.6.2
--- CMakeLists.txt	2 Jun 2005 18:56:50 -0000	1.30
+++ CMakeLists.txt	13 Oct 2006 14:52:08 -0000	1.30.6.2
@@ -53,6 +53,13 @@
   MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
 ENDIF(${FOO_BAR_VAR} MATCHES "BAR")
 
+# Create static and shared lib of same name.
+IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+  ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c)
+  ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c)
+  SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared
+    PROPERTIES OUTPUT_NAME CMakeTestLink CLEAN_DIRECT_OUTPUT 1)
+ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
 
 #
 # Attach pre-build/pre-link/post-build custom-commands to the lib.
@@ -96,3 +103,27 @@
 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 EXCLUDE_FROM_ALL notInAllLib.cxx)
+
+# Test generation of preprocessed sources.
+IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
+  IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+    # Skip running this part of the test on certain platforms
+    # until they are fixed.
+    SET(MAYBE_ALL ALL)
+    LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT)
+    IF(ARCH_COUNT GREATER 1)
+      # OSX does not support preprocessing more than one architecture.
+      SET(MAYBE_ALL)
+    ENDIF(ARCH_COUNT GREATER 1)
+
+    # Custom target to try preprocessing invocation.
+    ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL}
+      COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
+      COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
+      COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
+      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+      )
+  ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE)
+ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)



More information about the Cmake-commits mailing list