Skip to content
Snippets Groups Projects
Commit a936cbe9 authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[duneproject] Update CMake minimum version if ENABLE_ALL is true

dune_enable_all_packages() now requires CMake 2.8.12, so make sure
duneproject generates a correct template.

Also output a warning to tell the user about this change in required
CMake version.
parent 346657b7
No related branches found
No related tags found
No related merge requests found
......@@ -182,6 +182,9 @@ DEPENDENCIES="$2"
VERSION="$3"
MAINTAINER="$4"
# Track minimum CMake version
CMAKE_MINIMUM_REQUIRED=2.8.6
################## READ OPTIONS ##################
while [ "$DATACORRECT" != "y" -a "$DATACORRECT" != "Y" ]; do
......@@ -226,7 +229,8 @@ while [ "$DATACORRECT" != "y" -a "$DATACORRECT" != "Y" ]; do
read -p "4) Maintainer's email address? " MAINTAINER
done
while [ "$ENABLE_ALL" != "y" -a "$ENABLE_ALL" != "Y" -a "$ENABLE_ALL" != "n" -a "$ENABLE_ALL" != "N" ]; do
read -p "5) Enable all available packages? (Choose 'y' if you don't understand the question.) [y/N]" ENABLE_ALL
echo "5) Enable all available packages? (Choose 'y' if you don't understand the question, but see warning below.)"
read -p " WARNING: If you enable this option, your module will require at least CMake 2.8.12 to build. You can check your version with 'cmake --version' [y/N]" ENABLE_ALL
done
echo
......@@ -243,11 +247,17 @@ while [ "$DATACORRECT" != "y" -a "$DATACORRECT" != "Y" ]; do
MAINTAINER=""
ENABLE_ALL=""
fi
done
# canonicalize contents of ENABLE_ALL
ENABLE_ALL=$(tr '[:upper:]' '[:lower:]' <<< "$ENABLE_ALL")
# set newer CMake minimum version if ENABLE_ALL is true
if [ 'y' == "$ENABLE_ALL" ] ; then
CMAKE_MINIMUM_REQUIRED=2.8.12
fi
echo
echo "A sample code $MODULE.cc is generated in the \"$PROJECT\" directory."
......@@ -377,7 +387,7 @@ Preparing the Sources
Additional to the software mentioned in README you'll need the
following programs installed on your system:
cmake >= 2.8.6
cmake >= ${CMAKE_MINIMUM_REQUIRED}
or if you use the old autoconf build system:
......@@ -490,7 +500,7 @@ M_DELIM
################## CMakeLists.txt ##################
echo "- $PROJECT/CMakeLists.txt"
cat> "$PROJECT/CMakeLists.txt" << M_DELIM
cmake_minimum_required(VERSION 2.8.6)
cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED})
project($PROJECT CXX)
if(NOT (dune-common_DIR OR dune-common_ROOT OR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment