Skip to content
Snippets Groups Projects
Commit 35ce3216 authored by Norihiro Watanabe's avatar Norihiro Watanabe Committed by Dmitri Naumov
Browse files

[CMake] set the default OGS_LOG_LEVEL to debug also in release build

parent fba9522b
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,15 @@ option(EIGEN_NO_DEBUG "Disables Eigen's assertions" OFF)
# Logging
option(OGS_DISABLE_LOGGING "Disables all logog messages." OFF)
set(OGS_LOG_LEVEL "LOGOG_LEVEL_DEBUG" CACHE STRING "Set logging level included in compilation.")
set_property(CACHE OGS_LOG_LEVEL PROPERTY STRINGS
LOGOG_LEVEL_NONE
LOGOG_LEVEL_ERROR
LOGOG_LEVEL_WARN
LOGOG_LEVEL_INFO
LOGOG_LEVEL_DEBUG
LOGOG_LEVEL_ALL
)
# Debug
option(OGS_FATAL_ABORT "Abort in OGS_FATAL" OFF)
......@@ -166,6 +175,13 @@ if(OGS_BUILD_TESTS)
set(Data_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Tests/Data CACHE INTERNAL "")
endif()
# Logging level
if(OGS_DISABLE_LOGGING)
set(OGS_LOG_LEVEL LOGOG_LEVEL_NONE)
endif()
add_definitions(-DLOGOG_LEVEL=${OGS_LOG_LEVEL})
######################
### Subdirectories ###
######################
......
......@@ -9,21 +9,6 @@ endif()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# Logging level
if(OGS_DISABLE_LOGGING)
set(OGS_LOG_LEVEL LOGOG_LEVEL_NONE)
endif()
if(NOT DEFINED OGS_LOG_LEVEL)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DLOGOG_LEVEL=LOGOG_LEVEL_DEBUG)
else()
add_definitions(-DLOGOG_LEVEL=LOGOG_LEVEL_INFO)
endif() # CMAKE_BUILD_TYPE = Debug
else()
add_definitions(-DLOGOG_LEVEL=${OGS_LOG_LEVEL})
endif() # NOT DEFINED OGS_LOG_LEVEL
# Enable Visual Studio project folder grouping
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment