diff options
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 6e35df9..112455b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -271,14 +271,6 @@ if(BUILD_TESTING) find_package(Qt5Widgets QUIET NO_MODULE) endif() - if(NOT CMake_TEST_EXTERNAL_CMAKE) - add_subdirectory(CMakeLib) - endif() - add_subdirectory(CMakeOnly) - add_subdirectory(RunCMake) - - add_subdirectory(FindPackageModeMakefileTest) - # Collect a list of all test build directories. set(TEST_BUILD_DIRS) @@ -342,6 +334,27 @@ if(BUILD_TESTING) endif() endif() + if(CMake_TEST_XCODE_VERSION AND CMAKE_OSX_SDKVERSION AND CMAKE_OSX_SDKPRODUCT) + if((NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1) AND + ((NOT CMAKE_OSX_SDKPRODUCT STREQUAL "Mac OS X") OR + (NOT CMAKE_OSX_SDKVERSION VERSION_LESS 10.10))) + if(CMAKE_GENERATOR STREQUAL "Xcode") + set(CMake_TEST_XCODE_SWIFT 1) + endif() + endif() + endif() + if(NOT DEFINED CMake_TEST_Swift) + if(CMAKE_Swift_COMPILER OR CMake_TEST_XCODE_SWIFT) + set(CMake_TEST_Swift 1) + endif() + endif() + + if(NOT DEFINED CMake_TEST_OBJC) + if(APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU") + set(CMake_TEST_OBJC 1) + endif() + endif() + # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, # whichever is greater. set(CMAKE_LONG_TEST_TIMEOUT 1500) @@ -352,6 +365,14 @@ if(BUILD_TESTING) set(CMAKE_LONG_TEST_TIMEOUT 1500) endif() + if(NOT CMake_TEST_EXTERNAL_CMAKE) + add_subdirectory(CMakeLib) + endif() + add_subdirectory(CMakeOnly) + add_subdirectory(RunCMake) + + add_subdirectory(FindPackageModeMakefileTest) + add_test(NAME CMake.Copyright COMMAND ${CMAKE_CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMakeCopyright.cmake) @@ -380,16 +401,7 @@ if(BUILD_TESTING) ADD_TEST_MACRO(MissingSourceFile MissingSourceFile) set_tests_properties(MissingSourceFile PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c") - if(CMake_TEST_XCODE_VERSION AND CMAKE_OSX_SDKVERSION AND CMAKE_OSX_SDKPRODUCT) - if((NOT CMake_TEST_XCODE_VERSION VERSION_LESS 6.1) AND - ((NOT CMAKE_OSX_SDKPRODUCT STREQUAL "Mac OS X") OR - (NOT CMAKE_OSX_SDKVERSION VERSION_LESS 10.10))) - if(CMAKE_GENERATOR STREQUAL "Xcode") - set(CMake_TEST_XCODE_SWIFT 1) - endif() - endif() - endif() - if(CMAKE_Swift_COMPILER OR CMake_TEST_XCODE_SWIFT) + if(CMake_TEST_Swift) ADD_TEST_MACRO(SwiftOnly SwiftOnly) if(CMake_TEST_XCODE_SWIFT) ADD_TEST_MACRO(SwiftMix SwiftMix) @@ -432,6 +444,11 @@ if(BUILD_TESTING) endif() endif() + if(CMake_TEST_OBJC) + add_subdirectory(ObjC) + add_subdirectory(ObjCXX) + endif() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") ADD_TEST_MACRO(CSharpOnly CSharpOnly) if(NOT CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64") @@ -2500,9 +2517,6 @@ if(BUILD_TESTING) -Dgen=${CMAKE_GENERATOR} -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") - - add_subdirectory(ObjC) - add_subdirectory(ObjCXX) endif() endif() |