summaryrefslogtreecommitdiffstats
path: root/Source/cmCacheManager.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2001-11-21 16:35:01 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2001-11-21 16:35:01 (GMT)
commit66135bee42c1743eab8f4f64d87585a9824d6d37 (patch)
treea0b4de3ec768f5053077934313d1992573b89eaa /Source/cmCacheManager.cxx
parent94c828bd1fb56436dd4c35b39dc652260edc1405 (diff)
downloadCMake-66135bee42c1743eab8f4f64d87585a9824d6d37.zip
CMake-66135bee42c1743eab8f4f64d87585a9824d6d37.tar.gz
CMake-66135bee42c1743eab8f4f64d87585a9824d6d37.tar.bz2
Fix the current directory check for NMake
Diffstat (limited to 'Source/cmCacheManager.cxx')
-rw-r--r--Source/cmCacheManager.cxx33
1 files changed, 25 insertions, 8 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index 3d6ac98..9ba01db 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -46,6 +46,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "cmRegularExpression.h"
#include "stdio.h"
+#if defined(_WIN32) || defined(__CYGWIN__)
+# include <windows.h>
+#endif // _WIN32
+
const char* cmCacheManagerTypes[] =
{ "BOOL",
"PATH",
@@ -252,14 +256,27 @@ bool cmCacheManager::LoadCache(const char* path,
if(cmSystemTools::CollapseFullPath(oldcwd.c_str())
!= cmSystemTools::CollapseFullPath(currentcwd.c_str()))
{
- 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__)
+ char filename1[1024];
+ char filename2[1024];
+ GetShortPathName(cmSystemTools::CollapseFullPath(oldcwd.c_str()).c_str(),
+ filename1, 1023);
+ GetShortPathName(cmSystemTools::CollapseFullPath(currentcwd.c_str()).c_str(),
+ filename2, 1023);
+ 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
}
}