diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-08-10 13:07:39 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-08-10 13:07:39 (GMT) |
commit | 512e0d40efbefefdd8296bbdb84be56597b072f2 (patch) | |
tree | eac10b393b170b8edef12f80602598883a1de8db /Source/cmMakefile.cxx | |
parent | f9cb0f3cb44635ffaa70ae66eb5a615d90b1a861 (diff) | |
download | CMake-512e0d40efbefefdd8296bbdb84be56597b072f2.zip CMake-512e0d40efbefefdd8296bbdb84be56597b072f2.tar.gz CMake-512e0d40efbefefdd8296bbdb84be56597b072f2.tar.bz2 |
ENH: set UNIX, WIN32 and APPLE in cmMakefile.cxx as it was before, so it
works for scripts, then reset them in CMakeSystemSpecificInformation.cxx, so
the platform modules can set them again for the target system
Alex
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a6dd2e1..ecfdf80 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1911,16 +1911,31 @@ void cmMakefile::RemoveVariablesInString(std::string& source, */ void cmMakefile::AddDefaultDefinitions() { +/* Up to CMake 2.4 here only WIN32, UNIX and APPLE were set. + With CMake must separate between target and host platform. In most cases + the tests for WIN32, UNIX and APPLE will be for the target system, so an + additional set of variables for the host system is required -> + CMAKE_HOST_WIN32, CMAKE_HOST_UNIX, CMAKE_HOST_APPLE. + WIN32, UNIX and APPLE are now set in the platform files in + Modules/Platforms/. + To keep cmake scripts (-P) and custom language and compiler modules + working, these variables are still also set here in this place, but they + will be reset in CMakeSystemSpecificInformation.cmake before the platform + files are executed. */ #if defined(_WIN32) || defined(__CYGWIN__) + this->AddDefinition("WIN32", "1"); this->AddDefinition("CMAKE_HOST_WIN32", "1"); #else + this->AddDefinition("UNIX", "1"); this->AddDefinition("CMAKE_HOST_UNIX", "1"); #endif // Cygwin is more like unix so enable the unix commands #if defined(__CYGWIN__) + this->AddDefinition("UNIX", "1"); this->AddDefinition("CMAKE_HOST_UNIX", "1"); #endif #if defined(__APPLE__) + this->AddDefinition("APPLE", "1"); this->AddDefinition("CMAKE_HOST_APPLE", "1"); #endif |