summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2012-07-04 21:08:32 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2012-07-04 21:08:32 (GMT)
commit05a8630ee63361ad8665b56412a9602761ca2dc4 (patch)
tree3f824403910f00d40558176479ed813f7df54a79 /Source
parentc8bf86cf82041172187103b61ea78340971483fc (diff)
downloadCMake-05a8630ee63361ad8665b56412a9602761ca2dc4.zip
CMake-05a8630ee63361ad8665b56412a9602761ca2dc4.tar.gz
CMake-05a8630ee63361ad8665b56412a9602761ca2dc4.tar.bz2
Do not provide defaul value for CPACK_PACKAGE_DIRECTORY if found in config.
This fixes bug #0012906.
Diffstat (limited to 'Source')
-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 6f5055c..396c551 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;
@@ -370,10 +369,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() )
{