summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-15 15:34:00 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-15 15:34:00 (GMT)
commita4d0e4ff8f10b9ec6cc175765d8ec15b5e780b0d (patch)
tree9aee3e33db0650ab586550e8048e462858fee9e6 /Tests
parente855ed7fdee75e5669847192f5c2c1d088db6f5f (diff)
downloadCMake-a4d0e4ff8f10b9ec6cc175765d8ec15b5e780b0d.zip
CMake-a4d0e4ff8f10b9ec6cc175765d8ec15b5e780b0d.tar.gz
CMake-a4d0e4ff8f10b9ec6cc175765d8ec15b5e780b0d.tar.bz2
Tests: Prepare RunCMake.GenEx-TARGET_PROPERTY for more independent cases
The existing cases all need to enable a language. Move this out of the `CMakeLists.txt` file and into the individual cases to make room for other cases that may not need this.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/BadInvalidName.cmake4
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/BadNonTarget.cmake5
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/BadSelfReference.cmake4
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle1.cmake5
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle2.cmake5
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle3.cmake5
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle4.cmake5
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle5.cmake5
-rw-r--r--Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle6.cmake5
10 files changed, 37 insertions, 13 deletions
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadInvalidName.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadInvalidName.cmake
index 5f083e2..d3f82aa 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadInvalidName.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadInvalidName.cmake
@@ -1,3 +1,4 @@
+enable_language(CXX)
add_subdirectory(BadInvalidName1)
add_subdirectory(BadInvalidName2)
add_subdirectory(BadInvalidName3)
@@ -6,3 +7,6 @@ add_subdirectory(BadInvalidName5)
add_subdirectory(BadInvalidName6)
add_subdirectory(BadInvalidName7)
add_subdirectory(BadInvalidName8)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadNonTarget.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadNonTarget.cmake
index 334d7c3..731d758 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadNonTarget.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadNonTarget.cmake
@@ -1,6 +1,9 @@
-
+enable_language(CXX)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
"int main(int, char **) { return 0; }\n")
add_executable(main "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
include_directories("$<TARGET_PROPERTY:NonExistent,INCLUDE_DIRECTORIES>")
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadSelfReference.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadSelfReference.cmake
index 5a99f7a..ee8b9ec 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadSelfReference.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/BadSelfReference.cmake
@@ -1,6 +1,10 @@
+enable_language(CXX)
add_subdirectory(BadSelfReference1)
add_subdirectory(BadSelfReference2)
add_subdirectory(BadSelfReference3)
add_subdirectory(BadSelfReference4)
add_subdirectory(BadSelfReference5)
add_subdirectory(BadSelfReference6)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt b/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt
index c3922d6..74b3ff8 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/CMakeLists.txt
@@ -1,8 +1,3 @@
-
cmake_minimum_required(VERSION 3.3)
-project(${RunCMake_TEST} CXX)
-
-# MSVC creates extra targets which pollute the stderr unless we set this.
-set(CMAKE_SUPPRESS_REGENERATION TRUE)
-
+project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle1.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle1.cmake
index 4b60214..775e5a0 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle1.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle1.cmake
@@ -1,4 +1,4 @@
-
+enable_language(CXX)
add_library(empty1 empty.cpp)
add_library(empty2 empty.cpp)
@@ -6,3 +6,6 @@ target_link_libraries(empty1
LINK_PUBLIC
$<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2>
)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle2.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle2.cmake
index 557eac1..fc14b48 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle2.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle2.cmake
@@ -1,4 +1,4 @@
-
+enable_language(CXX)
add_library(empty1 empty.cpp)
add_library(empty2 empty.cpp)
@@ -6,3 +6,6 @@ target_link_libraries(empty1
LINK_PUBLIC
$<$<STREQUAL:$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES>,/foo/bar>:empty2>
)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle3.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle3.cmake
index 0f921d4..e084502 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle3.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle3.cmake
@@ -1,4 +1,4 @@
-
+enable_language(CXX)
add_library(empty1 empty.cpp)
add_library(empty2 empty.cpp)
@@ -8,3 +8,6 @@ target_link_libraries(empty1
INTERFACE
$<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2>
)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle4.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle4.cmake
index ab6d0b2..42290de 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle4.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle4.cmake
@@ -1,4 +1,4 @@
-
+enable_language(CXX)
add_library(empty1 empty.cpp)
add_library(empty2 empty.cpp)
@@ -12,3 +12,6 @@ target_link_libraries(empty1
add_library(empty3 empty.cpp)
target_link_libraries(empty3 empty1)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle5.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle5.cmake
index dc180e3..9597176 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle5.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle5.cmake
@@ -1,4 +1,4 @@
-
+enable_language(CXX)
add_library(empty1 INTERFACE IMPORTED)
add_library(empty2 INTERFACE IMPORTED)
@@ -8,3 +8,6 @@ set_property(TARGET empty1 PROPERTY INTERFACE_LINK_LIBRARIES
add_library(empty3 empty.cpp)
target_link_libraries(empty3 empty1)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle6.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle6.cmake
index 91252d0..94a5419 100644
--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle6.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/LinkImplementationCycle6.cmake
@@ -1,4 +1,4 @@
-
+enable_language(CXX)
add_library(empty1 SHARED empty.cpp)
add_library(empty2 SHARED empty.cpp)
@@ -12,3 +12,6 @@ target_link_libraries(empty1
add_library(empty3 SHARED empty.cpp)
target_link_libraries(empty3 empty1)
+
+# Suppress generator-specific targets that might pollute the stderr.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)