summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-07-13 18:20:07 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-10-27 19:17:23 (GMT)
commit3c3698b0e47277db2721cd78e499f4b4a22f7e00 (patch)
tree1fe75dffd2a900052835d2bd220f6ee233d9869f /Tests
parent8a09723bffe41989c49991e1e98c4e33543c6307 (diff)
downloadCMake-3c3698b0e47277db2721cd78e499f4b4a22f7e00.zip
CMake-3c3698b0e47277db2721cd78e499f4b4a22f7e00.tar.gz
CMake-3c3698b0e47277db2721cd78e499f4b4a22f7e00.tar.bz2
FileAPI: Add information on file set installers
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py31
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json203
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json29
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json7
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json8
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json231
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json105
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json6
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json6
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/fileset/CMakeLists.txt25
-rw-r--r--Tests/RunCMake/FileAPI/fileset/dir/h2.h0
-rw-r--r--Tests/RunCMake/FileAPI/fileset/empty.c0
-rw-r--r--Tests/RunCMake/FileAPI/fileset/error.c1
-rw-r--r--Tests/RunCMake/FileAPI/fileset/h1.h0
-rw-r--r--Tests/RunCMake/FileAPI/fileset/h3.h0
-rw-r--r--Tests/RunCMake/FileAPI/fileset/other.c0
19 files changed, 632 insertions, 25 deletions
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
index 3df3e52..6a932f1 100644
--- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
+++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -1 +1 @@
-^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":3}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"version":{.*}}$
+^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":4}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"version":{.*}}$
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 92a64f9..b31088d 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -12,7 +12,7 @@ def read_codemodel_json_data(filename):
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1
- check_index_object(o[0], "codemodel", 2, 3, check_object_codemodel(g))
+ check_index_object(o[0], "codemodel", 2, 4, check_object_codemodel(g))
def check_backtrace(t, b, backtrace):
btg = t["backtraceGraph"]
@@ -188,6 +188,31 @@ def check_directory(c):
expected_keys.append("runtimeDependencySetType")
assert is_string(a["runtimeDependencySetType"], e["runtimeDependencySetType"])
+ if e.get("fileSetName", None) is not None:
+ expected_keys.append("fileSetName")
+ assert is_string(a["fileSetName"], e["fileSetName"])
+
+ if e.get("fileSetType", None) is not None:
+ expected_keys.append("fileSetType")
+ assert is_string(a["fileSetType"], e["fileSetType"])
+
+ if e.get("fileSetDirectories", None) is not None:
+ expected_keys.append("fileSetDirectories")
+ assert is_list(a["fileSetDirectories"])
+ assert len(a["fileSetDirectories"]) == len(e["fileSetDirectories"])
+ for ad, ed in zip(a["fileSetDirectories"], e["fileSetDirectories"]):
+ assert matches(ad, ed)
+
+ if e.get("fileSetTarget", None) is not None:
+ expected_keys.append("fileSetTarget")
+ et = e["fileSetTarget"]
+ at = a["fileSetTarget"]
+ assert is_dict(at)
+ assert sorted(at.keys()) == ["id", "index"]
+ assert matches(at["id"], et["id"])
+ assert is_int(at["index"])
+ assert c["targets"][at["index"]]["name"] == et["index"]
+
if e["backtrace"] is not None:
expected_keys.append("backtrace")
check_backtrace(d, a["backtrace"], e["backtrace"])
@@ -628,6 +653,7 @@ def gen_check_directories(c, g):
read_codemodel_json_data("directories/dir.json"),
read_codemodel_json_data("directories/dir_dir.json"),
read_codemodel_json_data("directories/external.json"),
+ read_codemodel_json_data("directories/fileset.json"),
]
if matches(g["name"], "^Visual Studio "):
@@ -729,6 +755,9 @@ def gen_check_targets(c, g, inSource):
read_codemodel_json_data("targets/all_build_external.json"),
read_codemodel_json_data("targets/zero_check_external.json"),
read_codemodel_json_data("targets/generated_exe.json"),
+
+ read_codemodel_json_data("targets/c_headers_1.json"),
+ read_codemodel_json_data("targets/c_headers_2.json"),
]
if cxx_compiler_id in ['Clang', 'AppleClang', 'LCC', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero'] and g["name"] != "Xcode":
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json
new file mode 100644
index 0000000..4774a13
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/fileset.json
@@ -0,0 +1,203 @@
+{
+ "source": "^fileset$",
+ "build": "^fileset$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^c_headers_1::@6b8db101d64c125f29fe$",
+ "^c_headers_2::@6b8db101d64c125f29fe$"
+ ],
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": true,
+ "installers": [
+ {
+ "component": "Unspecified",
+ "type": "target",
+ "destination": "lib",
+ "paths": [
+ "^fileset/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_headers_1\\.(a|lib)?$"
+ ],
+ "isExcludeFromAll": null,
+ "isForAllComponents": null,
+ "isOptional": null,
+ "targetId": "^c_headers_1::@6b8db101d64c125f29fe$",
+ "targetIndex": "c_headers_1",
+ "targetIsImportLibrary": null,
+ "targetInstallNamelink": null,
+ "exportName": null,
+ "exportTargets": null,
+ "scriptFile": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 20,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "component": "Headers",
+ "type": "fileSet",
+ "destination": "include",
+ "paths": [
+ "^fileset/error\\.c$",
+ "^fileset/other\\.c$"
+ ],
+ "isExcludeFromAll": null,
+ "isForAllComponents": null,
+ "isOptional": null,
+ "targetId": null,
+ "targetIndex": null,
+ "targetIsImportLibrary": null,
+ "targetInstallNamelink": null,
+ "exportName": null,
+ "exportTargets": null,
+ "scriptFile": null,
+ "fileSetName": "HEADERS",
+ "fileSetType": "HEADERS",
+ "fileSetDirectories": [
+ "^fileset$"
+ ],
+ "fileSetTarget": {
+ "id": "^c_headers_1::@6b8db101d64c125f29fe$",
+ "index": "c_headers_1"
+ },
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 20,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "component": "Unspecified",
+ "type": "fileSet",
+ "destination": "include/dir",
+ "paths": [
+ "^fileset/dir/h2\\.h$"
+ ],
+ "isExcludeFromAll": null,
+ "isForAllComponents": null,
+ "isOptional": null,
+ "targetId": null,
+ "targetIndex": null,
+ "targetIsImportLibrary": null,
+ "targetInstallNamelink": null,
+ "exportName": null,
+ "exportTargets": null,
+ "scriptFile": null,
+ "fileSetName": "b",
+ "fileSetType": "HEADERS",
+ "fileSetDirectories": [
+ "^fileset/dir$"
+ ],
+ "fileSetTarget": {
+ "id": "^c_headers_1::@6b8db101d64c125f29fe$",
+ "index": "c_headers_1"
+ },
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 20,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "component": "Unspecified",
+ "type": "fileSet",
+ "destination": "include",
+ "paths": [
+ "^fileset/h3\\.h$"
+ ],
+ "isExcludeFromAll": null,
+ "isForAllComponents": null,
+ "isOptional": null,
+ "targetId": null,
+ "targetIndex": null,
+ "targetIsImportLibrary": null,
+ "targetInstallNamelink": null,
+ "exportName": null,
+ "exportTargets": null,
+ "scriptFile": null,
+ "fileSetName": "c",
+ "fileSetType": "HEADERS",
+ "fileSetDirectories": [
+ "^fileset$"
+ ],
+ "fileSetTarget": {
+ "id": "^c_headers_1::@6b8db101d64c125f29fe$",
+ "index": "c_headers_1"
+ },
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 20,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "component": "Unspecified",
+ "type": "target",
+ "destination": "lib",
+ "paths": [
+ "^fileset/((Debug|Release|MinSizeRel|RelWithDebInfo)/)?(lib)?c_headers_2\\.(a|lib)?$"
+ ],
+ "isExcludeFromAll": null,
+ "isForAllComponents": null,
+ "isOptional": null,
+ "targetId": "^c_headers_2::@6b8db101d64c125f29fe$",
+ "targetIndex": "c_headers_2",
+ "targetIsImportLibrary": null,
+ "targetInstallNamelink": null,
+ "exportName": null,
+ "exportTargets": null,
+ "scriptFile": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 25,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
index 99287fb..22b4536 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
@@ -10,7 +10,8 @@
"^interface$",
"^object$",
"^.*/Tests/RunCMake/FileAPIExternalSource$",
- "^dir$"
+ "^dir$",
+ "^fileset$"
],
"targetIds": [
"^ALL_BUILD::@6890427a1f51a3e7e1df$",
@@ -47,7 +48,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 38,
+ "line": 39,
"command": "install",
"hasParent": true
},
@@ -92,7 +93,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -140,7 +141,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -185,7 +186,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -229,7 +230,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -273,7 +274,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 46,
+ "line": 47,
"command": "install",
"hasParent": true
},
@@ -320,7 +321,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 48,
+ "line": 49,
"command": "install",
"hasParent": true
},
@@ -365,7 +366,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 49,
+ "line": 50,
"command": "install",
"hasParent": true
},
@@ -414,7 +415,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 50,
+ "line": 51,
"command": "install",
"hasParent": true
},
@@ -466,7 +467,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 51,
+ "line": 52,
"command": "install",
"hasParent": true
},
@@ -515,7 +516,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 52,
+ "line": 53,
"command": "install",
"hasParent": true
},
@@ -557,7 +558,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 53,
+ "line": 54,
"command": "install",
"hasParent": true
},
@@ -599,7 +600,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 54,
+ "line": 55,
"command": "install",
"hasParent": true
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
index 4d0cdc0..0d6c4a1 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
@@ -13,7 +13,8 @@
"directorySources": [
"^\\.$",
"^dir$",
- "^dir/dir$"
+ "^dir/dir$",
+ "^fileset$"
],
"targetIds": [
"^ALL_BUILD::@6890427a1f51a3e7e1df$",
@@ -24,6 +25,8 @@
"^c_shared_lib::@6890427a1f51a3e7e1df$",
"^c_shared_exe::@6890427a1f51a3e7e1df$",
"^c_static_lib::@6890427a1f51a3e7e1df$",
- "^c_static_exe::@6890427a1f51a3e7e1df$"
+ "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "^c_headers_1::@6b8db101d64c125f29fe$",
+ "^c_headers_2::@6b8db101d64c125f29fe$"
]
}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
index d023f99..4e772a7 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
@@ -186,6 +186,14 @@
{
"id": "^generated_exe::@[0-9a-f]+$",
"backtrace": null
+ },
+ {
+ "id": "^c_headers_1::@6b8db101d64c125f29fe$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_headers_2::@6b8db101d64c125f29fe$",
+ "backtrace": null
}
]
}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json
new file mode 100644
index 0000000..c189623
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_1.json
@@ -0,0 +1,231 @@
+{
+ "name": "c_headers_1",
+ "id": "^c_headers_1::@6b8db101d64c125f29fe$",
+ "directorySource": "^fileset$",
+ "projectName": "codemodel-v2",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^fileset/empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 1,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^fileset/error\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Header Files",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^fileset/other\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^fileset/h1\\.h$",
+ "isGenerated": null,
+ "sourceGroupName": "Header Files",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^fileset/dir/h2\\.h$",
+ "isGenerated": null,
+ "sourceGroupName": "Header Files",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 7,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^fileset/empty\\.c$",
+ "^fileset/other\\.c$"
+ ]
+ },
+ {
+ "name": "Header Files",
+ "sourcePaths": [
+ "^fileset/error\\.c$",
+ "^fileset/h1\\.h$",
+ "^fileset/dir/h2\\.h$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^fileset/empty\\.c$"
+ ],
+ "includes": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/fileset$",
+ "isSystem": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/fileset/dir$",
+ "isSystem": null,
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 7,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 1,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib)?c_headers_1\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_headers_1\\.(a|lib)$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^fileset$",
+ "source": "^fileset$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "lib",
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 20,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ "link": null,
+ "archive": {
+ "lto": null
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json
new file mode 100644
index 0000000..75fe58c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_headers_2.json
@@ -0,0 +1,105 @@
+{
+ "name": "c_headers_2",
+ "id": "^c_headers_2::@6b8db101d64c125f29fe$",
+ "directorySource": "^fileset$",
+ "projectName": "codemodel-v2",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^fileset/empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 15,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^fileset/empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^fileset/empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 15,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib)?c_headers_2\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^fileset/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_headers_2\\.(a|lib)$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^fileset$",
+ "source": "^fileset$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "lib",
+ "backtrace": [
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": 25,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^fileset/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ "link": null,
+ "archive": {
+ "lto": null
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
index e3a8d0b..b4318dd 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
@@ -115,7 +115,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -145,7 +145,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -175,7 +175,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 46,
+ "line": 47,
"command": "install",
"hasParent": true
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
index 385fa62..5769f0c 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
@@ -136,7 +136,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 38,
+ "line": 39,
"command": "install",
"hasParent": true
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
index 73e8e12..1fe4d67 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
@@ -91,7 +91,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -121,7 +121,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 41,
+ "line": 42,
"command": "install",
"hasParent": true
},
@@ -151,7 +151,7 @@
"backtrace": [
{
"file": "^codemodel-v2\\.cmake$",
- "line": 46,
+ "line": 47,
"command": "install",
"hasParent": true
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
index da928eb..019eb87 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2.cmake
+++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
@@ -22,6 +22,7 @@ add_subdirectory(interface)
add_subdirectory(custom)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild")
add_subdirectory(dir)
+add_subdirectory(fileset)
set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib)
set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib)
diff --git a/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt b/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt
new file mode 100644
index 0000000..f80f12b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/CMakeLists.txt
@@ -0,0 +1,25 @@
+add_library(c_headers_1 STATIC empty.c)
+
+target_sources(c_headers_1
+ PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES error.c other.c
+ PRIVATE FILE_SET a TYPE HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES h1.h
+ )
+target_sources(c_headers_1
+ PUBLIC FILE_SET b TYPE HEADERS BASE_DIRS "$<1:${CMAKE_CURRENT_SOURCE_DIR}/dir>" FILES "$<1:${CMAKE_CURRENT_SOURCE_DIR}/dir/h2.h>"
+ )
+target_sources(c_headers_1
+ INTERFACE FILE_SET c TYPE HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES h3.h
+ )
+source_group("Source Files" FILES "${CMAKE_CURRENT_SOURCE_DIR}/other.c")
+
+add_library(c_headers_2 STATIC empty.c)
+target_sources(c_headers_2
+ INTERFACE FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" FILES h1.h
+ )
+
+install(TARGETS c_headers_1
+ FILE_SET HEADERS DESTINATION include COMPONENT Headers
+ FILE_SET b DESTINATION include/dir
+ FILE_SET c
+ )
+install(TARGETS c_headers_2)
diff --git a/Tests/RunCMake/FileAPI/fileset/dir/h2.h b/Tests/RunCMake/FileAPI/fileset/dir/h2.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/dir/h2.h
diff --git a/Tests/RunCMake/FileAPI/fileset/empty.c b/Tests/RunCMake/FileAPI/fileset/empty.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/empty.c
diff --git a/Tests/RunCMake/FileAPI/fileset/error.c b/Tests/RunCMake/FileAPI/fileset/error.c
new file mode 100644
index 0000000..f10e687
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/error.c
@@ -0,0 +1 @@
+#error "This should not be compiled"
diff --git a/Tests/RunCMake/FileAPI/fileset/h1.h b/Tests/RunCMake/FileAPI/fileset/h1.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/h1.h
diff --git a/Tests/RunCMake/FileAPI/fileset/h3.h b/Tests/RunCMake/FileAPI/fileset/h3.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/h3.h
diff --git a/Tests/RunCMake/FileAPI/fileset/other.c b/Tests/RunCMake/FileAPI/fileset/other.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/fileset/other.c