changeset 560:3af16cbc961d

Move UI code into librarys to speed up build of unit tests
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 22 May 2014 10:57:05 +0000
parents dd8a295d5b4d
children 4433f9d57f6d
files ui/CMakeLists.txt ui/tests/CMakeLists.txt
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ui/CMakeLists.txt	Thu May 22 10:20:45 2014 +0000
+++ b/ui/CMakeLists.txt	Thu May 22 10:57:05 2014 +0000
@@ -127,7 +127,6 @@
    add_executable(trustbridge-admin
       ${_add_executable_params}
       ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp
-      ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
       ${ADMINISTRATOR_L10N}
       ${ADMINISTRATOR_TRANSLATION}
       )
@@ -139,7 +138,6 @@
    add_executable(trustbridge
       ${_add_executable_params}
       ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
-      ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
       ${TRUSTBRIDGE_L10N}
       ${TRUSTBRIDGE_TRANSLATION}
       )
@@ -148,24 +146,28 @@
    message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.")
    add_executable(trustbridge-admin
       ${_add_executable_params}
-      ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp
-      ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
+      ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp)
    add_executable(trustbridge
       ${_add_executable_params}
-      ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
-      ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
+      ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
 endif()
 
 add_library(ui_common STATIC ${UICOMMON_SOURCES})
+add_library(tbadminlib STATIC ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
+add_library(tblib STATIC ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
 
-target_link_libraries(trustbridge-admin Qt5::Widgets
+target_link_libraries(trustbridge-admin
+   tbadminlib
+   Qt5::Widgets
    ui_common
    trustbridge_common
    ${POLARSSL_LIBRARIES}
    ${EXTRA_STATIC_LIBS}
    ${PROFILING_LIBS})
 
-target_link_libraries(trustbridge Qt5::Widgets
+target_link_libraries(trustbridge
+   tblib
+   Qt5::Widgets
    ui_common
    trustbridge_common
    ${POLARSSL_LIBRARIES}
--- a/ui/tests/CMakeLists.txt	Thu May 22 10:20:45 2014 +0000
+++ b/ui/tests/CMakeLists.txt	Thu May 22 10:57:05 2014 +0000
@@ -32,6 +32,8 @@
   add_executable(${_name} ${_test_sources_with_resources})
   add_test(tb-${_name} ${_name})
   target_link_libraries(${_name}
+     tbadminlib
+     tblib
      ui_common
      Qt5::Test Qt5::Widgets
      trustbridge_common
@@ -42,7 +44,7 @@
 # Add the current source dir to the definition
 # so that it can be used in file names in the tests.
 add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
-add_custom_test(certlistparsertest.cpp "${CERTIFICATELIST_SOURCES}")
+add_custom_test(certlistparsertest.cpp "")
 
 # Downloader
 if (HIAWATHA_EXECUTABLE)
@@ -55,8 +57,8 @@
 add_dependencies(cinstprocesstest cinst)
 add_custom_test(commontest.cpp "")
 
-add_custom_test(createcertlisttest.cpp "${CMAKE_SOURCE_DIR}/ui/createcertlistdialog.cpp")
-add_custom_test(mainwindowtest.cpp "${TRUSTBRIDGE_SOURCES}")
+add_custom_test(createcertlisttest.cpp "")
+add_custom_test(mainwindowtest.cpp "")
 
 if (WIN32)
    add_custom_test(windowsstoretest.cpp "${CMAKE_SOURCE_DIR}/cinst/windowsstore.c")

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