diff CMakeLists.txt @ 37:00aa5fa3c2fb

Build System maintainance. Correct integration of Polarssl. Make profiling an option, fix static_check target
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 14 Mar 2014 09:01:19 +0000
parents bee7d274c4dc
children ad61489ce593
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Mar 14 08:59:06 2014 +0100
+++ b/CMakeLists.txt	Fri Mar 14 09:01:19 2014 +0000
@@ -2,6 +2,7 @@
 project(m13)
 
 option(DO_RELEASE_BUILD "Build for a public release." OFF)
+option(ENABLE_PROFILING "Set to enable profiling." OFF)
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
 
@@ -35,9 +36,10 @@
 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4")
 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0")
 
-# Uncomment to enable profiling
-# set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage")
-# set(PROFILING_LIBS gcov)
+if(ENABLE_PROFILING)
+   set(PROFILING_FLAGS "-fprofile-arcs -ftest-coverage")
+   set(PROFILING_LIBS gcov)
+endif()
 
 SET(CMAKE_EXE_LINKER_FLAGS=${PROFILING_FLAGS})
 
@@ -51,6 +53,8 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}")
 
+add_custom_target(static_check)
+
 # FlawFinder
 find_program(FLAWFINDER_PATH flawfinder DOC "flawfinder path")
 if (FLAWFINDER_PATH)

http://wald.intevation.org/projects/trustbridge/