From b54d40eb4f21f0f3de2b5ef35e7b0b2474a75f35 Mon Sep 17 00:00:00 2001 From: Timo Lotterbach Date: Thu, 28 Feb 2013 07:25:47 -0800 Subject: [PATCH] CMake: added WITH_STYLE_CHECKING build flag enabling this flags results in execution of all code styleguide checks during the build. Signed-off-by: Timo Lotterbach --- CMakeLists.txt | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22be97e..c099e04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,11 +31,28 @@ include(${CMAKE_MODULE_PATH}/CustomMacros.txt) add_subdirectory(cmake/optionalFeatures) #=========================================================================================================== -# global build flags +build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF) #=========================================================================================================== -build_flag (WITH_FORCE_COPY "Force Software Copy of Pixmaps (compatibility for VMs)" OFF) -build_flag (WITH_DLT "Build with DLT logging support" OFF) -build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF) +# no dedicated actions required here + +#=========================================================================================================== +build_flag (WITH_DLT "Build with DLT logging support" OFF) +#=========================================================================================================== +# no dedicated actions required here + +#=========================================================================================================== +build_flag (WITH_STATIC_LIBRARIES "Link all plugins and libraries statically" OFF) +#=========================================================================================================== +# no dedicated actions required here + +#=========================================================================================================== +build_flag (WITH_STYLE_CHECKING "Report styleguide problems during build (requires python)" OFF) +#=========================================================================================================== +if (WITH_STYLE_CHECKING) + set(CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}; echo 'Checking style...'; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py ") + set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}; ${CMAKE_SOURCE_DIR}/scripts/check_all_styles.py ") +endif (WITH_STYLE_CHECKING) +add_custom_target(check-style COMMAND ${CMAKE_SOURCE_DIR}/scripts/check_style.sh) #=========================================================================================================== build_flag (WITH_TESTS "Build unit test binaries for all enabled components" OFF) -- 2.7.4