mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-24 15:18:26 -05:00
Merge topic 'fix-cps-relative-name-mangling' into release-4.0
9081e73104 CPS: Fix mangling of relative requirement names
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !10729
This commit is contained in:
@@ -212,7 +212,7 @@ std::string NormalizeTargetName(std::string const& name,
|
||||
std::string const& context)
|
||||
{
|
||||
if (cmHasLiteralPrefix(name, ":")) {
|
||||
return cmStrCat(context, name);
|
||||
return cmStrCat(context, ':', name);
|
||||
}
|
||||
|
||||
std::string::size_type const n = name.find_first_of(':');
|
||||
|
||||
@@ -180,6 +180,14 @@ else()
|
||||
target_link_libraries(defs-test defs::defs)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# Test importing and mangling of requirements (i.e. link libraries).
|
||||
|
||||
find_package(RequiresTest CONFIG REQUIRED)
|
||||
|
||||
add_library(requires-test STATIC requires-test.cxx)
|
||||
target_link_libraries(requires-test RequiresTest::Indirect)
|
||||
|
||||
###############################################################################
|
||||
# Test importing of (language-specific) include paths.
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"cps_version": "0.13",
|
||||
"name": "RequiresTest",
|
||||
"cps_path": "@prefix@/cps",
|
||||
"components": {
|
||||
"Indirect": {
|
||||
"type": "interface",
|
||||
"requires": [ ":Direct" ]
|
||||
},
|
||||
"Direct": {
|
||||
"type": "interface",
|
||||
"definitions": {
|
||||
"*": {
|
||||
"ANSWER": 42
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef ANSWER
|
||||
# error ANSWER is not defined
|
||||
#else
|
||||
# if ANSWER != 42
|
||||
# error ANSWER has the wrong value
|
||||
# endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user