Mercurial > trustbridge
diff 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 |
line wrap: on
line diff
--- a/CMakeLists.txt Tue Feb 11 17:57:55 2014 +0000 +++ b/CMakeLists.txt Wed Feb 12 16:52:27 2014 +0000 @@ -7,17 +7,25 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Default to debug build +if (NOT CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE Debug) +endif (NOT CMAKE_BUILD_TYPE) + find_package(Qt5Widgets REQUIRED) include_directories(${Qt5Widgets_INCLUDE_DIRS}) add_definitions(${Qt5Widgets_DEFINITIONS}) set(M13UI_SOURCES - ui/main.cpp - ui/mainwindow.cpp - ui/listutil.c + ${CMAKE_SOURCE_DIR}/ui/mainwindow.cpp + ${CMAKE_SOURCE_DIR}/ui/certificatelist.cpp + ${CMAKE_SOURCE_DIR}/ui/listutil.c ) +# Seperated to make it easier to include the sources in tests +set(M13UI_MAIN ui/main.cpp) + set(M13UI_RESOURCES ui/icons.qrc ) @@ -68,9 +76,9 @@ 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} ${CMAKE_WARN_FLAGS} ${HARDENING_FLAGS}") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARN_HARDENING_FLAGS} ${HARDENING_FLAGS}") -add_executable(m13ui ${M13UI_SOURCES}) +add_executable(m13ui ${M13UI_SOURCES} ${M13UI_MAIN}) target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS}) @@ -90,3 +98,5 @@ add_dependencies(static_check flawfinder) endif (FLAWFINDER_PATH) +# Tests +add_subdirectory(tests)