summaryrefslogtreecommitdiffstats
path: root/Tests/Complex/Executable/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Complex/Executable/CMakeLists.txt')
-rw-r--r--Tests/Complex/Executable/CMakeLists.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index dae5775..28db54e 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
LINK_LIBRARIES(${COMPLEX_LIBS})
-ADD_EXECUTABLE(A A.cxx)
+ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt)
ADD_EXECUTABLE(complex complex testcflags.c )
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
ADD_EXECUTABLE(complex.file complex.file.cxx)
@@ -37,6 +37,12 @@ ELSE(UNIX)
ENDIF(NOT BORLAND)
ENDIF (UNIX)
+# Test linking to static lib when a shared lib has the same name.
+IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+ ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC)
+ TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic)
+ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS)
+
# can we get the path to a source file
GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION)
IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx")
@@ -95,6 +101,14 @@ ADD_CUSTOM_COMMAND(
DEPENDS ${CMAKE_COMMAND}
)
+# Test creating an executable that is not built by default.
+ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_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.
#
@@ -104,6 +118,11 @@ ADD_CUSTOM_COMMAND(
#
ADD_SUBDIRECTORY(Temp)
+IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+ ADD_EXECUTABLE(testSystemDir testSystemDir.cxx)
+ SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")
+ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+
#
# Extra coverage.Not used.
#