Mercurial > trustbridge
comparison CMakeLists.txt @ 7:992c0ec57660
Add unit tests make CertificateList work.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Wed, 12 Feb 2014 16:52:27 +0000 |
parents | 9849250f50f2 |
children | 7e2f14c7aba2 |
comparison
equal
deleted
inserted
replaced
6:1f6455d46b30 | 7:992c0ec57660 |
---|---|
5 | 5 |
6 # Use cmake's automoc and make sure the generated files are included | 6 # Use cmake's automoc and make sure the generated files are included |
7 set(CMAKE_AUTOMOC ON) | 7 set(CMAKE_AUTOMOC ON) |
8 set(CMAKE_INCLUDE_CURRENT_DIR ON) | 8 set(CMAKE_INCLUDE_CURRENT_DIR ON) |
9 | 9 |
10 # Default to debug build | |
11 if (NOT CMAKE_BUILD_TYPE) | |
12 set (CMAKE_BUILD_TYPE Debug) | |
13 endif (NOT CMAKE_BUILD_TYPE) | |
14 | |
10 find_package(Qt5Widgets REQUIRED) | 15 find_package(Qt5Widgets REQUIRED) |
11 | 16 |
12 include_directories(${Qt5Widgets_INCLUDE_DIRS}) | 17 include_directories(${Qt5Widgets_INCLUDE_DIRS}) |
13 add_definitions(${Qt5Widgets_DEFINITIONS}) | 18 add_definitions(${Qt5Widgets_DEFINITIONS}) |
14 | 19 |
15 set(M13UI_SOURCES | 20 set(M13UI_SOURCES |
16 ui/main.cpp | 21 ${CMAKE_SOURCE_DIR}/ui/mainwindow.cpp |
17 ui/mainwindow.cpp | 22 ${CMAKE_SOURCE_DIR}/ui/certificatelist.cpp |
18 ui/listutil.c | 23 ${CMAKE_SOURCE_DIR}/ui/listutil.c |
19 ) | 24 ) |
25 | |
26 # Seperated to make it easier to include the sources in tests | |
27 set(M13UI_MAIN ui/main.cpp) | |
20 | 28 |
21 set(M13UI_RESOURCES | 29 set(M13UI_RESOURCES |
22 ui/icons.qrc | 30 ui/icons.qrc |
23 ) | 31 ) |
24 | 32 |
66 | 74 |
67 qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES}) | 75 qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES}) |
68 | 76 |
69 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") | 77 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") |
70 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") | 78 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") |
71 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_WARN_FLAGS} ${HARDENING_FLAGS}") | 79 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}") |
72 | 80 |
73 add_executable(m13ui ${M13UI_SOURCES}) | 81 add_executable(m13ui ${M13UI_SOURCES} ${M13UI_MAIN}) |
74 | 82 |
75 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS}) | 83 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS}) |
76 | 84 |
77 add_custom_target(static_check) | 85 add_custom_target(static_check) |
78 | 86 |
88 ${CMAKE_SOURCE_DIR}/ui | 96 ${CMAKE_SOURCE_DIR}/ui |
89 ) | 97 ) |
90 add_dependencies(static_check flawfinder) | 98 add_dependencies(static_check flawfinder) |
91 endif (FLAWFINDER_PATH) | 99 endif (FLAWFINDER_PATH) |
92 | 100 |
101 # Tests | |
102 add_subdirectory(tests) |