Merge topic 'fileapi-interface-includes'

484cac3916 File API: Add interfaceIncludes field

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !12352
This commit is contained in:
Craig Scott
2026-09-06 19:03:04 -04:00
committed by Kitware Robot
29 changed files with 512 additions and 62 deletions
+25
View File
@@ -1712,6 +1712,31 @@ with members:
file set; see also policy :policy:`CMP0211`. The value is
an array of unsigned integer 0-based indexes into the ``fileSets`` array.
``interfaceIncludes``
.. codemodel-versionadded:: 2.12
An optional member that is present when the :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES`
property is set on a target. Note that non-private ``HEADERS`` file sets
automatically populate this property.
The value is a JSON array with an entry for each directory.
Transitive usage requirements from dependencies are not included.
Each entry is a JSON object with members:
``path``
A string specifying the path to the include directory,
represented with forward slashes.
``isSystem``
Optional member that is present with boolean value ``true`` if
the include directory is marked as a system include directory.
``backtrace``
Optional member that is present when a CMake language backtrace to
the command invocation that added this include directory is available.
The value is an unsigned integer 0-based index into the
``backtraceGraph`` member's ``nodes`` array.
``sourceGroups``
Optional member that is present when sources are grouped together by
the :command:`source_group` command or by default. The value is a
+160 -1
View File
@@ -37,6 +37,9 @@
},
{
"$ref": "#/definitions/codemodelV2_11"
},
{
"$ref": "#/definitions/codemodelV2_12"
}
],
"definitions": {
@@ -89,7 +92,25 @@
},
"minor": {
"type": "integer",
"minimum": 11
"const": 11
}
},
"additionalProperties": false
},
"codemodelVersionV2_12": {
"type": "object",
"required": [
"major",
"minor"
],
"properties": {
"major": {
"type": "integer",
"const": 2
},
"minor": {
"type": "integer",
"minimum": 12
}
},
"additionalProperties": false
@@ -866,6 +887,31 @@
"additionalProperties": false
}
},
"interfaceIncludes": {
"type": "array",
"items": {
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"description": "Include directory path"
},
"isSystem": {
"type": "boolean",
"description": "True if the path is a system include directory"
},
"backtrace": {
"type": "integer",
"minimum": 0,
"description": "Index into backtraceGraph nodes array for the command that added the include directory, if available"
}
},
"additionalProperties": false
}
},
"compileGroupsSourceIndexes": {
"type": "array",
"items": {
@@ -2015,6 +2061,119 @@
}
},
"additionalProperties": false
},
"codemodelV2_12": {
"required": [
"codemodelVersion",
"name",
"id",
"type",
"paths",
"sources",
"backtraceGraph"
],
"properties": {
"codemodelVersion": {
"$ref": "#/definitions/codemodelVersionV2_12"
},
"name": {
"$ref": "#/definitions/name"
},
"id": {
"$ref": "#/definitions/id"
},
"type": {
"$ref": "#/definitions/target-typeV2_9"
},
"imported": {
"$ref": "#/definitions/importedV2_9"
},
"local": {
"$ref": "#/definitions/localV2_9"
},
"abstract": {
"$ref": "#/definitions/abstractV2_9"
},
"backtrace": {
"$ref": "#/definitions/backtrace"
},
"folder": {
"$ref": "#/definitions/folder"
},
"paths": {
"$ref": "#/definitions/paths"
},
"nameOnDisk": {
"$ref": "#/definitions/nameOnDisk"
},
"artifacts": {
"$ref": "#/definitions/artifacts"
},
"isGeneratorProvided": {
"$ref": "#/definitions/isGeneratorProvided"
},
"install": {
"$ref": "#/definitions/install"
},
"launchers": {
"$ref": "#/definitions/launchersV2_7"
},
"link": {
"$ref": "#/definitions/link"
},
"archive": {
"$ref": "#/definitions/archive"
},
"debugger": {
"$ref": "#/definitions/debuggerV2_8"
},
"dependencies": {
"$ref": "#/definitions/dependencies"
},
"linkLibraries": {
"$ref": "#/definitions/linkLibrariesV2_9"
},
"interfaceLinkLibraries": {
"$ref": "#/definitions/interfaceLinkLibrariesV2_9"
},
"compileDependencies": {
"$ref": "#/definitions/compileDependenciesV2_9"
},
"interfaceCompileDependencies": {
"$ref": "#/definitions/interfaceCompileDependenciesV2_9"
},
"objectDependencies": {
"$ref": "#/definitions/onlyTargetDependenciesArrayV2_9"
},
"orderDependencies": {
"$ref": "#/definitions/onlyTargetDependenciesArrayV2_9"
},
"fileSets": {
"$ref": "#/definitions/fileSetsV2_11"
},
"interfaceIncludes": {
"$ref": "#/definitions/interfaceIncludes"
},
"sources": {
"$ref": "#/definitions/sourcesV2_11"
},
"interfaceSources": {
"$ref": "#/definitions/interfaceSourcesV2_11"
},
"symbolic": {
"$ref": "#/definitions/symbolicV2_9"
},
"sourceGroups": {
"$ref": "#/definitions/sourceGroupsV2_10"
},
"compileGroups": {
"$ref": "#/definitions/compileGroupsV2_6"
},
"backtraceGraph": {
"$ref": "#/definitions/backtraceGraph"
}
},
"additionalProperties": false
}
}
}
@@ -0,0 +1,8 @@
file-api-interface-includes
---------------------------
* The :manual:`cmake-file-api(7)` "codemodel" version 2 ``version`` field has
been updated to 2.12.
* The :manual:`cmake-file-api(7)` "codemodel" version 2 "target" object gained
a new ``interfaceIncludes`` array field.
+1 -1
View File
@@ -808,7 +808,7 @@ std::string cmFileAPI::NoSupportedVersion(
// Update the following files as well when updating this constant:
// Help/manual/cmake-file-api.7.rst
// Tests/RunCMake/FileAPI/codemodel-v2-check.py (check_objects())
static unsigned int const CodeModelV2Minor = 11;
static unsigned int const CodeModelV2Minor = 12;
void cmFileAPI::BuildClientRequestCodeModel(
ClientRequest& r, std::vector<RequestVersion> const& versions)
+48
View File
@@ -511,6 +511,7 @@ class Target
Json::Value DumpSources(FileSetDatabase const& fsdb);
Json::Value DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
Json::ArrayIndex si, FileSetDatabase const& fsdb);
Json::Value DumpInterfaceIncludes();
Json::Value DumpInterfaceSources(FileSetDatabase const& fsdb);
Json::Value DumpInterfaceSource(std::string path, Json::ArrayIndex si,
FileSetDatabase const& fsdb);
@@ -1381,6 +1382,11 @@ Json::Value Target::Dump()
target["interfaceSources"] = std::move(interfaceSources);
}
auto interfaceIncludes = this->DumpInterfaceIncludes();
if (!interfaceIncludes.empty()) {
target["interfaceIncludes"] = std::move(interfaceIncludes);
}
Json::Value folder = this->DumpFolder();
if (!folder.isNull()) {
target["folder"] = std::move(folder);
@@ -1997,6 +2003,48 @@ Json::Value Target::DumpInterfaceSources(FileSetDatabase const& fsdb)
return interfaceSources;
}
Json::Value Target::DumpInterfaceIncludes()
{
Json::Value interfaceIncludes = Json::arrayValue;
std::set<std::string> systemIncludes;
cmValue systemIncludesProp =
this->GT->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES");
if (systemIncludesProp) {
cmList includes{ cmGeneratorExpression::Evaluate(
*systemIncludesProp, this->GT->GetLocalGenerator(), this->Config,
this->GT) };
for (std::string include : includes) {
cmSystemTools::ConvertToUnixSlashes(include);
systemIncludes.emplace(std::move(include));
}
}
cmValue prop = this->GT->GetProperty("INTERFACE_INCLUDE_DIRECTORIES");
if (prop) {
cmList includes{ cmGeneratorExpression::Evaluate(
*prop, this->GT->GetLocalGenerator(), this->Config, this->GT) };
bool const targetTreatsOwnIncludesAsSystem =
this->GT->GetPropertyAsBool("SYSTEM") &&
(!this->GT->IsImported() ||
!this->GT->GetPropertyAsBool("IMPORTED_NO_SYSTEM"));
for (std::string include : includes) {
cmSystemTools::ConvertToUnixSlashes(include);
bool const isSystem = targetTreatsOwnIncludesAsSystem ||
systemIncludes.find(include) != systemIncludes.end();
JBT<std::string> path(include);
interfaceIncludes.append(
this->DumpInclude({ std::move(path), isSystem }));
}
}
return interfaceIncludes;
}
Json::Value Target::DumpInterfaceSource(std::string path, Json::ArrayIndex si,
FileSetDatabase const& fsdb)
{
@@ -1 +1 @@
^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":11}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":1}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":12}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":1}]},{"kind":"toolchains","version":\[{"major":1,"minor":1}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
+24 -1
View File
@@ -13,7 +13,7 @@ def check_objects(o, g):
assert is_list(o)
assert len(o) == 1
major = 2
minor = 11
minor = 12
check_index_object(o[0], "codemodel", major, minor, check_object_codemodel(g, major, minor))
def check_backtrace(t, b, backtrace):
@@ -323,6 +323,9 @@ def check_target(c, major, minor):
assert is_list(obj["interfaceSources"])
assert len(obj["interfaceSources"]) == len(expected["interfaceSources"])
if expected.get("interfaceIncludes") is not None:
expected_keys.append("interfaceIncludes")
assert is_dict(obj["paths"])
assert sorted(obj["paths"].keys()) == ["build", "source"]
assert matches(obj["paths"]["build"], expected["build"])
@@ -903,6 +906,26 @@ def check_target(c, major, minor):
missing_exception=lambda e: "Compile group: %s" % e["language"],
extra_exception=lambda a: "Compile group: %s" % a["language"])
if expected.get("interfaceIncludes") is not None:
def check_interface_include(actual, expected):
assert is_dict(actual)
expected_keys = ["path"]
assert matches(actual["path"], expected["path"])
if expected["isSystem"] is not None:
expected_keys.append("isSystem")
assert is_bool(actual["isSystem"], expected["isSystem"])
assert sorted(actual.keys()) == sorted(expected_keys)
check_list_match(lambda a, e: matches(a["path"], e["path"]),
obj["interfaceIncludes"], expected["interfaceIncludes"],
check=check_interface_include,
check_exception=lambda a, e: "Interface include: %s" % a["path"],
missing_exception=lambda e: "Interface include: %s" % e["path"],
extra_exception=lambda a: "Interface include: %s" % a["path"])
assert sorted(obj.keys()) == sorted(expected_keys)
return _check
@@ -45,7 +45,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 39,
"line": 45,
"command": "install",
"hasParent": true
},
@@ -75,7 +75,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 42,
"line": 48,
"command": "install",
"hasParent": true
},
@@ -55,7 +55,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 52,
"line": 55,
"command": "install",
"hasParent": true
},
@@ -100,7 +100,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -148,7 +148,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -193,7 +193,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -237,7 +237,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -281,7 +281,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 60,
"line": 63,
"command": "install",
"hasParent": true
},
@@ -328,7 +328,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 62,
"line": 65,
"command": "install",
"hasParent": true
},
@@ -373,7 +373,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 63,
"line": 66,
"command": "install",
"hasParent": true
},
@@ -422,7 +422,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 64,
"line": 67,
"command": "install",
"hasParent": true
},
@@ -474,7 +474,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 65,
"line": 68,
"command": "install",
"hasParent": true
},
@@ -523,7 +523,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 66,
"line": 69,
"command": "install",
"hasParent": true
},
@@ -565,7 +565,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 67,
"line": 70,
"command": "install",
"hasParent": true
},
@@ -607,7 +607,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 68,
"line": 71,
"command": "install",
"hasParent": true
},
@@ -21,7 +21,7 @@
[
{
"file": "^codemodel-v2\\.cmake$",
"line": 13,
"line": 16,
"command": "add_executable",
"hasParent": true
},
@@ -77,7 +77,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 13,
"line": 16,
"command": "add_executable",
"hasParent": true
},
@@ -127,7 +127,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 14,
"line": 17,
"command": "target_link_libraries",
"hasParent": true
},
@@ -163,7 +163,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 14,
"line": 17,
"command": "target_link_libraries",
"hasParent": true
},
@@ -196,7 +196,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 14,
"line": 17,
"command": "target_link_libraries",
"hasParent": true
},
@@ -226,6 +226,20 @@
]
}
],
"interfaceIncludes": [
{
"path": "^.*/Tests/RunCMake/FileAPI/fileset$",
"isSystem": null
},
{
"path": "^.*/Tests/RunCMake/FileAPI/fileset$",
"isSystem": null
},
{
"path": "^.*/Tests/RunCMake/FileAPI/fileset/dir$",
"isSystem": null
}
],
"interfaceSources": [
{
"path": "^fileset/error\\.c$",
@@ -44,6 +44,12 @@
]
}
],
"interfaceIncludes": [
{
"path": "^.*/Tests/RunCMake/FileAPI/fileset$",
"isSystem": null
}
],
"interfaceSources": [
{
"path": "^fileset/h1\\.h$",
@@ -21,7 +21,7 @@
[
{
"file": "^codemodel-v2\\.cmake$",
"line": 12,
"line": 15,
"command": "add_library",
"hasParent": true
},
@@ -77,7 +77,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 12,
"line": 15,
"command": "add_library",
"hasParent": true
},
@@ -21,7 +21,7 @@
[
{
"file": "^codemodel-v2\\.cmake$",
"line": 18,
"line": 21,
"command": "add_executable",
"hasParent": true
},
@@ -77,7 +77,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 18,
"line": 21,
"command": "add_executable",
"hasParent": true
},
@@ -127,7 +127,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 19,
"line": 22,
"command": "target_link_libraries",
"hasParent": true
},
@@ -163,7 +163,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 19,
"line": 22,
"command": "target_link_libraries",
"hasParent": true
},
@@ -196,7 +196,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 19,
"line": 22,
"command": "target_link_libraries",
"hasParent": true
},
@@ -21,7 +21,7 @@
[
{
"file": "^codemodel-v2\\.cmake$",
"line": 17,
"line": 20,
"command": "add_library",
"hasParent": true
},
@@ -85,7 +85,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 17,
"line": 20,
"command": "add_library",
"hasParent": true
},
@@ -134,7 +134,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -164,7 +164,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -194,7 +194,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 60,
"line": 63,
"command": "install",
"hasParent": true
},
@@ -21,7 +21,7 @@
[
{
"file": "^codemodel-v2\\.cmake$",
"line": 22,
"line": 25,
"command": "add_executable",
"hasParent": true
},
@@ -77,7 +77,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 22,
"line": 25,
"command": "add_executable",
"hasParent": true
},
@@ -127,7 +127,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 23,
"line": 26,
"command": "target_link_libraries",
"hasParent": true
},
@@ -163,7 +163,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 23,
"line": 26,
"command": "target_link_libraries",
"hasParent": true
},
@@ -196,7 +196,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 23,
"line": 26,
"command": "target_link_libraries",
"hasParent": true
},
@@ -21,7 +21,7 @@
[
{
"file": "^codemodel-v2\\.cmake$",
"line": 21,
"line": 24,
"command": "add_library",
"hasParent": true
},
@@ -77,7 +77,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 21,
"line": 24,
"command": "add_library",
"hasParent": true
},
@@ -101,7 +101,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 25,
"line": 28,
"command": "add_library",
"hasParent": true
},
@@ -152,7 +152,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 52,
"line": 55,
"command": "install",
"hasParent": true
},
@@ -110,7 +110,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -140,7 +140,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 55,
"line": 58,
"command": "install",
"hasParent": true
},
@@ -170,7 +170,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
"line": 60,
"line": 63,
"command": "install",
"hasParent": true
},
@@ -9,9 +9,35 @@
"abstract": true,
"symbolic": null,
"isGeneratorProvided": null,
"fileSets": null,
"fileSets": [
{
"name": "HEADERS",
"type": "HEADERS",
"visibility": "INTERFACE",
"baseDirectories": [
"^imported/\\.\\.$"
]
}
],
"sources": [],
"interfaceSources": null,
"interfaceIncludes": [
{
"path": "^.*/Tests/RunCMake/FileAPI/imported$",
"isSystem": true
},
{
"path": "^.*/Tests/RunCMake/FileAPI/imported/\\.\\.$",
"isSystem": true
}
],
"interfaceSources": [
{
"path": "^empty\\.h$",
"isGenerated": null,
"fileSetNames": ["HEADERS"],
"sourceGroupName": "Header Files"
}
],
"sourceGroups": null,
"compileGroups": null,
"backtrace": [
@@ -17,7 +17,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 35,
"line": 41,
"command": "add_library",
"hasParent": true
},
@@ -75,7 +75,92 @@
"sourcePaths": [
"^empty\\.c$"
],
"includes": null,
"includes": [
{
"path": "^.*/Tests/RunCMake/FileAPI$",
"isSystem": null,
"backtrace": [
{
"file": "^include_test\\.cmake$",
"line": 4,
"command": "target_link_libraries",
"hasParent": true
},
{
"file": "^include_test\\.cmake$",
"line": null,
"command": null,
"hasParent": true
},
{
"file": "^codemodel-v2\\.cmake$",
"line": 10,
"command": "include",
"hasParent": true
},
{
"file": "^codemodel-v2\\.cmake$",
"line": null,
"command": null,
"hasParent": true
},
{
"file": "^CMakeLists\\.txt$",
"line": 3,
"command": "include",
"hasParent": true
},
{
"file": "^CMakeLists\\.txt$",
"line": null,
"command": null,
"hasParent": false
}
]
},
{
"path": "^.*/Tests/RunCMake/FileAPI/dir$",
"isSystem": true,
"backtrace": [
{
"file": "^include_test\\.cmake$",
"line": 4,
"command": "target_link_libraries",
"hasParent": true
},
{
"file": "^include_test\\.cmake$",
"line": null,
"command": null,
"hasParent": true
},
{
"file": "^codemodel-v2\\.cmake$",
"line": 10,
"command": "include",
"hasParent": true
},
{
"file": "^codemodel-v2\\.cmake$",
"line": null,
"command": null,
"hasParent": true
},
{
"file": "^CMakeLists\\.txt$",
"line": 3,
"command": "include",
"hasParent": true
},
{
"file": "^CMakeLists\\.txt$",
"line": null,
"command": null,
"hasParent": false
}
]
}
],
"frameworks": null,
"defines": [
{
@@ -11,6 +11,16 @@
"isGeneratorProvided": null,
"fileSets": null,
"sources": [],
"interfaceIncludes": [
{
"path": "^.*/Tests/RunCMake/FileAPI$",
"isSystem": null
},
{
"path": "^.*/Tests/RunCMake/FileAPI/dir$",
"isSystem": true
}
],
"interfaceSources": null,
"sourceGroups": null,
"compileGroups": null,
@@ -21,7 +21,7 @@
[
{
"file": "^imported/CMakeLists\\.txt$",
"line": 32,
"line": 38,
"command": "add_executable",
"hasParent": true
},
@@ -51,7 +51,44 @@
"sourcePaths": [
"^empty\\.c$"
],
"includes": null,
"includes": [
{
"path": "^.*/Tests/RunCMake/FileAPI/imported$",
"isSystem": true,
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 39,
"command": "target_link_libraries",
"hasParent": true
},
{
"file": "^imported/CMakeLists\\.txt$",
"line": null,
"command": null,
"hasParent": false
}
]
},
{
"path": "^.*/Tests/RunCMake/FileAPI/imported/\\.\\.$",
"isSystem": true,
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 39,
"command": "target_link_libraries",
"hasParent": true
},
{
"file": "^imported/CMakeLists\\.txt$",
"line": null,
"command": null,
"hasParent": false
}
]
}
],
"frameworks": null,
"defines": [
{
@@ -65,7 +102,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 32,
"line": 38,
"command": "add_executable",
"hasParent": true
},
@@ -110,7 +147,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 33,
"line": 39,
"command": "target_link_libraries",
"hasParent": true
},
@@ -131,7 +168,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 33,
"line": 39,
"command": "target_link_libraries",
"hasParent": true
},
@@ -21,7 +21,7 @@
[
{
"file": "^imported/CMakeLists\\.txt$",
"line": 36,
"line": 42,
"command": "add_executable",
"hasParent": true
},
@@ -65,7 +65,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 36,
"line": 42,
"command": "add_executable",
"hasParent": true
},
@@ -110,7 +110,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 37,
"line": 43,
"command": "target_link_libraries",
"hasParent": true
},
@@ -131,7 +131,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 37,
"line": 43,
"command": "target_link_libraries",
"hasParent": true
},
@@ -17,7 +17,7 @@
"backtrace": [
{
"file": "^imported/CMakeLists\\.txt$",
"line": 48,
"line": 54,
"command": "add_library",
"hasParent": true
},
@@ -9,6 +9,9 @@ set(CMAKE_AIX_SHARED_LIBRARY_ARCHIVE 0)
include("${CMAKE_CURRENT_LIST_DIR}/include_test.cmake")
target_include_directories(interface_lib INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/dir")
set_property(TARGET interface_lib APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/dir")
add_library(c_lib empty.c)
add_executable(c_exe empty.c)
target_link_libraries(c_exe PRIVATE c_lib)
@@ -29,6 +29,12 @@ if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "
endif()
add_library(imported_interface_lib INTERFACE IMPORTED)
set_target_properties(imported_interface_lib PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
)
target_sources(imported_interface_lib
INTERFACE FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/.." FILES ../empty.h
)
add_executable(link_imported_interface_exe ../empty.c)
target_link_libraries(link_imported_interface_exe PRIVATE imported_interface_lib)