diff options
author | Johnny Jazeix <jazeix@gmail.com> | 2019-10-30 17:53:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-11-01 14:18:33 (GMT) |
commit | 63c0bc929240b0dd7253cced980fea0b735eb5c3 (patch) | |
tree | 217829099bed11b3b9c0240c30b5cab58882ca15 /Source/CPack | |
parent | 5c8d821ecabb0fba28719000182f241b16d86b44 (diff) | |
download | CMake-63c0bc929240b0dd7253cced980fea0b735eb5c3.zip CMake-63c0bc929240b0dd7253cced980fea0b735eb5c3.tar.gz CMake-63c0bc929240b0dd7253cced980fea0b735eb5c3.tar.bz2 |
CPack: Ensure CPACK_PACKAGE_DIRECTORY is an absolute path
Fixes: #18133, #19412
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cpack.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index 5895652..d7868f3 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -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); |