mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
CPS: Fix exporting definitions in CMake 4.1
Backport commit 37b15eda3b (CPS: Fix exporting definitions, 2025-11-21)
to CMake 4.1.
Export compile definitions to CPS using the correct attribute name.
Fixes: #27403
This commit is contained in:
committed by
Brad King
parent
0848aac41c
commit
b2ca9fba8b
@@ -451,7 +451,7 @@ void cmExportPackageInfoGenerator::GenerateInterfaceCompileDefines(
|
||||
}
|
||||
|
||||
if (!defines.empty()) {
|
||||
component["compile_definitions"]["*"] = std::move(defines);
|
||||
component["definitions"]["*"] = std::move(defines);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ expect_array("${component}" 1 "compile_features")
|
||||
expect_value("${component}" "c++23" "compile_features" 0)
|
||||
expect_array("${component}" 1 "compile_flags")
|
||||
expect_value("${component}" "-ffast-math" "compile_flags" 0)
|
||||
expect_null("${component}" "compile_definitions" "*" "FOO")
|
||||
expect_value("${component}" "BAR" "compile_definitions" "*" "BAR")
|
||||
expect_null("${component}" "definitions" "*" "FOO")
|
||||
expect_value("${component}" "BAR" "definitions" "*" "BAR")
|
||||
expect_array("${component}" 1 "link_directories")
|
||||
expect_value("${component}" "/opt/foo/lib" "link_directories" 0)
|
||||
expect_array("${component}" 1 "link_flags")
|
||||
|
||||
@@ -8,7 +8,7 @@ expect_value("${content}" "interface" "components" "foo" "type")
|
||||
expect_missing("${content}" "version")
|
||||
expect_missing("${content}" "configurations")
|
||||
expect_missing("${content}" "default_targets")
|
||||
expect_missing("${content}" "components" "foo" "compile_definitions")
|
||||
expect_missing("${content}" "components" "foo" "definitions")
|
||||
expect_missing("${content}" "components" "foo" "compile_features")
|
||||
expect_missing("${content}" "components" "foo" "compile_flags")
|
||||
expect_missing("${content}" "components" "foo" "link_directories")
|
||||
|
||||
@@ -14,8 +14,8 @@ expect_array("${component}" 1 "compile_features")
|
||||
expect_value("${component}" "c++23" "compile_features" 0)
|
||||
expect_array("${component}" 1 "compile_flags")
|
||||
expect_value("${component}" "-ffast-math" "compile_flags" 0)
|
||||
expect_null("${component}" "compile_definitions" "*" "FOO")
|
||||
expect_value("${component}" "BAR" "compile_definitions" "*" "BAR")
|
||||
expect_null("${component}" "definitions" "*" "FOO")
|
||||
expect_value("${component}" "BAR" "definitions" "*" "BAR")
|
||||
expect_array("${component}" 1 "link_directories")
|
||||
expect_value("${component}" "/opt/foo/lib" "link_directories" 0)
|
||||
expect_array("${component}" 1 "link_flags")
|
||||
|
||||
@@ -8,7 +8,7 @@ expect_value("${content}" "interface" "components" "foo" "type")
|
||||
expect_missing("${content}" "version")
|
||||
expect_missing("${content}" "configurations")
|
||||
expect_missing("${content}" "default_targets")
|
||||
expect_missing("${content}" "components" "foo" "compile_definitions")
|
||||
expect_missing("${content}" "components" "foo" "definitions")
|
||||
expect_missing("${content}" "components" "foo" "compile_features")
|
||||
expect_missing("${content}" "components" "foo" "compile_flags")
|
||||
expect_missing("${content}" "components" "foo" "link_directories")
|
||||
|
||||
Reference in New Issue
Block a user