summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cpack.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-07-09 18:23:28 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-07-09 18:23:28 (GMT)
commitb636728e390b62c5952d2d3063d071fe5746008a (patch)
treef8eca23c003a8305e3a4be78ffef8f9e11faf396 /Source/CPack/cpack.cxx
parent098e8de461158154210a41cc80c46a6926c68303 (diff)
parent05a8630ee63361ad8665b56412a9602761ca2dc4 (diff)
downloadCMake-b636728e390b62c5952d2d3063d071fe5746008a.zip
CMake-b636728e390b62c5952d2d3063d071fe5746008a.tar.gz
CMake-b636728e390b62c5952d2d3063d071fe5746008a.tar.bz2
Merge topic 'CPack-honorCPACK_XXX-valuesInScriptFile'
05a8630 Do not provide defaul value for CPACK_PACKAGE_DIRECTORY if found in config.
Diffstat (limited to 'Source/CPack/cpack.cxx')
-rw-r--r--Source/CPack/cpack.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 20824b1..b603585 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -207,8 +207,7 @@ int main (int argc, char *argv[])
std::string helpHTML;
std::string cpackProjectName;
- std::string cpackProjectDirectory
- = cmsys::SystemTools::GetCurrentWorkingDirectory();
+ std::string cpackProjectDirectory;
std::string cpackBuildConfig;
std::string cpackProjectVersion;
std::string cpackProjectPatch;
@@ -374,10 +373,24 @@ int main (int argc, char *argv[])
globalMF->AddDefinition("CPACK_PACKAGE_VENDOR",
cpackProjectVendor.c_str());
}
+ // if this is not empty it has been set on the command line
+ // go for it. Command line override values set in config file.
if ( !cpackProjectDirectory.empty() )
{
globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY",
- cpackProjectDirectory.c_str());
+ cpackProjectDirectory.c_str());
+ }
+ // The value has not been set on the command line
+ 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
+ if (!globalMF->IsSet("CPACK_PACKAGE_DIRECTORY"))
+ {
+ globalMF->AddDefinition("CPACK_PACKAGE_DIRECTORY",
+ cpackProjectDirectory.c_str());
+ }
}
if ( !cpackBuildConfig.empty() )
{