| summaryrefslogtreecommitdiff |
path: root/CMakeLists.txt
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2015-09-04 12:48:01 +0200 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2015-09-04 12:48:01 +0200 |
| commit | dc75c584513dfd746f9819891c2eb6e77bfdf1ad (patch) | |
| tree | 577d5f9ef7fbc43a5873492d386808518d845d94 /CMakeLists.txt | |
| parent | 385a3d17995dafde4f2b57f8d3a42d4d4782119d (diff) | |
Better debug options, better string comparisons.
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 70 |
1 files changed, 50 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 003697f..0697bcb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,31 +25,61 @@ if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra") endif (CMAKE_COMPILER_IS_GNUCC) -# Highest debug level is defined here to be able to access it in CMake. -set(RELABSD_HIGHEST_DEBUG_LEVEL 100) -target_compile_definitions( - relabsd - PUBLIC - "-DRELABSD_HIGHEST_DEBUG_LVL=${RELABSD_HIGHEST_DEBUG_LEVEL}" +option( + RELABSD_DEBUG_PROGRAM_FLOW + "Adds debug messages to display the program's flow." + OFF ) -message( - STATUS - "[CONST] Highest debug level set to ${RELABSD_HIGHEST_DEBUG_LEVEL}." +if (RELABSD_DEBUG_PROGRAM_FLOW) + target_compile_definitions( + relabsd + PUBLIC + "-DRELABSD_DEBUG_PROGRAM_FLOW=1" + ) + message(STATUS "[OPTION] Debug messages for the program's flow.") +endif (RELABSD_DEBUG_PROGRAM_FLOW) + +option( + RELABSD_DEBUG_CONFIG + "Adds debug messages to check the program's configuration." + OFF ) +if (RELABSD_DEBUG_CONFIG) + target_compile_definitions( + relabsd + PUBLIC + "-DRELABSD_DEBUG_CONFIG=1" + ) + message(STATUS "[OPTION] Debug messages for the program's configuration.") +endif (RELABSD_DEBUG_CONFIG) -set( - RELABSD_DEBUG_LEVEL - "0" - CACHE - INTEGER - "Debug verbosity level[0-${RELABSD_HIGHEST_DEBUG_LEVEL}]." +option( + RELABSD_DEBUG_REAL_EVENTS + "Adds debug messages to check the real device's events." + OFF ) -target_compile_definitions( - relabsd - PUBLIC - "-DRELABSD_DEBUG_LVL=${RELABSD_DEBUG_LEVEL}" +if (RELABSD_DEBUG_REAL_EVENTS) + target_compile_definitions( + relabsd + PUBLIC + "-DRELABSD_DEBUG_REAL_EVENTS=1" + ) + message(STATUS "[OPTION] Debug messages for the real device's events.") +endif (RELABSD_DEBUG_REAL_EVENTS) + +option( + RELABSD_DEBUG_VIRTUAL_EVENTS + "Adds debug messages to check the virtual device's events." + OFF ) -message(STATUS "[OPTION] Debug level set to ${RELABSD_DEBUG_LEVEL}.") +if (RELABSD_DEBUG_VIRTUAL_EVENTS) + target_compile_definitions( + relabsd + PUBLIC + "-DRELABSD_DEBUG_VIRTUAL_EVENTS=1" + ) + message(STATUS "[OPTION] Debug messages for the virtual device's events.") +endif (RELABSD_DEBUG_VIRTUAL_EVENTS) option( RELABSD_ENABLE_ERROR_LOCATION |


