mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
CMP0041: Remove support for OLD behavior
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
CMP0041
|
||||
-------
|
||||
|
||||
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||
.. include:: REMOVED_PROLOGUE.txt
|
||||
|
||||
Error on relative include with generator expression.
|
||||
|
||||
Diagnostics in CMake 2.8.12 and lower silently ignored an entry in the
|
||||
@@ -21,7 +24,5 @@ an error if a generator expression appears in another location and the path is
|
||||
relative.
|
||||
|
||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
|
||||
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
|
||||
.. include:: STANDARD_ADVICE.txt
|
||||
|
||||
.. include:: DEPRECATED.txt
|
||||
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
|
||||
.. include:: REMOVED_EPILOGUE.txt
|
||||
|
||||
@@ -439,24 +439,9 @@ bool cmExportInstallFileGenerator::CheckInterfaceDirs(
|
||||
if (cmHasPrefix(li, this->GetImportPrefixWithSlash())) {
|
||||
continue;
|
||||
}
|
||||
MessageType messageType = MessageType::FATAL_ERROR;
|
||||
std::ostringstream e;
|
||||
if (genexPos != std::string::npos) {
|
||||
if (prop == "INTERFACE_INCLUDE_DIRECTORIES") {
|
||||
switch (target->GetPolicyStatusCMP0041()) {
|
||||
case cmPolicies::WARN:
|
||||
messageType = MessageType::WARNING;
|
||||
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0041) << "\n";
|
||||
break;
|
||||
case cmPolicies::OLD:
|
||||
continue;
|
||||
case cmPolicies::NEW:
|
||||
hadFatalError = true;
|
||||
break; // Issue fatal message.
|
||||
}
|
||||
} else {
|
||||
hadFatalError = true;
|
||||
}
|
||||
hadFatalError = true;
|
||||
}
|
||||
if (!cmSystemTools::FileIsFullPath(li)) {
|
||||
/* clang-format off */
|
||||
@@ -464,7 +449,8 @@ bool cmExportInstallFileGenerator::CheckInterfaceDirs(
|
||||
" property contains relative path:\n"
|
||||
" \"" << li << "\"";
|
||||
/* clang-format on */
|
||||
target->GetLocalGenerator()->IssueMessage(messageType, e.str());
|
||||
target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
|
||||
e.str());
|
||||
}
|
||||
bool inBinary = isSubDirectory(li, topBinaryDir);
|
||||
bool inSource = isSubDirectory(li, topSourceDir);
|
||||
@@ -516,7 +502,8 @@ bool cmExportInstallFileGenerator::CheckInterfaceDirs(
|
||||
" property contains path:\n"
|
||||
" \"" << li << "\"\nwhich is prefixed in the build directory.";
|
||||
/* clang-format on */
|
||||
target->GetLocalGenerator()->IssueMessage(messageType, e.str());
|
||||
target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
|
||||
e.str());
|
||||
}
|
||||
if (!inSourceBuild) {
|
||||
if (inSource) {
|
||||
@@ -524,7 +511,8 @@ bool cmExportInstallFileGenerator::CheckInterfaceDirs(
|
||||
<< " property contains path:\n"
|
||||
" \""
|
||||
<< li << "\"\nwhich is prefixed in the source directory.";
|
||||
target->GetLocalGenerator()->IssueMessage(messageType, e.str());
|
||||
target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
|
||||
e.str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -128,7 +128,7 @@ class cmMakefile;
|
||||
3, 0, 0, NEW) \
|
||||
SELECT(POLICY, CMP0041, \
|
||||
"Error on relative include with generator expression.", 3, 0, 0, \
|
||||
WARN) \
|
||||
NEW) \
|
||||
SELECT(POLICY, CMP0042, "MACOSX_RPATH is enabled by default.", 3, 0, 0, \
|
||||
WARN) \
|
||||
SELECT(POLICY, CMP0043, "Ignore COMPILE_DEFINITIONS_<Config> properties.", \
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
^CMake Deprecation Warning at CMP0041-OLD.cmake:2 \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0041 will be removed from a future version
|
||||
of CMake.
|
||||
|
||||
The cmake-policies\(7\) manual explains that the OLD behaviors of all
|
||||
policies are deprecated and that a policy should be set to OLD only under
|
||||
specific short-term circumstances. Projects should be ported to the NEW
|
||||
behavior and not rely on setting a policy to OLD.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
cmake_policy(SET CMP0041 OLD)
|
||||
|
||||
add_library(foo empty.cpp)
|
||||
set_property(TARGET foo
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
)
|
||||
install(TARGETS foo EXPORT FooExport DESTINATION lib)
|
||||
install(EXPORT FooExport DESTINATION lib/cmake)
|
||||
@@ -1 +0,0 @@
|
||||
0
|
||||
@@ -1,32 +0,0 @@
|
||||
CMake Warning in CMakeLists.txt:
|
||||
Policy CMP0041 is not set: Error on relative include with generator
|
||||
expression. Run "cmake --help-policy CMP0041" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains relative path:
|
||||
|
||||
"include/\$<TARGET_PROPERTY:NAME>"
|
||||
|
||||
|
||||
CMake Warning in CMakeLists.txt:
|
||||
Policy CMP0041 is not set: Error on relative include with generator
|
||||
expression. Run "cmake --help-policy CMP0041" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
|
||||
|
||||
".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
|
||||
|
||||
which is prefixed in the source directory.
|
||||
|
||||
|
||||
CMake Warning in CMakeLists.txt:
|
||||
Policy CMP0041 is not set: Error on relative include with generator
|
||||
expression. Run "cmake --help-policy CMP0041" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
|
||||
|
||||
".*/Tests/RunCMake/CMP0041/CMP0041-WARN-build/include/\$<TARGET_PROPERTY:NAME>"
|
||||
|
||||
which is prefixed in the build directory.
|
||||
@@ -1,10 +0,0 @@
|
||||
|
||||
add_library(foo empty.cpp)
|
||||
set_property(TARGET foo
|
||||
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
||||
include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
)
|
||||
install(TARGETS foo EXPORT FooExport DESTINATION lib)
|
||||
install(EXPORT FooExport DESTINATION lib/cmake)
|
||||
@@ -1,10 +0,0 @@
|
||||
^CMake Deprecation Warning at CMP0041-tid-OLD.cmake:2 \(cmake_policy\):
|
||||
The OLD behavior for policy CMP0041 will be removed from a future version
|
||||
of CMake.
|
||||
|
||||
The cmake-policies\(7\) manual explains that the OLD behaviors of all
|
||||
policies are deprecated and that a policy should be set to OLD only under
|
||||
specific short-term circumstances. Projects should be ported to the NEW
|
||||
behavior and not rely on setting a policy to OLD.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
cmake_policy(SET CMP0041 OLD)
|
||||
|
||||
add_library(foo empty.cpp)
|
||||
target_include_directories(foo INTERFACE
|
||||
include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
)
|
||||
install(TARGETS foo EXPORT FooExport DESTINATION lib)
|
||||
install(EXPORT FooExport DESTINATION lib/cmake)
|
||||
@@ -1 +0,0 @@
|
||||
0
|
||||
@@ -1,34 +0,0 @@
|
||||
CMake Warning in CMakeLists.txt:
|
||||
Policy CMP0041 is not set: Error on relative include with generator
|
||||
expression. Run "cmake --help-policy CMP0041" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
|
||||
|
||||
".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
|
||||
|
||||
which is prefixed in the source directory.
|
||||
|
||||
|
||||
CMake Warning in CMakeLists.txt:
|
||||
Policy CMP0041 is not set: Error on relative include with generator
|
||||
expression. Run "cmake --help-policy CMP0041" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
|
||||
|
||||
".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>"
|
||||
|
||||
which is prefixed in the source directory.
|
||||
|
||||
|
||||
CMake Warning in CMakeLists.txt:
|
||||
Policy CMP0041 is not set: Error on relative include with generator
|
||||
expression. Run "cmake --help-policy CMP0041" for policy details. Use the
|
||||
cmake_policy command to set the policy and suppress this warning.
|
||||
|
||||
Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path:
|
||||
|
||||
".*/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-build/include/\$<TARGET_PROPERTY:NAME>"
|
||||
|
||||
which is prefixed in the build directory.
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
add_library(foo empty.cpp)
|
||||
target_include_directories(foo INTERFACE
|
||||
include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
|
||||
)
|
||||
install(TARGETS foo EXPORT FooExport DESTINATION lib)
|
||||
install(EXPORT FooExport DESTINATION lib/cmake)
|
||||
@@ -1,3 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(${RunCMake_TEST} CXX)
|
||||
include(${RunCMake_TEST}.cmake)
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
include(RunCMake)
|
||||
set(RunCMake_IGNORE_POLICY_VERSION_DEPRECATION ON)
|
||||
|
||||
# Protect tests from running inside the default install prefix.
|
||||
set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefaultPrefix")
|
||||
|
||||
run_cmake(CMP0041-OLD)
|
||||
run_cmake(CMP0041-NEW)
|
||||
run_cmake(CMP0041-WARN)
|
||||
|
||||
# Protect tests from running inside the default install prefix.
|
||||
set(RunCMake_TEST_OPTIONS "--install-prefix ${RunCMake_BINARY_DIR}/NotDefaultPrefix")
|
||||
|
||||
run_cmake(CMP0041-tid-OLD)
|
||||
run_cmake(CMP0041-tid-NEW)
|
||||
run_cmake(CMP0041-tid-WARN)
|
||||
|
||||
Reference in New Issue
Block a user