Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
24:de67047ca229 | 25:92108a2120f1 |
---|---|
35 ${CMAKE_SOURCE_DIR}/ui/main.cpp | 35 ${CMAKE_SOURCE_DIR}/ui/main.cpp |
36 ${CERTIFICATELIST_SOURCES} | 36 ${CERTIFICATELIST_SOURCES} |
37 ) | 37 ) |
38 | 38 |
39 # Seperated to make it easier to include the sources in tests | 39 # Seperated to make it easier to include the sources in tests |
40 set(M13UI_MAIN ) | |
41 | |
42 set(M13UI_RESOURCES | 40 set(M13UI_RESOURCES |
43 ${CMAKE_SOURCE_DIR}/ui/icons.qrc | 41 ${CMAKE_SOURCE_DIR}/ui/icons.qrc |
44 ${CMAKE_SOURCE_DIR}/ui/certs.qrc | 42 ${CMAKE_SOURCE_DIR}/ui/certs.qrc |
45 ) | 43 ) |
46 | 44 |
59 # See: https://bugreports.qt-project.org/browse/QTBUG-35918 | 57 # See: https://bugreports.qt-project.org/browse/QTBUG-35918 |
60 # XCB_EXTRA_LIBS should be gotten automatically. | 58 # XCB_EXTRA_LIBS should be gotten automatically. |
61 # The following list is taken from the .pri file | 59 # The following list is taken from the .pri file |
62 get_target_property(_loc Qt5::Widgets LOCATION) | 60 get_target_property(_loc Qt5::Widgets LOCATION) |
63 get_filename_component(_qtpath ${_loc} PATH) | 61 get_filename_component(_qtpath ${_loc} PATH) |
64 set(XCB_EXTRA_LIBS | 62 set(XCB_EXTRA_LIBS -static -static-libgcc |
65 -L${_qtpath} | 63 -L${_qtpath} |
66 -lX11 -lX11-xcb -lXi -lxcb-render-util -lXrender -lSM -lICE -lxcb-render -ldbus-1 | 64 -lX11 -lX11-xcb -lXi -lxcb-render-util -lXrender -lSM -lICE -lxcb-render -ldbus-1 |
67 -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr | 65 -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr |
68 -lxcb-shape -lxcb-keysyms -lQt5PlatformSupport | 66 -lxcb-shape -lxcb-keysyms -lQt5PlatformSupport |
69 -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core | 67 -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core |
87 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS} -lwinhttp -lcrypt32) | 85 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS} -lwinhttp -lcrypt32) |
88 | 86 |
89 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat") | 87 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat") |
90 endif() | 88 endif() |
91 | 89 |
92 qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES}) | |
93 | |
94 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") | 90 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") |
95 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") | 91 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") |
96 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}") | 92 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}") |
97 | 93 |
98 add_executable(m13ui ${M13UI_SOURCES} ${M13UI_MAIN}) | 94 # Adding resources here in an extra variable to enable reuse of |
95 # M13UI_SOURCES in the test subdirectory. | |
96 set(M13UI_SOURCES_WITH_RESOURCES ${M13UI_SOURCES}) | |
97 qt5_add_resources(M13UI_SOURCES_WITH_RESOURCES ${M13UI_RESOURCES}) | |
98 add_executable(m13ui ${M13UI_SOURCES_WITH_RESOURCES}) | |
99 | 99 |
100 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS} gcov) | 100 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS} gcov) |
101 | 101 |
102 add_custom_target(static_check) | 102 add_custom_target(static_check) |
103 | 103 |
104 # CPPCheck | 104 # CPPCheck |
105 include(GenerateCppcheck) | 105 include(GenerateCppcheck) |
106 generate_cppcheck(SOURCES ${M13UI_SOURCES} "" "" m13ui) | 106 generate_cppcheck(SOURCES ${CINST_SOURCES} ${M13UI_SOURCES} TARGET_NAME m13) |
107 add_dependencies(static_check cppcheck) | 107 add_dependencies(static_check cppcheck) |
108 | 108 |
109 # FlawFinder | 109 # FlawFinder |
110 find_program(FLAWFINDER_PATH flawfinder DOC "flawfinder path") | 110 find_program(FLAWFINDER_PATH flawfinder DOC "flawfinder path") |
111 if (FLAWFINDER_PATH) | 111 if (FLAWFINDER_PATH) |
112 add_custom_target(flawfinder COMMENT "FlawFinder" VERBATIM COMMAND ${FLAWFINDER_PATH} | 112 add_custom_target(flawfinder COMMENT "FlawFinder" VERBATIM COMMAND ${FLAWFINDER_PATH} |
113 ${CMAKE_SOURCE_DIR}/ui | 113 ${CMAKE_SOURCE_DIR}/ui |
114 ${CMAKE_SOURCE_DIR}/cinst | 114 ${CMAKE_SOURCE_DIR}/cinst |
115 ${CMAKE_SOURCE_DIR}/common | |
115 ) | 116 ) |
116 add_dependencies(static_check flawfinder) | 117 add_dependencies(static_check flawfinder) |
117 endif (FLAWFINDER_PATH) | 118 endif (FLAWFINDER_PATH) |
118 | 119 |
119 # Tests | 120 # Tests |
120 add_subdirectory(tests) | 121 add_subdirectory(tests) |
122 add_subdirectory(cinst) | |
121 | 123 |
122 # Documentation | 124 # Documentation |
123 configure_file (doc/Doxyfile.in doc/Doxyfile) | 125 configure_file (doc/Doxyfile.in doc/Doxyfile) |
124 add_subdirectory(doc) | 126 add_subdirectory(doc) |