mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 10:47:59 +08:00
FileAPI: Populate information for IMPORTED_RUNTIME_ARTIFACTS
This commit is contained in:
@@ -747,6 +747,11 @@ with members:
|
||||
An :command:`install(CODE)` call.
|
||||
This type has no additional members.
|
||||
|
||||
``importedRuntimeArtifacts``
|
||||
An :command:`install(IMPORTED_RUNTIME_ARTIFACTS)` call.
|
||||
The ``destination`` member is populated. The ``isOptional`` member may
|
||||
exist. This type has no additional members.
|
||||
|
||||
``isExcludeFromAll``
|
||||
Optional member that is present with boolean value ``true`` when
|
||||
:command:`install` is called with the ``EXCLUDE_FROM_ALL`` option.
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "cmInstallExportGenerator.h"
|
||||
#include "cmInstallFilesGenerator.h"
|
||||
#include "cmInstallGenerator.h"
|
||||
#include "cmInstallImportedRuntimeArtifactsGenerator.h"
|
||||
#include "cmInstallScriptGenerator.h"
|
||||
#include "cmInstallSubdirectoryGenerator.h"
|
||||
#include "cmInstallTargetGenerator.h"
|
||||
@@ -1009,6 +1010,15 @@ Json::Value DirectoryObject::DumpInstaller(cmInstallGenerator* gen)
|
||||
installer["scriptFile"] = RelativeIfUnder(
|
||||
this->TopSource, installScript->GetScript(this->Config));
|
||||
}
|
||||
} else if (auto* installImportedRuntimeArtifacts =
|
||||
dynamic_cast<cmInstallImportedRuntimeArtifactsGenerator*>(
|
||||
gen)) {
|
||||
installer["type"] = "importedRuntimeArtifacts";
|
||||
installer["destination"] =
|
||||
installImportedRuntimeArtifacts->GetDestination(this->Config);
|
||||
if (installImportedRuntimeArtifacts->GetOptional()) {
|
||||
installer["isOptional"] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Add fields common to all install generators.
|
||||
|
@@ -644,7 +644,7 @@ def gen_check_directories(c, g):
|
||||
|
||||
if sys.platform not in ("win32", "cygwin", "msys"):
|
||||
for e in expected:
|
||||
e["installers"] = list(filter(lambda i: "_dllExtra" not in i or not i["_dllExtra"], e["installers"]))
|
||||
e["installers"] = list(filter(lambda i: not i.get("_dllExtra", False), e["installers"]))
|
||||
if "aix" not in sys.platform:
|
||||
for i in e["installers"]:
|
||||
if "pathsNamelink" in i:
|
||||
|
@@ -14,6 +14,67 @@
|
||||
],
|
||||
"projectName": "Imported",
|
||||
"minimumCMakeVersion": "3.12",
|
||||
"hasInstallRule": null,
|
||||
"installers": []
|
||||
"hasInstallRule": true,
|
||||
"installers": [
|
||||
{
|
||||
"component": "Unspecified",
|
||||
"type": "importedRuntimeArtifacts",
|
||||
"destination": "lib",
|
||||
"paths": null,
|
||||
"isExcludeFromAll": null,
|
||||
"isForAllComponents": null,
|
||||
"isOptional": null,
|
||||
"targetId": null,
|
||||
"targetIndex": null,
|
||||
"targetIsImportLibrary": null,
|
||||
"targetInstallNamelink": null,
|
||||
"exportName": null,
|
||||
"exportTargets": null,
|
||||
"scriptFile": null,
|
||||
"backtrace": [
|
||||
{
|
||||
"file": "^imported/CMakeLists\\.txt$",
|
||||
"line": 32,
|
||||
"command": "install",
|
||||
"hasParent": true
|
||||
},
|
||||
{
|
||||
"file": "^imported/CMakeLists\\.txt$",
|
||||
"line": null,
|
||||
"command": null,
|
||||
"hasParent": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"component": "Unspecified",
|
||||
"type": "importedRuntimeArtifacts",
|
||||
"destination": "lib2",
|
||||
"paths": null,
|
||||
"isExcludeFromAll": null,
|
||||
"isForAllComponents": null,
|
||||
"isOptional": true,
|
||||
"targetId": null,
|
||||
"targetIndex": null,
|
||||
"targetIsImportLibrary": null,
|
||||
"targetInstallNamelink": null,
|
||||
"exportName": null,
|
||||
"exportTargets": null,
|
||||
"scriptFile": null,
|
||||
"backtrace": [
|
||||
{
|
||||
"file": "^imported/CMakeLists\\.txt$",
|
||||
"line": 35,
|
||||
"command": "install",
|
||||
"hasParent": true
|
||||
},
|
||||
{
|
||||
"file": "^imported/CMakeLists\\.txt$",
|
||||
"line": null,
|
||||
"command": null,
|
||||
"hasParent": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -28,3 +28,10 @@ endif()
|
||||
add_library(imported_interface_lib INTERFACE IMPORTED)
|
||||
add_executable(link_imported_interface_exe ../empty.c)
|
||||
target_link_libraries(link_imported_interface_exe PRIVATE imported_interface_lib)
|
||||
|
||||
install(IMPORTED_RUNTIME_ARTIFACTS imported_shared_lib
|
||||
DESTINATION lib
|
||||
)
|
||||
install(IMPORTED_RUNTIME_ARTIFACTS imported_shared_lib
|
||||
DESTINATION lib2 OPTIONAL
|
||||
)
|
||||
|
Reference in New Issue
Block a user