From: <ai...@us...> - 2013-07-12 18:08:05
|
Revision: 12419 http://sourceforge.net/p/plplot/code/12419 Author: airwin Date: 2013-07-12 18:08:01 +0000 (Fri, 12 Jul 2013) Log Message: ----------- Follow the build of CMake itself so that the initial order of commands is cmake_minimum_required(... set(CMAKE_LEGACY_CYGWIN_WIN32 0) project(... This reordering should (hopefully) solve a current Cygwin issue where there is a warning about CMAKE_LEGACY_CYGWIN_WIN32 not being set. This reordering means that the variable CMAKE_SYSTEM_NAME is not defined when cmake_minimum_required is called so we must use the same minimum CMake version for all platforms. In retrospect this is a good thing since the value of the minimum version sets a number of CMake policies, and we want those policies (how CMake logic is interpreted) to be identical on all platforms. I also took this opportunity to update the minimum version from 2.8.2 on Linux and 2.8.6 on all other platforms to a uniform 2.8.9. I chose that minimum to be consistent with the CMake version available on Debian Wheezy (released a few months ago, and typically more conservative about CMake versions than other modern Linux distributions). What this means is modern Linux distribution users (and presumably users of modern Mac versions) should be able to build PLplot without having to build or download a modern CMake version as well. As always, Windows users and legacy Linux distribution users will have to download a binary CMake or build CMake with a version that satisifies the version requirements (currently 2.8.9). Tested by: Alan W. Irwin <ai...@us...> using the install target (for -DBUILD_TEST=ON) and also by running ctest. Note, I view this testing as the minimum acceptable for such a fundamental build-system change where some of the CMake policies (interpretations of CMake logic) have been updated on Linux from those policies in effect for 2.8.2 to the policies in effect for 2.8.9. Modified Paths: -------------- trunk/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2013-07-11 20:29:33 UTC (rev 12418) +++ trunk/CMakeLists.txt 2013-07-12 18:08:01 UTC (rev 12419) @@ -30,6 +30,11 @@ ${CMAKE_SOURCE_DIR}/cmake/UserOverride.cmake ) +cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR) + +# Force CMake to _NOT_ define 'WIN32' on Cygwin +set(CMAKE_LEGACY_CYGWIN_WIN32 0) + # It is a fatal error if no working C compiler is available to build # the PLplot core C library and core C examples. All other compilers # required by our bindings are optional in that if no working compiler @@ -40,26 +45,6 @@ message(STATUS "CMake version = ${CMAKE_VERSION}") message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # We prefer to support only the latest CMake version because it - # tends to be more free of issues and more consistent with recent - # software releases of software that PLplot depends on than earlier versions. - # However, as a special concession to our modern (not enterprise or - # LTS) Linux distro users so they can avoid a download of recent CMake, - # we allow them to use the system version of - # CMake which at this time (2011-10) is typically 2.8.2 or later. - cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR) -else(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # For non-Linux platforms we prefer to support only the most recent - # CMake version since that tends to be most free of issues and most - # consistent with releases of software that PLplot depends on. The - # most recently released CMake is 2.8.6 at this time (2011-10). - cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR) -endif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - -# Force CMake to _NOT_ define 'WIN32' on Cygwin -set(CMAKE_LEGACY_CYGWIN_WIN32 OFF) - # Set unambiguous names for these variables as a reminder. set(WIN32_AND_NOT_CYGWIN ${WIN32}) if(WIN32 OR CYGWIN) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |