From cf9e02879a545bc649cfe5ba41a259ebc68ca717 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Fri, 1 Feb 2013 10:32:15 +0100 Subject: [PATCH] Enables logging by default when using CMake --- CMakeLists.txt | 13 +++++++++---- libnfc/CMakeLists.txt | 5 +++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb668b4..7207a04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,10 +27,15 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/incl SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") # Options -SET(LIBNFC_DEBUG_OUTPUT OFF CACHE BOOL "Debug output of communication with the NFC chip") -IF(LIBNFC_DEBUG_OUTPUT) - ADD_DEFINITIONS(-DDEBUG -DLOG -g3) -ENDIF(LIBNFC_DEBUG_OUTPUT) +SET(LIBNFC_LOG ON CACHE BOOL "Enable log facility") +IF(LIBNFC_LOG) + ADD_DEFINITIONS(-DLOG) +ENDIF(LIBNFC_LOG) + +SET(LIBNFC_DEBUG_MODE OFF CACHE BOOL "Debug mode") +IF(LIBNFC_DEBUG_MODE) + ADD_DEFINITIONS(-DDEBUG -g3) +ENDIF(LIBNFC_DEBUG_MODE) # Doxygen SET(builddir "${CMAKE_BINARY_DIR}") diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index 6bed790..59b44d0 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -39,9 +39,10 @@ ENDIF(LIBUSB_FOUND) # Library SET(LIBRARY_SOURCES nfc nfc-device nfc-emulation nfc-internal conf iso14443-subr mirror-subr target-subr log ${DRIVERS_SOURCES} ${BUSES_SOURCES} ${CHIPS_SOURCES} ${WINDOWS_SOURCES}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -IF(LIBNFC_DEBUG_OUTPUT) + +IF(LIBNFC_LOG) LIST(APPEND LIBRARY_SOURCES log-printf) -ENDIF(LIBNFC_DEBUG_OUTPUT) +ENDIF(LIBNFC_LOG) ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES}) IF(PCSC_FOUND)