mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
CPack: Ensure CPACK_PACKAGE_DIRECTORY is an absolute path
Fixes: #18133, #19412
This commit is contained in:
@@ -314,7 +314,7 @@ int main(int argc, char const* const* argv)
|
||||
else {
|
||||
// get a default value (current working directory)
|
||||
cpackProjectDirectory = cmsys::SystemTools::GetCurrentWorkingDirectory();
|
||||
// use default value iff no value has been provided by the config file
|
||||
// use default value if no value has been provided by the config file
|
||||
if (!globalMF.IsSet("CPACK_PACKAGE_DIRECTORY")) {
|
||||
globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY",
|
||||
cpackProjectDirectory);
|
||||
@@ -324,6 +324,12 @@ int main(int argc, char const* const* argv)
|
||||
globalMF.AddDefinition(cd.first, cd.second);
|
||||
}
|
||||
|
||||
// Force CPACK_PACKAGE_DIRECTORY as absolute path
|
||||
cpackProjectDirectory = globalMF.GetDefinition("CPACK_PACKAGE_DIRECTORY");
|
||||
cpackProjectDirectory =
|
||||
cmSystemTools::CollapseFullPath(cpackProjectDirectory);
|
||||
globalMF.AddDefinition("CPACK_PACKAGE_DIRECTORY", cpackProjectDirectory);
|
||||
|
||||
const char* cpackModulesPath = globalMF.GetDefinition("CPACK_MODULE_PATH");
|
||||
if (cpackModulesPath) {
|
||||
globalMF.AddDefinition("CMAKE_MODULE_PATH", cpackModulesPath);
|
||||
|
||||
Reference in New Issue
Block a user