summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2003-01-09 13:47:17 (GMT)
committerKen Martin <ken.martin@kitware.com>2003-01-09 13:47:17 (GMT)
commit26bc7299336f6100c50078c62cfbdfcc07ebe98c (patch)
tree02a3ad142d206083d7152979fbd6dd9d9ee6b589 /Source
parent4f42971be8149e5a88e2becfef93a6f806d2b09f (diff)
downloadCMake-26bc7299336f6100c50078c62cfbdfcc07ebe98c.zip
CMake-26bc7299336f6100c50078c62cfbdfcc07ebe98c.tar.gz
CMake-26bc7299336f6100c50078c62cfbdfcc07ebe98c.tar.bz2
added watches for access of bw compat vars
Diffstat (limited to 'Source')
-rw-r--r--Source/cmake.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index e6b1fe6..4200de8 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -42,6 +42,19 @@
#include <sys/resource.h>
#endif
+
+void cmNeedBackwardsCompatibility(const std::string& variable,
+ int access_type, void* client_data)
+{
+ if (access_type == cmVariableWatch::UNKNOWN_VARIABLE_READ_ACCESS)
+ {
+ std::string message = "Error: An atttempt was made to access a variable: ";
+ message += variable;
+ message += " that has not been defined. Some variables were always defined by CMake in versions prior to 1.6. To fix this you might need to set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.4 or less. If you are writing a CMakeList file, (or have already set CMAKE_BACKWARDS_COMPATABILITY to 1.4 or less) then you probably need to include a CMake module to test for the feature this variable defines.";
+ cmSystemTools::Error(message.c_str());
+ }
+}
+
cmake::cmake()
{
#ifdef __APPLE__
@@ -66,6 +79,13 @@ cmake::cmake()
m_VariableWatch = new cmVariableWatch;
this->AddDefaultCommands();
+
+ m_VariableWatch->AddWatch("CMAKE_WORDS_BIGENDIAN",
+ cmNeedBackwardsCompatibility);
+ m_VariableWatch->AddWatch("CMAKE_SIZEOF_INT",
+ cmNeedBackwardsCompatibility);
+ m_VariableWatch->AddWatch("CMAKE_X_LIBS",
+ cmNeedBackwardsCompatibility);
}
cmake::~cmake()