From 4ce8814797fb572c14fb6d282cccbe24bd608db8 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Fri, 5 Dec 2014 06:38:22 -0500 Subject: [PATCH] Switch to raw assert for min CMake version Now that the minimum CMake version is 2.8.11, it seems that CMake now allows to to assert the minimum CMake version in an included file. However, you still need to provide a minimum CMake version in the base project CMakeLists.txt file or CMake provides a warning. --- tribits/examples/TribitsExampleProject/CMakeLists.txt | 4 ++++ tribits/examples/TribitsHelloWorld/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tribits/examples/TribitsExampleProject/CMakeLists.txt b/tribits/examples/TribitsExampleProject/CMakeLists.txt index b1bfc0dae..62d731d37 100644 --- a/tribits/examples/TribitsExampleProject/CMakeLists.txt +++ b/tribits/examples/TribitsExampleProject/CMakeLists.txt @@ -4,6 +4,10 @@ # # ################################################################################ +# To be safe, define your minimum CMake version. This may be newer than the +# min required by TriBITS. +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) + # Make CMake set WIN32 with CYGWIN for older CMake versions. CMake requires # this to be in the top-level CMakeLists.txt file and not an include file :-( SET(CMAKE_LEGACY_CYGWIN_WIN32 1 CACHE BOOL "" FORCE) diff --git a/tribits/examples/TribitsHelloWorld/CMakeLists.txt b/tribits/examples/TribitsHelloWorld/CMakeLists.txt index b7da4f69c..140dadba5 100644 --- a/tribits/examples/TribitsHelloWorld/CMakeLists.txt +++ b/tribits/examples/TribitsHelloWorld/CMakeLists.txt @@ -1,5 +1,9 @@ # Example of a simple project that uses TriBITS +# To be safe, define your minimum CMake version. This may be newer than the +# min required by TriBITS. +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) + # Make CMake set WIN32 with CYGWIN for older CMake versions. CMake requires # this to be in the top-level CMakeLists.txt file and not an include file :-( SET(CMAKE_LEGACY_CYGWIN_WIN32 1 CACHE BOOL "" FORCE)