From 27ccf67503c74a4de124a03167fb0127d818d0ef Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Mon, 26 Apr 2010 12:59:23 +0000 Subject: [PATCH] Reorganize CMake sections. --- CMakeLists.txt | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9d6ad2..c3dd301 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,13 +10,17 @@ SET(PACKAGE_NAME "libnfc") SET(PACKAGE_VERSION ${VERSION}) SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") +# config.h IF(NOT MSVC) SET(_XOPEN_SOURCE 600) ENDIF(NOT MSVC) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h) +ADD_DEFINITIONS("-DHAVE_CONFIG_H") + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include) +# Win32 IF(MSVC) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/win32 ${CMAKE_CURRENT_SOURCE_DIR}/win32/stdint) ENDIF(MSVC) @@ -24,15 +28,17 @@ ENDIF(MSVC) # make it easy to locate CMake modules for finding libraries 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 -g3) +ENDIF(LIBNFC_DEBUG_OUTPUT) + # Doxygen SET(builddir "${CMAKE_BINARY_DIR}") SET(top_srcdir "${CMAKE_SOURCE_DIR}") INCLUDE(UseDoxygen) -SET(LIBNFC_DEBUG_OUTPUT OFF CACHE BOOL "Debug output of communication with the NFC chip") -SET(LIBNFC_SERIAL_AUTOPROBE_ENABLED OFF CACHE BOOL "Allow serial ports to be probed (can seriously disturb connected serial devices)") -INCLUDE(LibnfcDrivers) - IF(DEFINED CMAKE_INSTALL_LIBDIR) SET(libdir ${CMAKE_INSTALL_LIBDIR}) ELSE(DEFINED CMAKE_INSTALL_LIBDIR) @@ -51,17 +57,7 @@ IF(NOT DEFINED SHARE_INSTALL_PREFIX) SET(SHARE_INSTALL_PREFIX share) ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX) -IF(LIBNFC_SERIAL_AUTOPROBE_ENABLED) - ADD_DEFINITIONS("-DSERIAL_AUTOPROBE_ENABLED") -ENDIF(LIBNFC_SERIAL_AUTOPROBE_ENABLED) - -IF(LIBNFC_DEBUG_OUTPUT) - ADD_DEFINITIONS(-DDEBUG -g3) -ENDIF(LIBNFC_DEBUG_OUTPUT) - -# CMake have config.h generation, so we must define this -ADD_DEFINITIONS("-DHAVE_CONFIG_H") - +# Additonnal GCC flags IF(CMAKE_COMPILER_IS_GNU_CC) # Make sure we will not miss some warnings ;) ADD_DEFINITIONS(-Wall -pedantic -std=c99)