changeset 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 81183b721b51
children fc6241283474
files CMakeLists.txt build.sh cinst/CMakeLists.txt ui/CMakeLists.txt ui/tests/CMakeLists.txt
diffstat 5 files changed, 21 insertions(+), 6 deletions(-) [+]
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)
--- a/build.sh	Fri Mar 14 08:59:06 2014 +0100
+++ b/build.sh	Fri Mar 14 09:01:19 2014 +0000
@@ -9,7 +9,7 @@
 
 mkdir -p build-linux
 cd build-linux
-cmake .. -DCMAKE_VERBOSE_MAKEFILE=True -DCMAKE_PREFIX_PATH=~/wheezy
+cmake .. -DCMAKE_VERBOSE_MAKEFILE=True -DCMAKE_PREFIX_PATH=~/ubuntu
 nice make -j8
 cd ..
 mkdir -p build-windows
--- a/cinst/CMakeLists.txt	Fri Mar 14 08:59:06 2014 +0100
+++ b/cinst/CMakeLists.txt	Fri Mar 14 09:01:19 2014 +0000
@@ -1,8 +1,18 @@
 set(CMAKE_AUTOMOC OFF)
 
+include_directories(${POLARSSL_INCLUDE_DIR})
+
 set(CINST_SOURCES
     ${CMAKE_SOURCE_DIR}/cinst/main.c
     ${CMAKE_SOURCE_DIR}/common/listutil.c
 )
 
+set(MOZILLA_SOURCES
+    ${CMAKE_SOURCE_DIR}/cinst/mozilla.c
+)
+
 add_executable(cinst ${CINST_SOURCES})
+
+target_link_libraries(cinst
+   ${PROFILING_LIBS}
+   ${POLARSSL_LIBRARIES})
--- a/ui/CMakeLists.txt	Fri Mar 14 08:59:06 2014 +0100
+++ b/ui/CMakeLists.txt	Fri Mar 14 09:01:19 2014 +0000
@@ -58,7 +58,6 @@
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
 
-add_custom_target(static_check)
 generate_cppcheck(SOURCES ${CINST_SOURCES} ${M13UI_SOURCES} TARGET_NAME m13)
 add_dependencies(static_check cppcheck)
 
--- a/ui/tests/CMakeLists.txt	Fri Mar 14 08:59:06 2014 +0100
+++ b/ui/tests/CMakeLists.txt	Fri Mar 14 09:01:19 2014 +0000
@@ -9,7 +9,9 @@
   get_filename_component(_name ${_source} NAME_WE)
   add_executable(${_name} ${_test} ${_additional_sources})
   add_test(m13-${_name} ${_name})
-  target_link_libraries(${_name} Qt5::Test Qt5::Widgets ${EXTRA_STATIC_LIBS})
+  target_link_libraries(${_name} Qt5::Test Qt5::Widgets
+     ${EXTRA_STATIC_LIBS}
+     ${POLARSSL_LIBRARIES})
 endmacro()
 
 # Add the current source dir to the definition

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