diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-09-23 11:32:52 -0400 |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-09-23 11:32:52 -0400 |
commit | eaff66dbe84063bd1b60b603ed230a9287fb1c85 (patch) | |
tree | d6e185cd38f4fe1082e08e99bd1bce729a006afc | |
parent | ea7a5c45e9855f27fb8ed56ba3257f187151acb4 (diff) | |
download | cmake-eaff66dbe84063bd1b60b603ed230a9287fb1c85.tar.gz |
ENH: merge in changes for RC 6, fix cpack working from symlink is the only change
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | ChangeLog.manual | 3 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 176 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.h | 2 |
4 files changed, 25 insertions, 158 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6159278a7c..25d72940be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES) SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 6) SET(CMake_VERSION_PATCH 2) -SET(CMake_VERSION_RC 5) +SET(CMake_VERSION_RC 6) # CVS versions are odd, if this is an odd minor version # then set the CMake_VERSION_DATE variable IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$") diff --git a/ChangeLog.manual b/ChangeLog.manual index d6a611b181..bd31d9b15b 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,6 @@ +Changes in CMake 2.6.2 RC 6 +- Fix bug#7669 cpack did not work when sym-linked after install + Changes in CMake 2.6.2 RC 5 - Add beta BundleUtilities.cmake file - CPackRPM 7435 fixes to add optional post-install diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 50906063f2..f7593faaa3 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -886,7 +886,7 @@ int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf, { this->MakefileMap = mf; this->Name = name; - if ( !this->FindRunningCMake(argv0) ) + if ( !this->SetCMakeRoot() ) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot initialize the generator" << std::endl); @@ -942,165 +942,29 @@ const char* cmCPackGenerator::GetOption(const char* op) } //---------------------------------------------------------------------- -int cmCPackGenerator::FindRunningCMake(const char* arg0) +int cmCPackGenerator::SetCMakeRoot() { - int found = 0; - // Find our own executable. - std::vector<cmStdString> failures; - this->CPackSelf = arg0; - cmSystemTools::ConvertToUnixSlashes(this->CPackSelf); - failures.push_back(this->CPackSelf); - this->CPackSelf = cmSystemTools::FindProgram(this->CPackSelf.c_str()); - if(!cmSystemTools::FileExists(this->CPackSelf.c_str())) - { - failures.push_back(this->CPackSelf); - this->CPackSelf = "/usr/local/bin/ctest"; - } - if(!cmSystemTools::FileExists(this->CPackSelf.c_str())) - { - failures.push_back(this->CPackSelf); - cmOStringStream msg; - msg << "CPack can not find the command line program ctest.\n"; - msg << " argv[0] = \"" << arg0 << "\"\n"; - msg << " Attempted paths:\n"; - std::vector<cmStdString>::iterator i; - for(i=failures.begin(); i != failures.end(); ++i) - { - msg << " \"" << i->c_str() << "\"\n"; - } - cmCPackLogger(cmCPackLog::LOG_ERROR, msg.str().c_str() - << std::endl); - return 0; - } - std::string dir; - std::string file; - if(cmSystemTools::SplitProgramPath(this->CPackSelf.c_str(), - dir, file, true)) - { - this->CMakeSelf = dir += "/cmake"; - this->CMakeSelf += cmSystemTools::GetExecutableExtension(); - if(cmSystemTools::FileExists(this->CMakeSelf.c_str())) - { - found = 1; - } - } - if ( !found ) - { - failures.push_back(this->CMakeSelf); -#ifdef CMAKE_BUILD_DIR - std::string intdir = "."; -#ifdef CMAKE_INTDIR - intdir = CMAKE_INTDIR; -#endif - this->CMakeSelf = CMAKE_BUILD_DIR; - this->CMakeSelf += "/bin/"; - this->CMakeSelf += intdir; - this->CMakeSelf += "/cmake"; - this->CMakeSelf += cmSystemTools::GetExecutableExtension(); -#endif - if(!cmSystemTools::FileExists(this->CMakeSelf.c_str())) - { - failures.push_back(this->CMakeSelf); - cmOStringStream msg; - msg << "CPack can not find the command line program cmake.\n"; - msg << " argv[0] = \"" << arg0 << "\"\n"; - msg << " Attempted paths:\n"; - std::vector<cmStdString>::iterator i; - for(i=failures.begin(); i != failures.end(); ++i) - { - msg << " \"" << i->c_str() << "\"\n"; - } - cmCPackLogger(cmCPackLog::LOG_ERROR, msg.str().c_str() - << std::endl); - return 0; - } - } - // do CMAKE_ROOT, look for the environment variable first - std::string cMakeRoot; - std::string modules; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT" << std::endl); - if (getenv("CMAKE_ROOT")) - { - cMakeRoot = getenv("CMAKE_ROOT"); - modules = cMakeRoot + "/Modules/CMake.cmake"; - } - if(modules.empty() || !cmSystemTools::FileExists(modules.c_str())) - { - // next try exe/.. - cMakeRoot = cmSystemTools::GetProgramPath(this->CMakeSelf.c_str()); - std::string::size_type slashPos = cMakeRoot.rfind("/"); - if(slashPos != std::string::npos) - { - cMakeRoot = cMakeRoot.substr(0, slashPos); - } - // is there no Modules direcory there? - modules = cMakeRoot + "/Modules/CMake.cmake"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << modules.c_str() << std::endl); - } + // use the CMAKE_ROOT from cmake which should have been + // found by now + const char* root= + this->MakefileMap->GetDefinition("CMAKE_ROOT"); - if (!cmSystemTools::FileExists(modules.c_str())) - { - // try exe/../share/cmake - cMakeRoot += CMAKE_DATA_DIR; - modules = cMakeRoot + "/Modules/CMake.cmake"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << modules.c_str() << std::endl); - } -#ifdef CMAKE_ROOT_DIR - if (!cmSystemTools::FileExists(modules.c_str())) - { - // try compiled in root directory - cMakeRoot = CMAKE_ROOT_DIR; - modules = cMakeRoot + "/Modules/CMake.cmake"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << modules.c_str() << std::endl); - } -#endif -#ifdef CMAKE_PREFIX - if (!cmSystemTools::FileExists(modules.c_str())) + if(root) { - // try compiled in install prefix - cMakeRoot = CMAKE_PREFIX CMAKE_DATA_DIR; - modules = cMakeRoot + "/Modules/CMake.cmake"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << modules.c_str() << std::endl); + this->CMakeRoot = root; + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " + << this->CMakeRoot.c_str() << std::endl); + this->SetOption("CMAKE_ROOT", this->CMakeRoot.c_str()); + return 1; } -#endif - if (!cmSystemTools::FileExists(modules.c_str())) - { - // try - cMakeRoot = cmSystemTools::GetProgramPath(this->CMakeSelf.c_str()); - cMakeRoot += CMAKE_DATA_DIR; - modules = cMakeRoot + "/Modules/CMake.cmake"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << modules.c_str() << std::endl); - } - if(!cmSystemTools::FileExists(modules.c_str())) - { - // next try exe - cMakeRoot = cmSystemTools::GetProgramPath(this->CMakeSelf.c_str()); - // is there no Modules direcory there? - modules = cMakeRoot + "/Modules/CMake.cmake"; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << modules.c_str() << std::endl); - } - if (!cmSystemTools::FileExists(modules.c_str())) - { - // couldn't find modules - cmCPackLogger(cmCPackLog::LOG_ERROR, - "Could not find CMAKE_ROOT !!!" << std::endl - << "CMake has most likely not been installed correctly." << std::endl - <<"Modules directory not found in" << std::endl - << cMakeRoot.c_str() - << std::endl); - return 0; - } - this->CMakeRoot = cMakeRoot; - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " - << this->CMakeRoot.c_str() << std::endl); - this->SetOption("CMAKE_ROOT", this->CMakeRoot.c_str()); - return 1; + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Could not find CMAKE_ROOT !!!" + << std::endl + << "CMake has most likely not been installed correctly." + << std::endl + <<"Modules directory not found in" + << std::endl); + return 0; } //---------------------------------------------------------------------- diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 0f121b9e69..228116ac10 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -88,7 +88,7 @@ public: bool IsSet(const char* name) const; //! Set all the variables - int FindRunningCMake(const char* arg0); + int SetCMakeRoot(); //! Set the logger void SetLogger(cmCPackLog* log) { this->Logger = log; } |