| 3376 | } |
| 3377 | |
| 3378 | bool HandleGetRuntimeDependenciesCommand(std::vector<std::string> const& args, |
| 3379 | cmExecutionStatus& status) |
| 3380 | { |
| 3381 | std::string platform = |
| 3382 | status.GetMakefile().GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME"); |
| 3383 | if (!cmRuntimeDependencyArchive::PlatformSupportsRuntimeDependencies( |
| 3384 | platform)) { |
| 3385 | status.SetError( |
| 3386 | cmStrCat("GET_RUNTIME_DEPENDENCIES is not supported on system \"", |
| 3387 | platform, '"')); |
| 3388 | cmSystemTools::SetFatalErrorOccurred(); |
| 3389 | return false; |
| 3390 | } |
| 3391 | |
| 3392 | if (status.GetMakefile().GetState()->GetRole() == cmState::Role::Project) { |
| 3393 | status.GetMakefile().IssueMessage( |
| 3394 | MessageType::AUTHOR_WARNING, |
| 3395 | "You have used file(GET_RUNTIME_DEPENDENCIES)" |
| 3396 | " in project mode. This is probably not what " |
| 3397 | "you intended to do. Instead, please consider" |
| 3398 | " using it in an install(CODE) or " |
| 3399 | "install(SCRIPT) command. For example:" |
| 3400 | "\n install(CODE [[" |
| 3401 | "\n file(GET_RUNTIME_DEPENDENCIES" |
| 3402 | "\n # ..." |
| 3403 | "\n )" |
| 3404 | "\n ]])"); |
| 3405 | } |
| 3406 | |
| 3407 | struct Arguments : public ArgumentParser::ParseResult |
| 3408 | { |
| 3409 | std::string ResolvedDependenciesVar; |
| 3410 | std::string UnresolvedDependenciesVar; |
| 3411 | std::string ConflictingDependenciesPrefix; |
| 3412 | std::string RPathPrefix; |
| 3413 | std::string BundleExecutable; |
| 3414 | ArgumentParser::MaybeEmpty<std::vector<std::string>> Executables; |
| 3415 | ArgumentParser::MaybeEmpty<std::vector<std::string>> Libraries; |
| 3416 | ArgumentParser::MaybeEmpty<std::vector<std::string>> Directories; |
| 3417 | ArgumentParser::MaybeEmpty<std::vector<std::string>> Modules; |
| 3418 | ArgumentParser::MaybeEmpty<std::vector<std::string>> PreIncludeRegexes; |
| 3419 | ArgumentParser::MaybeEmpty<std::vector<std::string>> PreExcludeRegexes; |
| 3420 | ArgumentParser::MaybeEmpty<std::vector<std::string>> PostIncludeRegexes; |
| 3421 | ArgumentParser::MaybeEmpty<std::vector<std::string>> PostExcludeRegexes; |
| 3422 | ArgumentParser::MaybeEmpty<std::vector<std::string>> PostIncludeFiles; |
| 3423 | ArgumentParser::MaybeEmpty<std::vector<std::string>> PostExcludeFiles; |
| 3424 | ArgumentParser::MaybeEmpty<std::vector<std::string>> |
| 3425 | PostExcludeFilesStrict; |
| 3426 | }; |
| 3427 | |
| 3428 | static auto const parser = |
| 3429 | cmArgumentParser<Arguments>{} |
| 3430 | .Bind("RESOLVED_DEPENDENCIES_VAR"_s, &Arguments::ResolvedDependenciesVar) |
| 3431 | .Bind("UNRESOLVED_DEPENDENCIES_VAR"_s, |
| 3432 | &Arguments::UnresolvedDependenciesVar) |
| 3433 | .Bind("CONFLICTING_DEPENDENCIES_PREFIX"_s, |
| 3434 | &Arguments::ConflictingDependenciesPrefix) |
| 3435 | .Bind("RPATH_PREFIX"_s, &Arguments::RPathPrefix) |
nothing calls this directly
no test coverage detected
searching dependent graphs…