diff ui/CMakeLists.txt @ 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 bde15f68942b
children 4433f9d57f6d
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}

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