From 2b17626e9b0ffbd5b3adf81e64aae975a35c8b6b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 7 Feb 2014 14:43:19 -0500 Subject: stringapi: Pass strings as install directories in CPack --- Source/CPack/cmCPackGenerator.cxx | 18 +++++++++--------- Source/CPack/cmCPackGenerator.h | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 4c52c96..3e1bf3b 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -254,7 +254,7 @@ int cmCPackGenerator::InstallProject() // If the project is a CMAKE project then run pre-install // and then read the cmake_install script to run it if ( !this->InstallProjectViaInstallCMakeProjects( - setDestDir, bareTempInstallDirectory.c_str()) ) + setDestDir, bareTempInstallDirectory) ) { return 0; } @@ -269,7 +269,7 @@ int cmCPackGenerator::InstallProject() //---------------------------------------------------------------------- int cmCPackGenerator::InstallProjectViaInstallCommands( - bool setDestDir, const char* tempInstallDirectory) + bool setDestDir, const std::string& tempInstallDirectory) { (void) setDestDir; const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS"); @@ -312,7 +312,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( //---------------------------------------------------------------------- int cmCPackGenerator::InstallProjectViaInstalledDirectories( - bool setDestDir, const char* tempInstallDirectory) + bool setDestDir, const std::string& tempInstallDirectory) { (void)setDestDir; (void)tempInstallDirectory; @@ -349,7 +349,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( return 0; } std::vector::iterator it; - const char* tempDir = tempInstallDirectory; + const std::string& tempDir = tempInstallDirectory; for ( it = installDirectoriesVector.begin(); it != installDirectoriesVector.end(); ++it ) @@ -457,7 +457,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( //---------------------------------------------------------------------- int cmCPackGenerator::InstallProjectViaInstallScript( - bool setDestDir, const char* tempInstallDirectory) + bool setDestDir, const std::string& tempInstallDirectory) { const char* cmakeScripts = this->GetOption("CPACK_INSTALL_SCRIPT"); @@ -499,7 +499,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( } else { - this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory); + this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory.c_str()); cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Using non-DESTDIR install... (this->SetOption)" << std::endl); @@ -509,9 +509,9 @@ int cmCPackGenerator::InstallProjectViaInstallScript( } this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR", - tempInstallDirectory); + tempInstallDirectory.c_str()); this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR", - tempInstallDirectory); + tempInstallDirectory.c_str()); int res = this->MakefileMap->ReadListFile(0, installScript.c_str()); if ( cmSystemTools::GetErrorOccuredFlag() || !res ) { @@ -524,7 +524,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript( //---------------------------------------------------------------------- int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( - bool setDestDir, const char* baseTempInstallDirectory) + bool setDestDir, const std::string& baseTempInstallDirectory) { const char* cmakeProjects = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS"); diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index 7e7c94f..fadd1bf 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -190,13 +190,13 @@ protected: //! Run install commands if specified virtual int InstallProjectViaInstallCommands( - bool setDestDir, const char* tempInstallDirectory); + bool setDestDir, const std::string& tempInstallDirectory); virtual int InstallProjectViaInstallScript( - bool setDestDir, const char* tempInstallDirectory); + bool setDestDir, const std::string& tempInstallDirectory); virtual int InstallProjectViaInstalledDirectories( - bool setDestDir, const char* tempInstallDirectory); + bool setDestDir, const std::string& tempInstallDirectory); virtual int InstallProjectViaInstallCMakeProjects( - bool setDestDir, const char* tempInstallDirectory); + bool setDestDir, const std::string& tempInstallDirectory); /** * The various level of support of -- cgit v0.12