summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2006-01-05 18:27:48 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2006-01-05 18:27:48 (GMT)
commitb9c4cff45a8cc24ce4d18ba66d57b713be08ccfc (patch)
tree9c9ca42e1ab79fe3f750e1ee3d7a28b01a732894
parent17c3a897974556572f0163d52da4fd4ef12b106a (diff)
downloadCMake-b9c4cff45a8cc24ce4d18ba66d57b713be08ccfc.zip
CMake-b9c4cff45a8cc24ce4d18ba66d57b713be08ccfc.tar.gz
CMake-b9c4cff45a8cc24ce4d18ba66d57b713be08ccfc.tar.bz2
ENH: More debugging and work on PackageMaker code
-rw-r--r--Source/CPack/cmCPackGenericGenerator.cxx16
-rw-r--r--Source/CPack/cpack.cxx7
2 files changed, 19 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackGenericGenerator.cxx b/Source/CPack/cmCPackGenericGenerator.cxx
index 7c1eb51..7f77178 100644
--- a/Source/CPack/cmCPackGenericGenerator.cxx
+++ b/Source/CPack/cmCPackGenericGenerator.cxx
@@ -328,12 +328,13 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
// 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(!cmSystemTools::FileExists(modules.c_str()))
+ if(modules.empty() || !cmSystemTools::FileExists(modules.c_str()))
{
// next try exe/..
cMakeRoot = cmSystemTools::GetProgramPath(m_CMakeSelf.c_str());
@@ -344,6 +345,7 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
}
// 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()))
@@ -351,6 +353,7 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
// 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()))
@@ -358,6 +361,7 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
// 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
@@ -366,6 +370,7 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
// 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);
}
#endif
if (!cmSystemTools::FileExists(modules.c_str()))
@@ -374,6 +379,7 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
cMakeRoot = cmSystemTools::GetProgramPath(m_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()))
{
@@ -381,6 +387,7 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
cMakeRoot = cmSystemTools::GetProgramPath(m_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()))
{
@@ -392,6 +399,8 @@ int cmCPackGenericGenerator::FindRunningCMake(const char* arg0)
return 0;
}
m_CMakeRoot = cMakeRoot;
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Looking for CMAKE_ROOT: " << m_CMakeRoot.c_str() << std::endl);
+ this->SetOption("CMAKE_ROOT", m_CMakeRoot.c_str());
return 1;
}
@@ -441,7 +450,10 @@ const char* cmCPackGenericGenerator::GetInstallPath()
//----------------------------------------------------------------------
std::string cmCPackGenericGenerator::FindTemplate(const char* name)
{
- return m_MakefileMap->GetModulesFile(name);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Look for template: " << name << std::endl);
+ std::string ffile = m_MakefileMap->GetModulesFile(name);
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: " << ffile.c_str() << std::endl);
+ return ffile;
}
//----------------------------------------------------------------------
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 8c0857f..4d35d77 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -282,7 +282,10 @@ int main (int argc, char *argv[])
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Cannot initialize CPack generator: " << generator.c_str() << std::endl);
parsed = 0;
}
- cpackGenerator->Initialize(gen, mf);
+ if ( !cpackGenerator->Initialize(gen, mf) )
+ {
+ parsed = 0;
+ }
if ( parsed && !cpackGenerator->FindRunningCMake(argv[0]) )
{
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Cannot initialize the generator" << std::endl);
@@ -337,7 +340,7 @@ int main (int argc, char *argv[])
int res = cpackGenerator->ProcessGenerator();
if ( !res )
{
- cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Error when generating package: " << cpackProjectName.c_str() << std::endl);
+ cmCPack_Log(&log, cmCPackLog::LOG_ERROR, "Error when generating package: " << projName << std::endl);
return 1;
}