[Cmake-commits] CMake branch, next, updated. v2.8.3-1013-ga0b5a1a

Brad King brad.king at kitware.com
Fri Dec 17 14:34:36 EST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a0b5a1ab71a1d1bc1b4278c3c38471ab93fc41d9 (commit)
       via  85c0a69a92e78275ea0b180482bafcdb877b0dc3 (commit)
       via  62c6d2d7e71c0607cd2891444d1b15ad536f7ada (commit)
       via  72db20fb2582f5409bde1e510969f3b715049660 (commit)
       via  5adef168c28e301b9a2824a43b3a16359846e28c (commit)
       via  cbc3258e678af865b476a42394a0de5718c29848 (commit)
      from  22740473008aeb09bfa8e0ba271f55f5252b0f3d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0b5a1ab71a1d1bc1b4278c3c38471ab93fc41d9
commit a0b5a1ab71a1d1bc1b4278c3c38471ab93fc41d9
Merge: 2274047 85c0a69
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 17 14:34:34 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 17 14:34:34 2010 -0500

    Merge topic 'cygwin' into next
    
    85c0a69 Cygwin: Do not define 'WIN32' (#10122)
    62c6d2d Merge branch 'cmake_--system-information_min-version' into cygwin
    72db20f Merge branch 'tests-if-CYGWIN' into cygwin
    5adef16 Merge branch 'cygwin-module-prefix' into cygwin
    cbc3258 Merge branch 'try-compile-min-version' into cygwin


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85c0a69a92e78275ea0b180482bafcdb877b0dc3
commit 85c0a69a92e78275ea0b180482bafcdb877b0dc3
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 17 14:19:58 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 17 14:19:58 2010 -0500

    Cygwin: Do not define 'WIN32' (#10122)
    
    One of Cygwin's goals is to build projects using the POSIX API with no
    Windows awareness.  Many CMake-built projects have been written to test
    for UNIX and WIN32 but not CYGWIN.  The preferred behavior under Cygwin
    in such projects is to take the UNIX path but not the WIN32 path.
    
    Unfortunately this change is BACKWARDS INCOMPATIBLE for Cygwin-aware
    CMake projects!  Some projects that previously built under Cygwin and
    are Cygwin-aware when they test for WIN32 may now behave differently.
    Eventually these projects will need to be updated, but to help users
    build them in the meantime we print a warning about the change in
    behavior.  Furthermore, one may set CMAKE_LEGACY_CYGWIN_WIN32 to request
    old behavior during the transition.
    
    Normally we avoid backwards incompatible changes, but we make an
    exception in this case for a few reasons:
    
    (1) This behavior is preferred by Cygwin's design goals.
    
    (2) A warning provides a clear path forward for everyone who may see
    incompatible behavior, and CMAKE_LEGACY_CYGWIN_WIN32 provides a
    compatibility option.  The warning and compatibility option both
    disappear when the minimum required version of CMake in a project is
    sufficiently new, so this issue will simply go away over time as
    projects are updated to account for the change.
    
    (3) The fixes required to update projects are fairly insignificant.
    Furthermore, the Cygwin distribution has no releases itself so project
    versions that predate said fixes tend to be difficult to build anyway.
    
    (4) This change enables many CMake-built projects that did not
    previously build under Cygwin to work out-of-the-box.  From bug #10122:
    
      "I have built over 120 different source packages with (my patched)
       CMake, including most of KDE4, and have found that NOT defining
       WIN32 on Cygwin is much more accurate." -- Yaakov Selkowitz
    
    A fully compatible change would require patches on top of these project
    releases for Cygwin even though they otherwise need not be aware of it.
    
    (5) Yaakov has been maintaining a fork of CMake with this change for the
    Cygwin Ports distribution.  It works well in practice.  By accepting the
    change in upstream CMake we avoid confusion between the versions.
    
    CMake itself builds without WIN32 defined on Cygwin.  Simply disable
    CMAKE_LEGACY_CYGWIN_WIN32 explicitly in our own CMakeLists.txt file.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 98bde02..4508e33 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,7 @@
 # See the License for more information.
 #=============================================================================
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR)
+SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
 PROJECT(CMake)
 IF(COMMAND CMAKE_POLICY)
   CMAKE_POLICY(SET CMP0003 NEW)
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index 1576982..b7ad2ce 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -1,4 +1,48 @@
-SET(WIN32 1)
+if("${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS "2.8.3.20101214")
+  set(__USE_CMAKE_LEGACY_CYGWIN_WIN32 1)
+endif()
+if(NOT DEFINED WIN32)
+  set(WIN32 0)
+  if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
+    if(NOT DEFINED CMAKE_LEGACY_CYGWIN_WIN32
+        AND DEFINED ENV{CMAKE_LEGACY_CYGWIN_WIN32})
+      set(CMAKE_LEGACY_CYGWIN_WIN32 $ENV{CMAKE_LEGACY_CYGWIN_WIN32})
+    endif()
+    if(CMAKE_LEGACY_CYGWIN_WIN32)
+      message(STATUS "Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32")
+      set(WIN32 1)
+    elseif("x${CMAKE_LEGACY_CYGWIN_WIN32}" STREQUAL "x")
+      message(WARNING "CMake no longer defines WIN32 on Cygwin!"
+        "\n"
+        "(1) If you are just trying to build this project, ignore this warning "
+        "or quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or "
+        "in the CMake cache.  "
+        "If later configuration or build errors occur then this project may "
+        "have been written under the assumption that Cygwin is WIN32.  "
+        "In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead."
+        "\n"
+        "(2) If you are developing this project, add the line\n"
+        "  set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required\n"
+        "at the top of your top-level CMakeLists.txt file or set the minimum "
+        "required version of CMake to 2.8.4 or higher.  "
+        "Then teach your project to build on Cygwin without WIN32.")
+    endif()
+  elseif(DEFINED CMAKE_LEGACY_CYGWIN_WIN32)
+    message(AUTHOR_WARNING "CMAKE_LEGACY_CYGWIN_WIN32 ignored because\n"
+      "  cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})\n"
+      "is at least 2.8.4.")
+  endif()
+endif()
+if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32)
+  # Pass WIN32 legacy setting to scripts.
+  if(WIN32)
+    set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 1)
+  else()
+    set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 0)
+  endif()
+  unset(__USE_CMAKE_LEGACY_CYGWIN_WIN32)
+endif()
+
 SET(CYGWIN 1)
 
 SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 56e0ed9..813258d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2340,17 +2340,19 @@ void cmMakefile::AddDefaultDefinitions()
   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__)
