summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAina Niemetz <aina.niemetz@gmail.com>2018-09-12 13:02:49 -0700
committerMathias Preiner <mathias.preiner@gmail.com>2018-09-22 16:30:59 -0700
commitb6012cbc43a76d7859f65226c3b9ff65cc0f26ca (patch)
tree43f186f4a93aec5019927baa48ba93747c433c52 /CMakeLists.txt
parent89042eec4f63f0aebd3e540dbca5e01714d152b4 (diff)
cmake: Refactor and clean up build profile printing.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt35
1 files changed, 11 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53c7466c5..4120e5984 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -276,15 +276,6 @@ set(GPL_LIBS "")
set(BUILD_TYPES Production Debug Testing Competition)
#-----------------------------------------------------------------------------#
-# CVC4 build variables
-
-set(CVC4_DEBUG 0)
-set(CVC4_BUILD_PROFILE_PRODUCTION 0)
-set(CVC4_BUILD_PROFILE_DEBUG 0)
-set(CVC4_BUILD_PROFILE_TESTING 0)
-set(CVC4_BUILD_PROFILE_COMPETITION 0)
-
-#-----------------------------------------------------------------------------#
# Build types
if(ENABLE_ASAN)
@@ -300,6 +291,8 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
message(STATUS "Building ${CMAKE_BUILD_TYPE} build")
+# Note: Module CodeCoverage requires the name of the debug build to conform
+# to cmake standards (first letter uppercase).
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
include(ConfigDebug)
elseif(CMAKE_BUILD_TYPE STREQUAL "Production")
@@ -602,21 +595,8 @@ endif()
#-----------------------------------------------------------------------------#
# Print build configuration
-if(CVC4_BUILD_PROFILE_PRODUCTION)
- set(CVC4_BUILD_PROFILE_STRING "production")
-elseif(CVC4_BUILD_PROFILE_DEBUG)
- set(CVC4_BUILD_PROFILE_STRING "debug")
-elseif(CVC4_BUILD_PROFILE_TESTING)
- set(CVC4_BUILD_PROFILE_STRING "testing")
-elseif(CVC4_BUILD_PROFILE_COMPETITION)
- set(CVC4_BUILD_PROFILE_STRING "competition")
-endif()
-
-# Get all definitions added via add_definitions to print it below
-get_directory_property(CVC4_DEFINITIONS COMPILE_DEFINITIONS)
-string(REPLACE ";" " " CVC4_DEFINITIONS "${CVC4_DEFINITIONS}")
-
-# Print configuration of 2-valued or 3-valued option 'var' with prefix 'str'
+# Helper to print the configuration of a 2-valued or 3-valued option 'var'
+# with prefix 'str'.
macro(print_config str var)
if(${var} STREQUAL "ON")
set(OPT_VAL_STR "on")
@@ -628,6 +608,13 @@ macro(print_config str var)
message("${str} ${OPT_VAL_STR}")
endmacro()
+# Convert build type to lower case.
+string(TOLOWER ${CMAKE_BUILD_TYPE} CVC4_BUILD_PROFILE_STRING)
+
+# Get all definitions added via add_definitions.
+get_directory_property(CVC4_DEFINITIONS COMPILE_DEFINITIONS)
+string(REPLACE ";" " " CVC4_DEFINITIONS "${CVC4_DEFINITIONS}")
+
message("CVC4 ${CVC4_RELEASE_STRING}")
message("")
message("Build profile : ${CVC4_BUILD_PROFILE_STRING}")
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback