On 05/01/2015 06:25 AM, Alan W. Irwin wrote:
> # First call to project so that CMAKE_SYSTEM_NAME is defined
> project(plplot NONE)
> if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
>      cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
> else(CMAKE_SYSTEM_NAME STREQUAL "Linux")
>      cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR)
> endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
> # "Real" call to project
> project(plplot C)

You don't need another project().  You can use enable_language(C).
Others have advised against having a different minimum, but if
you have good reasons for it then:

 cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
 project(plplot NONE)
 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
   cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR)
 endif()
 enable_language(C)

Note that this will cause policy settings to differ on Linux
versus elsewhere.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to