From f6d44238b1d273a432881787e18debd0f456913c Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Thu, 7 Mar 2013 21:28:17 +0100 Subject: [PATCH] Simplify setting of flag that indicates shared object Instead of having the name of the module set for each flag, use the available standard option. Mixing shared objects and static libraries in the same build is not a very realistic scenario anyway. This enables us to call configure without actually having a particular module; the script may then be used on a group level. --- cmake/Modules/OpmDefaults.cmake | 16 ++++++---------- configure | 9 ++------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/cmake/Modules/OpmDefaults.cmake b/cmake/Modules/OpmDefaults.cmake index 2f3043ea..49c255db 100644 --- a/cmake/Modules/OpmDefaults.cmake +++ b/cmake/Modules/OpmDefaults.cmake @@ -10,18 +10,14 @@ macro (opm_defaults opm) # default to building a static library, but let user override if (DEFINED BUILD_SHARED_LIBS) - set (_shared_def ${BUILD_SHARED_LIBS}) + if (BUILD_SHARED_LIBS) + set (${opm}_LIBRARY_TYPE SHARED) + else (BUILD_SHARED_LIBS) + set (${opm}_LIBRARY_TYPE STATIC) + endif (BUILD_SHARED_LIBS) else (DEFINED BUILD_SHARED_LIBS) - set (_shared_def OFF) - endif (DEFINED BUILD_SHARED_LIBS) - string (TOUPPER "${${opm}_NAME}" opm_UPPER) - string (REPLACE "-" "_" opm_UPPER "${opm_UPPER}") - option (BUILD_${opm_UPPER}_SHARED "Build ${${opm}_NAME} as a shared library" ${_shared_def}) - if (BUILD_${opm_UPPER}_SHARED) - set (${opm}_LIBRARY_TYPE SHARED) - else (BUILD_${opm_UPPER}_SHARED) set (${opm}_LIBRARY_TYPE STATIC) - endif (BUILD_${opm_UPPER}_SHARED) + endif (DEFINED BUILD_SHARED_LIBS) # precompile standard headers to speed up compilation # unfortunately, this functionality is buggy and tends to segfault at diff --git a/configure b/configure index 27e775af..150c141b 100755 --- a/configure +++ b/configure @@ -3,9 +3,6 @@ # where is the source tree located srcdir=$(dirname "$0") -# name of the project -project=$(sed -n "s,^Module:[\ \t]*\([^\ \t]*\),\1,p" "${srcdir}/dune.module") - # display help text usage () { cat <