[PATCH] Move UI code into librarys to speed up build of unit tests
Wald Commits
scm-commit at wald.intevation.org
Thu May 22 12:57:09 CEST 2014
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1400756225 0
# Node ID 3af16cbc961d98b23deabb03396314958abd1e93
# Parent dd8a295d5b4d33a282ec5f8cdcb71cbb56ae54ab
Move UI code into librarys to speed up build of unit tests
diff -r dd8a295d5b4d -r 3af16cbc961d ui/CMakeLists.txt
--- 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}
diff -r dd8a295d5b4d -r 3af16cbc961d ui/tests/CMakeLists.txt
--- 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")
More information about the Trustbridge-commits
mailing list