[cmake-developers] cmake::GetCMakeCommand() wrong in ccmake

Alexander Neundorf neundorf at kde.org
Thu Nov 3 18:01:28 EDT 2011


Hi,

in ccmake, cmake::GetCMakeCommand() returns a wrong path when ccmake was 
invoked from the PATH.
CMakeCommand is in ccmake computed this way (in cmCursesMainForm.cxx):

 std::string whereCMake=cmSystemTools::GetProgramPath(this->Args[0].c_str());
 whereCMake += "/cmake";
 ...
 this->CMakeInstance->SetCMakeCommand(whereCMake.c_str());

Now if this->Args[0] is simply "ccmake", then whereCMake becomes "/cmake", 
which is wrong.

What would be the right way to fix this ?
Check whether whereCMake is empty, and only add the "/" if it is not empty ?

Set it to GetDefinition("CMAKE_COMMAND"), which is set if I see correctly in 
cmake::AddCMakePaths(), which seems to always set the full path ?

Alex



More information about the cmake-developers mailing list