Commit 79db8ef7 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmTarget: Fix the property compatibility error message

Don't refer to 'both', but a 'mixture'. List all compatible interface
property types possible.

Add another test for a mixture of three compatibilities.
parent 43340a9c
......@@ -6005,7 +6005,8 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
<< propsString <<
" property in the dependencies of target \"" << this->GetName() <<
"\". This is not allowed. A property may only require compatibility "
"in a boolean interpretation or a string interpretation, but not both.";
"in a boolean interpretation, a numeric minimum, a numeric maximum or a "
"string interpretation, but not a mixture.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
}
......
......@@ -2,4 +2,5 @@ CMake Error in CMakeLists.txt:
Property "SOMETHING" appears in both the COMPATIBLE_INTERFACE_BOOL and the
COMPATIBLE_INTERFACE_STRING property in the dependencies of target "user".
This is not allowed. A property may only require compatibility in a
boolean interpretation or a string interpretation, but not both.
boolean interpretation, a numeric minimum, a numeric maximum or a string
interpretation, but not a mixture.
add_library(foo UNKNOWN IMPORTED)
add_library(bar UNKNOWN IMPORTED)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL SOMETHING)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING SOMETHING)
add_executable(user main.cpp)
target_link_libraries(user foo bar)
target_link_libraries(user foo)
CMake Error in CMakeLists.txt:
Property "OTHER" appears in both the COMPATIBLE_INTERFACE_BOOL,
COMPATIBLE_INTERFACE_NUMBER_MIN and the COMPATIBLE_INTERFACE_STRING
property in the dependencies of target "user". This is not allowed. A
property may only require compatibility in a boolean interpretation, a
numeric minimum, a numeric maximum or a string interpretation, but not a
mixture.
add_library(foo UNKNOWN IMPORTED)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_BOOL OTHER)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING OTHER)
set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_NUMBER_MIN OTHER)
add_executable(user main.cpp)
target_link_libraries(user foo)
......@@ -9,6 +9,7 @@ run_cmake(InterfaceString-mismatch-depend-self)
run_cmake(InterfaceString-mismatched-use)
run_cmake(InterfaceString-builtin-prop)
run_cmake(InterfaceString-Bool-Conflict)
run_cmake(InterfaceString-Bool-Min-Conflict)
run_cmake(DebugProperties)
if (QT_QMAKE_EXECUTABLE})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment