summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-10-31 16:43:48 (GMT)
committerBrad King <brad.king@kitware.com>2022-10-31 16:43:48 (GMT)
commitb641a80d55ccde59d8e5c25c63b44df5ee0d999c (patch)
tree58fc0f683367ac491fe148199c31225e247c1a9c /Tests/CMakeLists.txt
parent46c1693602fa7ae8d1cd332228dad10ea98a6877 (diff)
downloadCMake-b641a80d55ccde59d8e5c25c63b44df5ee0d999c.zip
CMake-b641a80d55ccde59d8e5c25c63b44df5ee0d999c.tar.gz
CMake-b641a80d55ccde59d8e5c25c63b44df5ee0d999c.tar.bz2
Tests: Factor out a CMake_TEST_OBJC variable for OBJC/OBJCXX test conditions
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 850e743..112455b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -349,6 +349,12 @@ if(BUILD_TESTING)
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)
@@ -438,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")
@@ -2506,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()