Fix the current directory check for NMake
This commit is contained in:
parent
94c828bd1f
commit
66135bee42
@ -46,6 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "cmRegularExpression.h"
|
#include "cmRegularExpression.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
# include <windows.h>
|
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
const char* cmCacheManagerTypes[] =
|
const char* cmCacheManagerTypes[] =
|
||||||
{ "BOOL",
|
{ "BOOL",
|
||||||
"PATH",
|
"PATH",
|
||||||
@ -252,14 +256,27 @@ bool cmCacheManager::LoadCache(const char* path,
|
|||||||
if(cmSystemTools::CollapseFullPath(oldcwd.c_str())
|
if(cmSystemTools::CollapseFullPath(oldcwd.c_str())
|
||||||
!= cmSystemTools::CollapseFullPath(currentcwd.c_str()))
|
!= cmSystemTools::CollapseFullPath(currentcwd.c_str()))
|
||||||
{
|
{
|
||||||
std::string message =
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
std::string("The current CMakeCache.txt directory ") +
|
char filename1[1024];
|
||||||
currentcwd + std::string(" is different than the directory ") +
|
char filename2[1024];
|
||||||
std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
|
GetShortPathName(cmSystemTools::CollapseFullPath(oldcwd.c_str()).c_str(),
|
||||||
std::string(" where CMackeCache.txt was created. This may result "
|
filename1, 1023);
|
||||||
"in binaries being created in the wrong place. If you "
|
GetShortPathName(cmSystemTools::CollapseFullPath(currentcwd.c_str()).c_str(),
|
||||||
"are not sure, reedit the CMakeCache.txt");
|
filename2, 1023);
|
||||||
cmSystemTools::Error(message.c_str());
|
if ( std::string(filename1) != std::string(filename2) )
|
||||||
|
{
|
||||||
|
#endif // _WIN32
|
||||||
|
std::string message =
|
||||||
|
std::string("The current CMakeCache.txt directory ") +
|
||||||
|
currentcwd + std::string(" is different than the directory ") +
|
||||||
|
std::string(this->GetCacheValue("CMAKE_CACHEFILE_DIR")) +
|
||||||
|
std::string(" where CMackeCache.txt was created. This may result "
|
||||||
|
"in binaries being created in the wrong place. If you "
|
||||||
|
"are not sure, reedit the CMakeCache.txt");
|
||||||
|
cmSystemTools::Error(message.c_str());
|
||||||
|
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||||
|
}
|
||||||
|
#endif // _WIN32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user