diff options
author | Joseph Snyder <joe.snyder@kitware.com> | 2019-11-19 19:04:40 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-01-02 22:11:31 (GMT) |
commit | c621839bd9e17974c476e7332fc267ccaa351a8e (patch) | |
tree | b043f29e1cfc20e44ddd6f0cc0328c09f30bd961 /Tests/RunCMake/TargetProperties | |
parent | 10fea25139cc302ef0f0a41aa68b44cda72a4fd2 (diff) | |
download | CMake-c621839bd9e17974c476e7332fc267ccaa351a8e.zip CMake-c621839bd9e17974c476e7332fc267ccaa351a8e.tar.gz CMake-c621839bd9e17974c476e7332fc267ccaa351a8e.tar.bz2 |
Add set_property option: DEPRECATION
Add a new property flag for a target which contains a message regarding
deprecation status.
Add a warning at "Generate" time if a linked target is marked as
deprecated.
Expand ExportImport test to ensure that new property is being set and
passed correctly. Ensure that the message is shown during the
"Generate" step run of the ExportImport test.
Diffstat (limited to 'Tests/RunCMake/TargetProperties')
5 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/TargetProperties/CMakeLists.txt b/Tests/RunCMake/TargetProperties/CMakeLists.txt new file mode 100644 index 0000000..be9d403 --- /dev/null +++ b/Tests/RunCMake/TargetProperties/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST}) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetProperties/Deprecation-stderr.txt b/Tests/RunCMake/TargetProperties/Deprecation-stderr.txt new file mode 100644 index 0000000..11a4cd8 --- /dev/null +++ b/Tests/RunCMake/TargetProperties/Deprecation-stderr.txt @@ -0,0 +1,9 @@ +^CMake Warning \(dev\) at Deprecation\.cmake:[0-9]+ \(target_link_libraries\): + The library that is being linked to, testLibDeprecation, is marked as being + deprecated by the owner\. The message provided by the developer is: + + Deprecated version\. Please use latest version + +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/TargetProperties/Deprecation.cmake b/Tests/RunCMake/TargetProperties/Deprecation.cmake new file mode 100644 index 0000000..9361273 --- /dev/null +++ b/Tests/RunCMake/TargetProperties/Deprecation.cmake @@ -0,0 +1,5 @@ +add_library(testLibDeprecation STATIC empty.cpp) +set_property(TARGET testLibDeprecation PROPERTY DEPRECATION "Deprecated version. Please use latest version") + +add_executable(testExe1 empty.cpp) +target_link_libraries(testExe1 testLibDeprecation) diff --git a/Tests/RunCMake/TargetProperties/RunCMakeTest.cmake b/Tests/RunCMake/TargetProperties/RunCMakeTest.cmake new file mode 100644 index 0000000..5af31da --- /dev/null +++ b/Tests/RunCMake/TargetProperties/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(Deprecation) diff --git a/Tests/RunCMake/TargetProperties/empty.cpp b/Tests/RunCMake/TargetProperties/empty.cpp new file mode 100644 index 0000000..4086dcc --- /dev/null +++ b/Tests/RunCMake/TargetProperties/empty.cpp @@ -0,0 +1,4 @@ +int empty() +{ + return 0; +} |