From 61c5ce5e5e384d9340a9e71e5b7e21a9cd7070b2 Mon Sep 17 00:00:00 2001 From: Andreas Augustin Date: Tue, 12 Apr 2016 16:05:03 +0200 Subject: [PATCH] Add debugging output to CMakeLists.txt Signed-off-by: Andreas Augustin Signed-off-by: Ralf Ramsauer --- doorlockd/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doorlockd/CMakeLists.txt b/doorlockd/CMakeLists.txt index b9268ac..a1ab9ff 100644 --- a/doorlockd/CMakeLists.txt +++ b/doorlockd/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) project(doorlockd) option(USE_COLORIZED_LOGS "Colorized logging" ON) +option(DORLOCKD_CMAKE_DEBUG "Add some debug output" Off) set(DOORLOCK_VERSION_MAJOR 1) set(DOORLOCK_VERSION_MINOR 3) @@ -13,7 +14,10 @@ set(DOORLOCK_VERSION "${DOORLOCK_VERSION_MAJOR}.${DOORLOCK_VERSION_MINOR}-${DOOR set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) -MESSAGE(STATUS "doorlockd version: ${DOORLOCK_VERSION}") +if(DORLOCKD_CMAKE_DEBUG) + message(STATUS "[${CMAKE_CURRENT_LIST_DIR}:${CMAKE_CURRENT_LIST_LINE}] " + "doorlockd version: ${DOORLOCK_VERSION}") +endif() # Get the current working branch execute_process( @@ -24,6 +28,11 @@ execute_process( ) set(GIT_BRANCH "\"${GIT_BRANCH}\"") +if(DORLOCKD_CMAKE_DEBUG) + message(STATUS "[${CMAKE_CURRENT_LIST_DIR}:${CMAKE_CURRENT_LIST_LINE}] " + "git branch: ${GIT_BRANCH}") +endif() + # Get the latest abbreviated commit hash of the working branch execute_process( COMMAND git log -1 --format=%h @@ -33,6 +42,11 @@ execute_process( ) set(GIT_COMMIT_HASH "\"${GIT_COMMIT_HASH}\"") +if(DORLOCKD_CMAKE_DEBUG) + message(STATUS "[${CMAKE_CURRENT_LIST_DIR}:${CMAKE_CURRENT_LIST_LINE}] " + "git commit hash: ${GIT_COMMIT_HASH}") +endif() + add_definitions(-std=c++11) configure_file (