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

David Cole david.cole at kitware.com
Thu Nov 3 18:06:24 EDT 2011


GetDefinition("CMAKE_COMMAND"), always the full path to "cmake"


On Thu, Nov 3, 2011 at 6:01 PM, Alexander Neundorf <neundorf at kde.org> wrote:
> 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
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>



More information about the cmake-developers mailing list