BUG: Fix relative path to config file, fix cmake_install.cmake location problem

This commit is contained in:
Andy Cedilnik 2006-05-10 12:39:45 -04:00
parent 5b3a2c84fc
commit 26e75041fa
2 changed files with 10 additions and 16 deletions

View File

@ -282,6 +282,7 @@ int cmCPackGenericGenerator::InstallProject()
= this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS"); = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
const char* cmakeGenerator const char* cmakeGenerator
= this->GetOption("CPACK_CMAKE_GENERATOR"); = this->GetOption("CPACK_CMAKE_GENERATOR");
std::string currentWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory();
if ( cmakeProjects && *cmakeProjects ) if ( cmakeProjects && *cmakeProjects )
{ {
if ( !cmakeGenerator ) if ( !cmakeGenerator )

View File

@ -245,6 +245,7 @@ int main (int argc, char *argv[])
{ {
if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) ) if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
{ {
cpackConfigFile = cmSystemTools::CollapseFullPath(cpackConfigFile.c_str());
if ( !mf->ReadListFile(0, cpackConfigFile.c_str()) ) if ( !mf->ReadListFile(0, cpackConfigFile.c_str()) )
{ {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
@ -337,26 +338,18 @@ int main (int argc, char *argv[])
} }
if ( !mf->GetDefinition("CPACK_INSTALL_COMMANDS") && if ( !mf->GetDefinition("CPACK_INSTALL_COMMANDS") &&
!mf->GetDefinition("CPACK_INSTALLED_DIRECTORIES") ) !mf->GetDefinition("CPACK_INSTALLED_DIRECTORIES") &&
{ !mf->GetDefinition("CPACK_INSTALL_CMAKE_PROJECTS") )
cmsys::SystemTools::ConvertToUnixSlashes(cpackProjectDirectory);
std::string makeInstallFile
= cpackProjectDirectory + "/cmake_install.cmake";
if ( !cmsys::SystemTools::FileExists(makeInstallFile.c_str()) )
{ {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Cannot find installation file: " << makeInstallFile.c_str() "Please specify build tree of the project that uses CMake using "
<< std::endl); " CPACK_INSTALL_CMAKE_PROJECTS, specify CPACK_INSTALL_COMMANDS, or "
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "specify CPACK_INSTALLED_DIRECTORIES."
"Please specify build tree of the project that uses CMake, "
"specify CPACK_INSTALL_COMMANDS, or specify "
"CPACK_INSTALLED_DIRECTORIES."
<< std::endl); << std::endl);
parsed = 0; parsed = 0;
} }
} }
} }
}
if ( !parsed || help ) if ( !parsed || help )
{ {