mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-29 02:19:18 -05:00
@@ -1734,8 +1734,10 @@ Export And Install Expressions
|
|||||||
|
|
||||||
Content of the install prefix when the target is exported via
|
Content of the install prefix when the target is exported via
|
||||||
:command:`install(EXPORT)`, or when evaluated in the
|
:command:`install(EXPORT)`, or when evaluated in the
|
||||||
:prop_tgt:`INSTALL_NAME_DIR` property or the ``INSTALL_NAME_DIR`` argument of
|
:prop_tgt:`INSTALL_NAME_DIR` property, the ``INSTALL_NAME_DIR`` argument of
|
||||||
:command:`install(RUNTIME_DEPENDENCY_SET)`, and empty otherwise.
|
:command:`install(RUNTIME_DEPENDENCY_SET)`, the code argument of
|
||||||
|
:command:`install(CODE)`, or the file argument of :command:`install(SCRIPT)`,
|
||||||
|
and empty otherwise.
|
||||||
|
|
||||||
Multi-level Expression Evaluation
|
Multi-level Expression Evaluation
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
install-prefix-genex-install-code-script
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
|
||||||
|
now support the :genex:`$<INSTALL_PREFIX>` generator expression.
|
||||||
@@ -359,13 +359,15 @@ bool HandleScriptMode(std::vector<std::string> const& args,
|
|||||||
} else if (doing_script) {
|
} else if (doing_script) {
|
||||||
doing_script = false;
|
doing_script = false;
|
||||||
std::string script = arg;
|
std::string script = arg;
|
||||||
if (!cmSystemTools::FileIsFullPath(script)) {
|
if (!cmHasLiteralPrefix(script, "$<INSTALL_PREFIX>")) {
|
||||||
script =
|
if (!cmSystemTools::FileIsFullPath(script)) {
|
||||||
cmStrCat(helper.Makefile->GetCurrentSourceDirectory(), '/', arg);
|
script =
|
||||||
}
|
cmStrCat(helper.Makefile->GetCurrentSourceDirectory(), '/', arg);
|
||||||
if (cmSystemTools::FileIsDirectory(script)) {
|
}
|
||||||
status.SetError("given a directory as value of SCRIPT argument.");
|
if (cmSystemTools::FileIsDirectory(script)) {
|
||||||
return false;
|
status.SetError("given a directory as value of SCRIPT argument.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
helper.Makefile->AddInstallGenerator(
|
helper.Makefile->AddInstallGenerator(
|
||||||
cm::make_unique<cmInstallScriptGenerator>(
|
cm::make_unique<cmInstallScriptGenerator>(
|
||||||
|
|||||||
@@ -56,12 +56,12 @@ bool cmInstallScriptGenerator::Compute(cmLocalGenerator* lg)
|
|||||||
std::string cmInstallScriptGenerator::GetScript(
|
std::string cmInstallScriptGenerator::GetScript(
|
||||||
std::string const& config) const
|
std::string const& config) const
|
||||||
{
|
{
|
||||||
std::string script;
|
std::string script = this->Script;
|
||||||
if (this->AllowGenex && this->ActionsPerConfig) {
|
if (this->AllowGenex && this->ActionsPerConfig) {
|
||||||
script = cmGeneratorExpression::Evaluate(this->Script,
|
cmGeneratorExpression::ReplaceInstallPrefix(script,
|
||||||
this->LocalGenerator, config);
|
"${CMAKE_INSTALL_PREFIX}");
|
||||||
} else {
|
script =
|
||||||
script = this->Script;
|
cmGeneratorExpression::Evaluate(script, this->LocalGenerator, config);
|
||||||
}
|
}
|
||||||
return script;
|
return script;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,6 @@ unset(RunCMake_TEST_OPTIONS)
|
|||||||
|
|
||||||
run_install_test(Deprecated)
|
run_install_test(Deprecated)
|
||||||
run_install_test(PRE_POST_INSTALL_SCRIPT)
|
run_install_test(PRE_POST_INSTALL_SCRIPT)
|
||||||
run_install_test(SCRIPT)
|
|
||||||
run_install_test(TARGETS-CONFIGURATIONS)
|
run_install_test(TARGETS-CONFIGURATIONS)
|
||||||
run_install_test(DIRECTORY-PATTERN)
|
run_install_test(DIRECTORY-PATTERN)
|
||||||
run_install_test(TARGETS-Parts)
|
run_install_test(TARGETS-Parts)
|
||||||
@@ -174,6 +173,10 @@ run_install_test(FILES-PERMISSIONS)
|
|||||||
run_install_test(TARGETS-RPATH)
|
run_install_test(TARGETS-RPATH)
|
||||||
run_install_test(InstallRequiredSystemLibraries)
|
run_install_test(InstallRequiredSystemLibraries)
|
||||||
|
|
||||||
|
set(RunCMake_TEST_OPTIONS "-DCMAKE_POLICY_DEFAULT_CMP0087:STRING=NEW")
|
||||||
|
run_install_test(SCRIPT)
|
||||||
|
unset(RunCMake_TEST_OPTIONS)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
run_install_test(DIRECTORY-symlink-clobber)
|
run_install_test(DIRECTORY-symlink-clobber)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
check_installed([[^empty1.txt;empty2.txt$]])
|
check_installed([[^empty1.txt;empty2.txt;empty3.cmake;empty3.txt;empty4.cmake;empty4.txt$]])
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/empty3.cmake ${CMAKE_CURRENT_SOURCE_DIR}/empty4.cmake
|
||||||
|
DESTINATION .
|
||||||
|
)
|
||||||
install(
|
install(
|
||||||
SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/install_script.cmake"
|
SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/install_script.cmake"
|
||||||
CODE "write_empty_file(empty2.txt)"
|
CODE "write_empty_file(empty2.txt)"
|
||||||
|
SCRIPT "$<INSTALL_PREFIX>/empty3.cmake"
|
||||||
|
CODE [[include($<INSTALL_PREFIX>/empty4.cmake)]]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
write_empty_file(empty3.txt)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
write_empty_file(empty4.txt)
|
||||||
Reference in New Issue
Block a user