diff ui/CMakeLists.txt @ 496:fa3a7ebf0049

Move some common UI code into a library to avoid recompiling for each test
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 25 Apr 2014 10:15:39 +0000
parents f8b480b08532
children 5e77d1c4826c
line wrap: on
line diff
--- a/ui/CMakeLists.txt	Fri Apr 25 10:14:33 2014 +0000
+++ b/ui/CMakeLists.txt	Fri Apr 25 10:15:39 2014 +0000
@@ -12,22 +12,22 @@
 
 find_package(Qt5LinguistTools)
 
-set(CERTIFICATELIST_SOURCES
+# Common code is used in either the client or the administrat
+# application or in unit tests.
+set(UICOMMON_SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/certificatelist.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/certificate.cpp
-)
-
-set(DOWNLOADER_SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/downloader.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/sslconnection.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/sslhelp.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/aboutdialog.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/createcertlistdialog.cpp
 )
 
 set(TRUSTBRIDGE_SOURCES
-    ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/helpdialog.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/aboutdialog.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/statusdialog.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/certificateitemdelegate.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/separatoritemdelegate.cpp
@@ -42,9 +42,6 @@
     ${CMAKE_CURRENT_SOURCE_DIR}/certificatetablemodel.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/certificatetabledelegate.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/createinstallerdialog.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/createcertlistdialog.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/aboutdialog.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/sslhelp.cpp
     ${CERTIFICATELIST_SOURCES}
 )
 
@@ -136,13 +133,17 @@
    add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
 endif()
 
+add_library(ui_common STATIC ${UICOMMON_SOURCES})
+
 target_link_libraries(administrator Qt5::Widgets
+   ui_common
    trustbridge_common
    ${POLARSSL_LIBRARIES}
    ${EXTRA_STATIC_LIBS}
    ${PROFILING_LIBS})
 
 target_link_libraries(trustbridge Qt5::Widgets
+   ui_common
    trustbridge_common
    ${POLARSSL_LIBRARIES}
    ${EXTRA_STATIC_LIBS}

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