#
MACRO(FEATURE_MPI_FIND_EXTERNAL var)
-
FIND_PACKAGE(MPI)
IF(MPI_CXX_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
SET(DEAL_II_COMPILER_SUPPORTS_MPI TRUE)
-
# TODO: (Maybe) set up the rest:
-
#MPI_CXX_COMPILER MPI Compiler wrapper for CXX
-
-
- #MPIEXEC Executable for running MPI programs
- #MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving
- # it the number of processors to run on
- #MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly
- # before the executable to run.
- #MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
+ #MPIEXEC Executable for running MPI programs
+ #MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC before giving it the number of processors to run on
+ #MPIEXEC_PREFLAGS Flags to pass to MPIEXEC directly before the executable to run.
+ #MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC after other flags
SET(${var} TRUE)
ENDMACRO()
CONFIGURE_FEATURE(MPI)
+
#
-# Configuration for the tbb library:
+# Configuration for tbb support:
#
#
-# Set up genereal threading. The macro will be included in
-# CONFIGURE_FEATURE_TBB_EXTERNAL/CONTRIB:
+# Set up genereal threading:
+# The macro will be included in CONFIGURE_FEATURE_TBB_EXTERNAL/CONTRIB.
#
MACRO(SETUP_THREADING var)
FIND_PACKAGE(Threads)
#
# We support threading. Go on and configure the rest:
#
-
ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-
SET(DEAL_II_USE_MT TRUE)
#
IF(CMAKE_USE_PTHREADS_INIT)
SET(DEAL_II_USE_MT_POSIX TRUE)
+ #
# Check whether posix thread barriers are available:
-
+ #
LIST(APPEND CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
-
CHECK_CXX_SOURCE_COMPILES(
"
#include <pthread.h>
}
"
DEAL_II_HAVE_MT_POSIX_BARRIERS)
-
LIST(REMOVE_ITEM CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS)
SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE)
ENDIF()
+
ENDIF()
#
# switches on some preprocessor flags. If this is not the case,
# then define them explicitely.
#
-
LIST(APPEND CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
CHECK_CXX_SOURCE_COMPILES(
"
#
MACRO(FEATURE_TBB_FIND_EXTERNAL var)
-
FIND_PACKAGE(TBB)
IF(TBB_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
# Add tbb directly to the object files of deal.II
#
+ #
# Setup threading (before configuring our build...)
# and if successfull return TRUE:
+ #
SETUP_THREADING(${var})
-
#
# We have to disable a bunch of warnings:
#
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-parentheses")
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-long-long")
-
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/tbb/tbb30_104oss/include
)
$<TARGET_OBJECTS:obj_tbb>
)
-
ENDMACRO()
CONFIGURE_FEATURE(TBB)
+
#
MACRO(FEATURE_ARPACK_FIND_EXTERNAL var)
-
FIND_PACKAGE(ARPACK)
IF(ARPACK_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_ARPACK_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${ARPACK_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${ARPACK_LIBRARY})
CONFIGURE_FEATURE(ARPACK)
+
#
MACRO(FEATURE_BLAS_FIND_EXTERNAL var)
-
FIND_PACKAGE(BLAS)
IF(BLAS_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_BLAS_CONFIGURE_EXTERNAL var)
-
ADD_FLAGS(CMAKE_SHARED_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
LIST(APPEND deal_ii_external_libraries
CONFIGURE_FEATURE(BLAS)
+
MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
-
FIND_PACKAGE (Boost COMPONENTS serialization thread)
IF(Boost_THREAD_FOUND AND Boost_SERIALIZATION_FOUND)
# Get rid of this annoying unimportant variable:
MARK_AS_ADVANCED(Boost_DIR)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_BOOST_CONFIGURE_CONTRIB var)
-
+ #
# compile the necessary parts of boost out of ./contrib
+ #
+ #
# We need to set some definitions to use the headers of the bundled boost
# library:
+ #
ADD_DEFINITIONS("-DBOOST_NO_HASH" "-DBOOST_NO_SLIST")
INCLUDE_DIRECTORIES(
)
IF( DEAL_II_USE_MT AND NOT DEAL_II_CAN_USE_CXX1X)
+ #
# If the C++ compiler doesn't completely support the C++1x standard
# (and consequently we can't use std::thread, std::mutex, etc), then
# include all the files that form BOOST's thread implementation so that
# we don't have to build BOOST itself only to get at this small part of
# it. it also ensures that we use the correct compiler and flags
-
+ #
ADD_SUBDIRECTORY(
${CMAKE_SOURCE_DIR}/contrib/boost-1.49.0/libs/thread/src
)
#
MACRO(FEATURE_DOXYGEN_FIND_EXTERNAL var)
-
FIND_PACKAGE(Doxygen)
#
IF(DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_DOXYGEN_CONFIGURE_EXTERNAL var)
-
#
# The FindDoxygen defines for us:
#
#
SET(${var} TRUE)
-
ENDMACRO()
MACRO(FEATURE_FUNCTIONPARSER_CONFIGURE_CONTRIB var)
-
+ #
# compile the necessary parts of functionparser out of ./contrib
+ #
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/functionparser/
CONFIGURE_FEATURE(FUNCTIONPARSER)
+
#
MACRO(FEATURE_LAPACK_FIND_EXTERNAL var)
-
FIND_PACKAGE(LAPACK)
IF(LAPACK_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
${LAPACK_LIBRARIES}
)
- LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
- LIST(APPEND CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
#
# TODO: Reduce to the really necessary parts.
#
+ LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
+ LIST(APPEND CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
CHECK_FUNCTION_EXISTS(daxpy_ HAVE_DAXPY_)
CHECK_FUNCTION_EXISTS(dgeevx_ HAVE_DGEEVX_)
CHECK_FUNCTION_EXISTS(dgeev_ AVE_DGEEV_)
CHECK_FUNCTION_EXISTS(dstev_ AVE_DSTEV_)
CHECK_FUNCTION_EXISTS(dsyevx_ HAVE_DSYEVX_)
CHECK_FUNCTION_EXISTS(dsygvx_ HAVE_DSYGVX_)
-
CHECK_FUNCTION_EXISTS(saxpy_ HAVE_SAXPY_)
CHECK_FUNCTION_EXISTS(sgeevx_ HAVE_SGEEVX_)
CHECK_FUNCTION_EXISTS(sgeev_ HAVE_SGEEV_)
CHECK_FUNCTION_EXISTS(sstev_ HAVE_SSTEV_)
CHECK_FUNCTION_EXISTS(ssyevx_ HAVE_SSYEVX_)
CHECK_FUNCTION_EXISTS(ssygvx_ HAVE_SSYGVX_)
-
CHECK_FUNCTION_EXISTS(strtrs_ HAVE_STRTRS_)
-
LIST(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "${LAPACK_LIBRARIES}")
LIST(REMOVE_ITEM CMAKE_REQUIRED_FLAGS "${LAPACK_LINKER_FLAGS}")
+
SET(HAVE_LIBLAPACK TRUE)
SET(${var} TRUE)
CONFIGURE_FEATURE(LAPACK)
+
#
MACRO(FEATURE_METIS_FIND_EXTERNAL var)
-
FIND_PACKAGE(METIS)
IF(METIS_FOUND AND METIS_MAJOR GREATER 4)
"Version 5.x required!"
)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_METIS_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${METIS_LIBRARY})
CONFIGURE_FEATURE(METIS)
+
#
MACRO(FEATURE_NETCDF_FIND_EXTERNAL var)
-
FIND_PACKAGE(NETCDF)
IF(NETCDF_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_NETCDF_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries ${NETCDF_LIBRARY})
SET(HAVE_LIBNETCDF TRUE)
CONFIGURE_FEATURE(NETCDF)
+
MACRO(FEATURE_P4EST_FIND_EXTERNAL var)
-
FIND_PACKAGE(P4EST)
FIND_PACKAGE(SC)
IF(P4EST_FOUND AND SC_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_P4EST_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${P4EST_INCLUDE_DIR} ${SC_INCLUDE_DIR})
IF (CMAKE_BUILD_TYPE MATCHES "Debug")
SET(DEAL_II_USE_P4EST TRUE)
SET(${var} TRUE)
-
ENDMACRO()
CONFIGURE_FEATURE(P4EST)
+
MACRO(FEATURE_TRILINOS_FIND_EXTERNAL var)
-
FIND_PACKAGE(TRILINOS)
IF(TRILINOS_FOUND)
- SET(${var} TRUE)
#
# So, we have a library. Let's see whether we can use it:
#
+ SET(${var} TRUE)
#
ENDIF()
-
#
# Trilinos 10.6 had quite a number of bugs we ran into, see
# for example
ENDIF()
-
#
# The same is unfortunately true for 10.8.[01]:
# https://software.sandia.gov/bugzilla/show_bug.cgi?id=5370
ENDIF()
-
#
# Trilinos has to be configured with the same MPI configuration as
- # deal.II. TODO: Refine this check...
- #
-
+ # deal.II.
#
# Epetra installs Epetra_MpiComm.h if configured trilinos was
# configured with mpi. We use this as a check for the mpi configuration
ENDIF()
-
#
# Some verions of Sacado_cmath.hpp does things that aren't compatible
# with the -std=c++0x flag of GCC, see deal.II FAQ.
ENDIF()
ENDIF(TRILINOS_FOUND)
-
ENDMACRO()
MACRO(FEATURE_TRILINOS_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${TRILINOS_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries
# else and we better disable some of the warnings to enable us
# to see through the clutter.
#
-
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-unused")
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-extra")
ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-Wno-overloaded-virtual")
SET(${var} TRUE)
-
ENDMACRO()
CONFIGURE_FEATURE(TRILINOS)
+
MACRO(FEATURE_UMFPACK_FIND_EXTERNAL var)
-
FIND_PACKAGE(UMFPACK)
FIND_PACKAGE(AMD)
IF(UMFPACK_FOUND AND AMD_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_UMFPACK_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${UMFPACK_INCLUDE_DIR} ${AMD_INCLUDE_DIR})
LIST(APPEND deal_ii_external_libraries
SET(HAVE_LIBUMFPACK TRUE)
SET(${var} TRUE)
-
ENDMACRO()
MACRO(FEATURE_UMFPACK_CONFIGURE_CONTRIB var)
-
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/contrib/umfpack/UMFPACK/Include
${CMAKE_SOURCE_DIR}/contrib/umfpack/AMD/Include
SET(HAVE_LIBUMFPACK TRUE)
SET(${var} TRUE)
-
ENDMACRO()
CONFIGURE_FEATURE(UMFPACK)
+
#
MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
-
FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
SET(${var} TRUE)
ENDIF()
-
ENDMACRO()
MACRO(FEATURE_ZLIB_CONFIGURE_EXTERNAL var)
-
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
LIST(APPEND deal_ii_external_libraries ${ZLIB_LIBRARIES})
SET(HAVE_LIBZ TRUE)
SET(${var} TRUE)
-
ENDMACRO()
CONFIGURE_FEATURE(ZLIB)
+
-# Try to find AMD
+#
+# Try to find the AMD library
+#
INCLUDE(FindPackageHandleStandardArgs)
AMD_INCLUDE_DIR
)
ENDIF()
+
-# Try to find ARPACK
+#
+# Try to find the ARPACK library
+#
INCLUDE(FindPackageHandleStandardArgs)
ARPACK_LIBRARY
)
ENDIF()
+
-# Try to find METIS
+#
+# Try to find the METIS library
+#
INCLUDE(FindPackageHandleStandardArgs)
#
# Extract the version number out of metis.h
#
-
FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MAJOR_STRING
REGEX "METIS_VER_MAJOR")
STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_MAJOR "${METIS_MAJOR_STRING}")
METIS_INCLUDE_DIR
)
ENDIF()
+
-# Try to find NETCDF
+#
+# Try to find the NETCDF library
+#
INCLUDE(FindPackageHandleStandardArgs)
NETCDF_INCLUDE_DIR
)
ENDIF()
+
-# Try to find P4EST
+#
+# Try to find the P4EST library
+#
INCLUDE(FindPackageHandleStandardArgs)
P4EST_INCLUDE_DIR
)
ENDIF()
+
-# Try to find the Threading Building Blocks-library
+#
+# Try to find the Threading Building Blocks library
+#
INCLUDE(FindPackageHandleStandardArgs)
TBB_INCLUDE_DIR
)
ENDIF()
+
-# Try to find the Trilinos
+#
+# Try to find the Trilinos library
+#
INCLUDE(FindPackageHandleStandardArgs)
PATH_PREFIXES lib64/cmake/Trilinos lib/cmake/Trilinos
)
+#
+# Extract the major and minor version numbers:
+#
STRING(REGEX REPLACE
"^([0-9]+).*$" "\\1"
TRILINOS_MAJOR "${Trilinos_VERSION}")
TRILINOS_SUBMINOR "${Trilinos_VERSION}")
-# TODO: Trilinos may export more than one include dir.
FIND_PATH(TRILINOS_INCLUDE_DIR Trilinos_version.h
HINTS ${Trilinos_INCLUDE_DIRS}
)
TRILINOS_LIBRARIES
)
ENDIF()
+
-# Try to find UMFPACK
+#
+# Try to find the UMFPACK library
+#
INCLUDE(FindPackageHandleStandardArgs)
UMFPACK_INCLUDE_DIR
)
ENDIF()
+
#
-# FAT NOTE:
+# Setup cached variables prior to the PROJECT(deal.II) call
+#
#
# We have a problem: We would like to setup our choice of C_FLAGS and
# CXX_FLAGS but let the user overwrite it (if desired).
#
# We have to call PROJECT(deal.II) in order to set up the project and run
# the C- and CXX-compiler detection and configuration. (Otherwise we cannot
-# compile anything and have no idea which compiler is selected.) In this
-# process CMAKE_{C|CXX}_FLAGS are already set to stupid default values.
+# compile anything and, furthermore, have no idea which compiler is
+# selected.) In this process CMAKE_CXX_FLAGS[...] are already set to stupid
+# default values.
# (And _cannot_ be sanely set from this script afterwards...)
#
# To mitigate this problem, we do the following:
#
-# - We initialize the cached CMAKE_{C|CXX}_FLAGS variables with empty
+# - We initialize the cached CMAKE_CXX_FLAGS[...] variables with empty
# strings prior to initializing the compiler, so that no default values
# are set.
#
#
# - At the end of the configuration step we add <variables>_SAVED
# _AT THE END_ of the respective <variable> allowing the user to
-# effectively overwrite our default setting.
+# effectively overwrite our default settings.
#
#
# Setup CMAKE_BUILD_TYPE:
#
-
SET(CMAKE_BUILD_TYPE
"Release"
CACHE STRING
"Choose the type of build, options are: Debug Release.")
+
+#
+# This is cruel, I know. But it is better to only have a known number of
+# options for CMAKE_BUILD_TYPE...
+#
IF( NOT CMAKE_BUILD_TYPE MATCHES "Release" AND
NOT CMAKE_BUILD_TYPE MATCHES "Debug" )
- #
- # This is cruel, I know. But it is better to only have a known number of
- # options for CMAKE_BUILD_TYPE...
- #
MESSAGE(FATAL_ERROR "CMAKE_BUILD_TYPE does neither match Release, nor Debug.")
ENDIF()
+
#
# Set BUILD_SHARED_LIBS to default to ON:
#
-SET(BUILD_SHARED_LIBS TRUE CACHE BOOL "Build a shared library")
+SET(BUILD_SHARED_LIBS ON CACHE OPTION "Build a shared library")
+
#
# Set cached compiler flags to an empty string:
#
-
SET(deal_ii_used_flags
CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_CXX_FLAGS_DEBUG
)
-
FOREACH(flags ${deal_ii_used_flags})
+
# "CACHE" ensures that we only set the variable if it is not already set
# as a cached variable, effectively we're setting a default value:
SET(${flags} "" CACHE STRING
#
SET(${flags}_SAVED "${${flags}}")
SET(${flags} "")
+
ENDFOREACH()
#
-# Setup default compiler flags:
+# Setup default compiler flags: This file sets up sensible default compiler
+# flags for the various platforms, compilers and build targets supported by
+# the deal.II library.
#
-# This file sets up sensible default compiler flags for the various
-# platforms, compilers and build targets supported by the deal.II
-# library.
#
-
-#
-# ####################
-# # FAT NOTE: #
-# ####################
+# ####################
+# # FAT NOTE: #
+# ####################
#
# All configuration in setup_compiler_flags.cmake and
# setup_compiler_flags_<compiler>.cmake shall ONLY consist of CFLAGS,
#
-# ######################
-# # FAT NOTE 2: #
-# ######################
+# We need a C compiler only for the compilation of the bundled umfpack
+# library, so we don't make much fuss about configuration and setup of the
+# C compiler and assume that CC and CXX are the same compiler brand, hence
+# supporting almost the same compiler flags.
+# (See setup in setup_compiler_flags_*.cmake)
#
-# For the moment we assume that CC and CXX are the same compiler.
-# We need CC for the compilation of the bundled umfpack library only...
# So, give a prominent error message in case CC and CXX differ:
#
IF(NOT ( ${CMAKE_C_COMPILER_ID} STREQUAL ${CMAKE_CXX_COMPILER_ID} AND
ENDIF()
-
-#
-# Setup CMAKE_CXX_FLAGS<_RELEASE|_DEBUG>:
-#
-
IF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
+ #
+ # *Hooray* We are allowed to set compiler flags :-]
+ #
MESSAGE(STATUS "Set up default compiler flags.")
#
SET(DEAL_II_KNOWN_COMPILER TRUE)
ENDIF()
+ #
+ # Setup for ICC compiler:
+ #
+ IF( CMAKE_CXX_COMPILER_ID MATCHES "Intel")
+ INCLUDE(setup_compiler_flags_intel)
+ SET(DEAL_II_KNOWN_COMPILER TRUE)
+ ENDIF()
+
IF(NOT DEAL_II_KNOWN_COMPILER)
MESSAGE(WARNING "\n"
- "Unrecognized compiler!\n\n"
+ "Unrecognized compiler!\n"
"Please set the relevant compiler options by hand.\n")
ENDIF()
ELSE(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
MESSAGE(STATUS
- "Skipped setting up default compiler flags "
+ "Skipped setup of default compiler flags "
"(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS=OFF)"
)
ENDIF(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)
-
-
-#
-# Setup CMAKE_C_FLAGS<_RELEASE|_DEBUG>:
-#
-
-#
-# For the moment we assume that CC and CXX are the same compiler and that
-# we can set (almost) the same default flags for both.
-#
-
-SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
-SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
-
-#
-# Strip flags not supported by a C target:
-#
-STRIP_FLAG(CMAKE_C_FLAGS "-Wsynth")
-STRIP_FLAG(CMAKE_C_FLAGS_RELEASE "-felide-constructors")
-
-#
-# Disable some warnings:
-#
-STRIP_FLAG(CMAKE_C_FLAGS "-Wall") # There is no other way to disable -Wunknown-pragma atm...
-STRIP_FLAG(CMAKE_C_FLAGS "-Wsign-compare")
-STRIP_FLAG(CMAKE_C_FLAGS "-Wwrite-strings")
#
# General setup for GCC and compilers sufficiently close to GCC
#
-# Please read the fat note in setup_compiler_flags.cmake prior to editing
-# this file.
+# Please read the fat note in setup_compiler_flags.cmake prior to
+# editing this file.
#
ENDIF()
-
#################################
# #
# For the Release target: #
ENABLE_IF_SUPPORTED(CMAKE_SHARED_LINKER_FLAGS "-g")
ENDIF()
ENDIF()
+
+
+###############################################
+# #
+# Set up CMAKE_C_FLAGS<_RELEASE|_DEBUG> #
+# #
+###############################################
+
+#
+# For the moment we assume that CC and CXX are the same compiler and that
+# we can set (almost) the same default flags for both:
+#
+SET(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
+SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+SET(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+
+#
+# OK, touché, touché. We have to strip flags not supported by a C target:
+#
+STRIP_FLAG(CMAKE_C_FLAGS "-Wsynth")
+STRIP_FLAG(CMAKE_C_FLAGS_RELEASE "-felide-constructors")
+
+#
+# and disable some warnings:
+#
+STRIP_FLAG(CMAKE_C_FLAGS "-Wall") # There is no other way to disable -Wunknown-pragma atm...
+STRIP_FLAG(CMAKE_C_FLAGS "-Wsign-compare")
+STRIP_FLAG(CMAKE_C_FLAGS "-Wwrite-strings")
+
+#
+# Finalize the configuration:
+#
+
#
# Append the saved initial (cached) variables ${flags}_SAVED at the end of
# ${flags}, see setup_cached_compiler_flags.cmake and the main
#
# And print out a nice configuration summary:
#
-
MESSAGE("
* *