From ce73423ba4a656d6fbe745c3a0561f16a9753431 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 9 Jan 2013 11:26:57 +0100 Subject: [PATCH] Enable release mode from wrapper script By using --disable-debug (--enable-debug is the default), release mode can be toggled from the wrapper script. Some IDEs, notably QtCreator requires this flag to be set when running CMake, in order to enable debugging properly. Thus, it is explicitly set (and printed) when using ./configure also. --- configure | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 68a2e1b7..6bb469e0 100755 --- a/configure +++ b/configure @@ -13,6 +13,7 @@ Optional Features: --enable-shared build a shared library [default=yes] --enable-static build a static library [default=no]. Note: only one of the options shared and static may be built. + --disable-debug build a release version of the library [default=no] Optional Packages: --with-dune-common=PATH use DUNE-common library from a specified location @@ -57,6 +58,7 @@ EOF # default values prefix=/usr/local +buildtype=Debug # this variable will get feature options FEATURES= @@ -113,6 +115,11 @@ while getopts -- ":-:" optchar; do pkgname=${OPTARG#disable-} # casing is of course different case "${pkgname}" in + debug) + buildtype=Release + # special flag: don't disable any particular package + pkgname="" + ;; agmg |\ ert |\ superlu) @@ -125,6 +132,8 @@ while getopts -- ":-:" optchar; do pkgname="CXX11Features" ;; esac + # only disable packages if the flag refers to a proper one + test -n "${pkgname}" && \ FEATURES="${FEATURES} -DCMAKE_DISABLE_FIND_PACKAGE_${pkgname}=TRUE" ;; enable-*) @@ -165,7 +174,7 @@ shift $((OPTIND-1)) ENVVARS=${@/ACLOCAL_*=*/} # pass everything on to CMake -CMDLINE="env ${ENVVARS} cmake \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" ${FEATURES}" +CMDLINE="env ${ENVVARS} cmake \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype} ${FEATURES}" echo --- calling CMake for opm-core --- echo ${CMDLINE} eval exec ${CMDLINE}