6e637b1102 install(PACKAGE_INFO): Fix error when usage requirements contain certain genex Acked-by: Kitware Robot <[email protected]> Merge-request: !11322
@@ -191,16 +191,17 @@ static std::string extractAllGeneratorExpressions(
colons.push(c);
}
} else if (c[0] == '>') {
- if (collected && !starts.empty() && !colons.empty()) {
- (*collected)[std::string(starts.top() + 2, colons.top())].push_back(
- std::string(colons.top() + 1, c));
+ if (!colons.empty() && !starts.empty() &&
+ starts.top() < colons.top()) {
+ if (collected) {
+ (*collected)[std::string(starts.top() + 2, colons.top())]
+ .push_back(std::string(colons.top() + 1, c));
+ }
+ colons.pop();
if (!starts.empty()) {
starts.pop();
- if (!colons.empty()) {
- colons.pop();
- }
if (starts.empty()) {
break;
@@ -2,7 +2,7 @@ project(LinkInterfaceGeneratorExpression CXX)
add_library(foo foo.cxx)
add_library(bar foo.cxx)
-target_link_libraries(bar $<1:foo>)
+target_link_libraries(bar $<1:foo> $<1:$<CONFIG>>)
install(TARGETS foo EXPORT foo)
export(EXPORT foo PACKAGE_INFO foo)
@@ -35,3 +35,7 @@ test_strip( # Multiple case
"1$<AND:1,0>2$<IF:$<$<BOOL:1>:$<CONFIG:RELEASE>>,TRUE,FALSE>3"
"123"
)
+test_strip( # No : inside of :
+ "$<1:$<SEMICOLON>>1"
+ "1"
+)