ENH: better ability to find cmake program
This commit is contained in:
parent
3a200bf909
commit
a2b757aa2d
@ -1,5 +1,8 @@
|
|||||||
#cmakedefine CMAKE_NO_STD_NAMESPACE
|
#cmakedefine CMAKE_NO_STD_NAMESPACE
|
||||||
#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS
|
#cmakedefine CMAKE_NO_ANSI_STREAM_HEADERS
|
||||||
#define CMAKE_ROOT_DIR "${CMake_SOURCE_DIR}"
|
#define CMAKE_ROOT_DIR "${CMake_SOURCE_DIR}"
|
||||||
|
#define CMAKE_BUILD_DIR "${CMake_BINARY_DIR}"
|
||||||
|
#define CMAKE_PREFIX "${CMAKE_INSTALL_PREFIX}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,7 +133,25 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args)
|
|||||||
std::string cMakeSelf = args[0];
|
std::string cMakeSelf = args[0];
|
||||||
cmSystemTools::ConvertToUnixSlashes(cMakeSelf);
|
cmSystemTools::ConvertToUnixSlashes(cMakeSelf);
|
||||||
cMakeSelf = cmSystemTools::FindProgram(cMakeSelf.c_str());
|
cMakeSelf = cmSystemTools::FindProgram(cMakeSelf.c_str());
|
||||||
|
#ifdef CMAKE_BUILD_DIR
|
||||||
|
if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
|
||||||
|
{
|
||||||
|
cMakeSelf = CMAKE_BUILD_DIR;
|
||||||
|
cMakeSelf += "/Source/cmake";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef CMAKE_PREFIX
|
||||||
|
if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
|
||||||
|
{
|
||||||
|
cMakeSelf = CMAKE_PREFIX "/bin/cmake";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if(!cmSystemTools::FileExists(cMakeSelf.c_str()))
|
||||||
|
{
|
||||||
|
cmSystemTools::Error("CMAKE can not find the command line program cmake. "
|
||||||
|
"Attempted path: ", cMakeSelf.c_str());
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Save the value in the cache
|
// Save the value in the cache
|
||||||
cmCacheManager::GetInstance()->AddCacheEntry
|
cmCacheManager::GetInstance()->AddCacheEntry
|
||||||
("CMAKE_COMMAND",
|
("CMAKE_COMMAND",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user