+#if defined(_WIN32)
   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");
+  if(cmSystemTools::IsOn(cmSystemTools::GetEnv("CMAKE_LEGACY_CYGWIN_WIN32")))
+    {
+    this->AddDefinition("WIN32", "1");
+    this->AddDefinition("CMAKE_HOST_WIN32", "1");
+    }
 #endif
 #if defined(__APPLE__)
   this->AddDefinition("APPLE", "1");

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=62c6d2d7e71c0607cd2891444d1b15ad536f7ada
commit 62c6d2d7e71c0607cd2891444d1b15ad536f7ada
Merge: 72db20f a6cb1d4
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 17 10:18:56 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 17 10:18:56 2010 -0500

    Merge branch 'cmake_--system-information_min-version' into cygwin


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=72db20fb2582f5409bde1e510969f3b715049660
commit 72db20fb2582f5409bde1e510969f3b715049660
Merge: 5adef16 d89e238
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 17 10:18:51 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Dec 17 10:18:51 2010 -0500

    Merge branch 'tests-if-CYGWIN' into cygwin


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5adef168c28e301b9a2824a43b3a16359846e28c
commit 5adef168c28e301b9a2824a43b3a16359846e28c
Merge: cbc3258 1dcc977
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 14 16:48:10 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 14 16:48:10 2010 -0500

    Merge branch 'cygwin-module-prefix' into cygwin


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cbc3258e678af865b476a42394a0de5718c29848
commit cbc3258e678af865b476a42394a0de5718c29848
Merge: da0a8f7 2afb820
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Dec 14 16:48:04 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Dec 14 16:48:04 2010 -0500

    Merge branch 'try-compile-min-version' into cygwin


-----------------------------------------------------------------------

Summary of changes:
 CMakeLists.txt                |    1 +
 Modules/Platform/CYGWIN.cmake |   46 ++++++++++++++++++++++++++++++++++++++++-
 Source/cmMakefile.cxx         |   10 +++++---
 3 files changed, 52 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list