diff CMakeLists.txt @ 25:92108a2120f1

Move certificatelist to common. Add cinst directory
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 10 Mar 2014 14:15:15 +0000
parents de67047ca229
children cbd57d767dfa
line wrap: on
line diff
--- a/CMakeLists.txt	Fri Feb 21 15:12:24 2014 +0000
+++ b/CMakeLists.txt	Mon Mar 10 14:15:15 2014 +0000
@@ -37,8 +37,6 @@
 )
 
 # Seperated to make it easier to include the sources in tests
-set(M13UI_MAIN )
-
 set(M13UI_RESOURCES
    ${CMAKE_SOURCE_DIR}/ui/icons.qrc
    ${CMAKE_SOURCE_DIR}/ui/certs.qrc
@@ -61,7 +59,7 @@
    # The following list is taken from the .pri file
    get_target_property(_loc Qt5::Widgets LOCATION)
    get_filename_component(_qtpath ${_loc} PATH)
-   set(XCB_EXTRA_LIBS
+   set(XCB_EXTRA_LIBS -static -static-libgcc
       -L${_qtpath}
       -lX11 -lX11-xcb -lXi -lxcb-render-util -lXrender -lSM -lICE -lxcb-render -ldbus-1
       -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr
@@ -89,13 +87,15 @@
    set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat")
 endif()
 
-qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES})
-
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}")
 
-add_executable(m13ui ${M13UI_SOURCES} ${M13UI_MAIN})
+# Adding resources here in an extra variable to enable reuse of
+# M13UI_SOURCES in the test subdirectory.
+set(M13UI_SOURCES_WITH_RESOURCES ${M13UI_SOURCES})
+qt5_add_resources(M13UI_SOURCES_WITH_RESOURCES ${M13UI_RESOURCES})
+add_executable(m13ui ${M13UI_SOURCES_WITH_RESOURCES})
 
 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS} gcov)
 
@@ -103,7 +103,7 @@
 
 # CPPCheck
 include(GenerateCppcheck)
-generate_cppcheck(SOURCES ${M13UI_SOURCES} "" "" m13ui)
+generate_cppcheck(SOURCES ${CINST_SOURCES} ${M13UI_SOURCES} TARGET_NAME m13)
 add_dependencies(static_check cppcheck)
 
 # FlawFinder
@@ -112,12 +112,14 @@
     add_custom_target(flawfinder COMMENT "FlawFinder" VERBATIM COMMAND ${FLAWFINDER_PATH}
        ${CMAKE_SOURCE_DIR}/ui
        ${CMAKE_SOURCE_DIR}/cinst
+       ${CMAKE_SOURCE_DIR}/common
     )
     add_dependencies(static_check flawfinder)
 endif (FLAWFINDER_PATH)
 
 # Tests
 add_subdirectory(tests)
+add_subdirectory(cinst)
 
 # Documentation
 configure_file (doc/Doxyfile.in doc/Doxyfile)

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