summaryrefslogtreecommitdiffstats
path: root/Tests/ComplexRelativePaths/Library/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/ComplexRelativePaths/Library/CMakeLists.txt')
-rw-r--r--Tests/ComplexRelativePaths/Library/CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/Tests/ComplexRelativePaths/Library/CMakeLists.txt b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
index 3eeb1ea..b0ea7a3 100644
--- a/Tests/ComplexRelativePaths/Library/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/Library/CMakeLists.txt
@@ -53,6 +53,13 @@ ELSE(${FOO_BAR_VAR} MATCHES "BAR")
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 @@ 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 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)