diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-NEW.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-OLD.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt | 15 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMP0051-WARN.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0051/empty.cpp | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 |
13 files changed, 64 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt b/Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-NEW-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt new file mode 100644 index 0000000..e5578ba --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-NEW-stderr.txt @@ -0,0 +1 @@ +^Sources: "empty.cpp;\$<TARGET_OBJECTS:objects>"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-NEW.cmake b/Tests/RunCMake/CMP0051/CMP0051-NEW.cmake new file mode 100644 index 0000000..f304bf1 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-NEW.cmake @@ -0,0 +1,10 @@ + +cmake_policy(SET CMP0051 NEW) + +add_library(objects OBJECT empty.cpp) + +add_library(empty empty.cpp $<TARGET_OBJECTS:objects>) + +get_target_property(srcs empty SOURCES) + +message("Sources: \"${srcs}\"") diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt new file mode 100644 index 0000000..cc17f33 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt @@ -0,0 +1 @@ +^Sources: "empty.cpp"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD.cmake b/Tests/RunCMake/CMP0051/CMP0051-OLD.cmake new file mode 100644 index 0000000..0243e94 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD.cmake @@ -0,0 +1,10 @@ + +cmake_policy(SET CMP0051 OLD) + +add_library(objects OBJECT empty.cpp) + +add_library(empty empty.cpp $<TARGET_OBJECTS:objects>) + +get_target_property(srcs empty SOURCES) + +message("Sources: \"${srcs}\"") diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt new file mode 100644 index 0000000..f1b0357 --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt @@ -0,0 +1,15 @@ +CMake Warning \(dev\) at CMP0051-WARN.cmake:6 \(get_target_property\): + Policy CMP0051 is not set: List TARGET_OBJECTS in SOURCES target property. + Run "cmake --help-policy CMP0051" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + Target "empty" contains \$<TARGET_OBJECTS> generator expression in its + sources list. This content was not previously part of the SOURCES property + when that property was read at configure time. Code reading that property + needs to be adapted to ignore the generator expression using the + string\(GENEX_STRIP\) command. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. + +Sources: "empty.cpp"$ diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN.cmake b/Tests/RunCMake/CMP0051/CMP0051-WARN.cmake new file mode 100644 index 0000000..fd595ce --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMP0051-WARN.cmake @@ -0,0 +1,8 @@ + +add_library(objects OBJECT empty.cpp) + +add_library(empty empty.cpp $<TARGET_OBJECTS:objects>) + +get_target_property(srcs empty SOURCES) + +message("Sources: \"${srcs}\"") diff --git a/Tests/RunCMake/CMP0051/CMakeLists.txt b/Tests/RunCMake/CMP0051/CMakeLists.txt new file mode 100644 index 0000000..3482e6b --- /dev/null +++ b/Tests/RunCMake/CMP0051/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.0) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0051/RunCMakeTest.cmake b/Tests/RunCMake/CMP0051/RunCMakeTest.cmake new file mode 100644 index 0000000..621192d --- /dev/null +++ b/Tests/RunCMake/CMP0051/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0051-OLD) +run_cmake(CMP0051-NEW) +run_cmake(CMP0051-WARN) diff --git a/Tests/RunCMake/CMP0051/empty.cpp b/Tests/RunCMake/CMP0051/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0051/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 31e7805..4f059d6 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -34,6 +34,7 @@ add_RunCMake_test(CMP0045) add_RunCMake_test(CMP0046) add_RunCMake_test(CMP0049) add_RunCMake_test(CMP0050) +add_RunCMake_test(CMP0051) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) |