From 2e97aa717ba4fd143424f9e3fab418a985bb6045 Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 13 Sep 2012 08:23:32 +0000 Subject: [PATCH] Small changes on the BUILD_TYPE specific configuration git-svn-id: https://svn.dealii.org/branches/branch_cmake@26339 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/CMakeLists.txt | 28 ++++++++++++++++--- ...iler_flags.cmake => configure_build.cmake} | 7 +++++ 2 files changed, 31 insertions(+), 4 deletions(-) rename deal.II/contrib/cmake/configure/{configure_compiler_flags.cmake => configure_build.cmake} (75%) diff --git a/deal.II/CMakeLists.txt b/deal.II/CMakeLists.txt index f4fa7657d1..72b65c06ba 100644 --- a/deal.II/CMakeLists.txt +++ b/deal.II/CMakeLists.txt @@ -1,5 +1,3 @@ -PROJECT(deal.II) - SET(VERSION "8.0.pre") # @@ -41,6 +39,13 @@ SET(VERSION "8.0.pre") # separately. # # +# And, last but not least, CMAKE_BUILD_TYPES: +# +# We support the "Debug" and "Release" build types. Default is the +# "Release" target. +# +# TODO: Explanation +# # # General configuration options: @@ -130,6 +135,17 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/contrib/cmake/modules/" ) +# We have to initialize this cached variable before PROJECT is called: +IF(CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING + "Choose the type of build, options are: Debug Release.") +ELSE() + SET(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: Debug Release.") +ENDIF() + +PROJECT(deal.II) + # @@ -160,6 +176,12 @@ ADD_CUSTOM_TARGET(deal_ii_target_dependencies) SET(deal_ii_external_libraries "") SET(deal_ii_required_linker_flags "") +# +# Configuration for CMAKE_BUILD_TYPES (CFLAGS, CXXFLAGS, ..) +# + +INCLUDE(configure_build) + # # Platform checks: # @@ -174,8 +196,6 @@ INCLUDE(check_for_compiler_bugs) # Feature configuration: # -INCLUDE(configure_compiler_flags) - IF(DEAL_II_WITH_FUNCTIONPARSER) INCLUDE(configure_functionparser) ENDIF() diff --git a/deal.II/contrib/cmake/configure/configure_compiler_flags.cmake b/deal.II/contrib/cmake/configure/configure_build.cmake similarity index 75% rename from deal.II/contrib/cmake/configure/configure_compiler_flags.cmake rename to deal.II/contrib/cmake/configure/configure_build.cmake index dc87f53d34..3d0847795d 100644 --- a/deal.II/contrib/cmake/configure/configure_compiler_flags.cmake +++ b/deal.II/contrib/cmake/configure/configure_build.cmake @@ -1,4 +1,11 @@ +# +# Setup the build type and compiler flags +# + + + #TODO: + SET(CMAKE_CXX_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") SET(CMAKE_C_FLAGS "-Wfatal-errors -D_REENTRANT -fPIC -O2 -march=native") -- 2.39.5