[PATCH] Add resources to main

Wald Commits scm-commit at wald.intevation.org
Thu May 22 15:23:09 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1400764987 0
# Node ID 4433f9d57f6dd7a9ff1250a247925f01bebbafc9
# Parent  3af16cbc961d98b23deabb03396314958abd1e93
Add resources to main.

    You can not add resources to a library

diff -r 3af16cbc961d -r 4433f9d57f6d ui/CMakeLists.txt
--- a/ui/CMakeLists.txt	Thu May 22 10:57:05 2014 +0000
+++ b/ui/CMakeLists.txt	Thu May 22 13:23:07 2014 +0000
@@ -103,11 +103,11 @@
 
 # Adding resources here in an extra variable to enable reuse of
 # TRUSTBRIDGE_SOURCES in the test subdirectory.
-set(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_SOURCES})
-qt5_add_resources(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES})
+set(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
+qt5_add_resources(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES})
 
-set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES})
-qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES})
+set(ADMINSTRATOR_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp)
+qt5_add_resources(ADMINSTRATOR_MAIN_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES})
 
 if(WIN32)
    # This option causes cmake to use the appropiate liker flags to hide
@@ -122,22 +122,22 @@
    # This would probably be better placed in a macro
    configure_file(l10n/administrator.qrc.in administrator.qrc)
    qt5_add_resources(ADMINISTRATOR_L10N ${CMAKE_CURRENT_BINARY_DIR}/administrator.qrc)
-   qt5_create_translation(ADMINISTRATOR_TRANSLATION ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
+   qt5_create_translation(ADMINISTRATOR_TRANSLATION ${ADMINSTRATOR_SOURCES}
       ${CMAKE_CURRENT_SOURCE_DIR}/l10n/administrator_de_DE.ts)
    add_executable(trustbridge-admin
       ${_add_executable_params}
-      ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp
+      ${ADMINSTRATOR_MAIN_WITH_RESOURCES}
       ${ADMINISTRATOR_L10N}
       ${ADMINISTRATOR_TRANSLATION}
       )
 
    configure_file(l10n/trustbridge.qrc.in trustbridge.qrc)
    qt5_add_resources(TRUSTBRIDGE_L10N ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.qrc)
-   qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
+   qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES}
       ${CMAKE_CURRENT_SOURCE_DIR}/l10n/trustbridge_de_DE.ts)
    add_executable(trustbridge
       ${_add_executable_params}
-      ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
+      ${TRUSTBRIDGE_MAIN_WITH_RESOURCES}
       ${TRUSTBRIDGE_L10N}
       ${TRUSTBRIDGE_TRANSLATION}
       )
@@ -146,15 +146,15 @@
    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_MAIN_WITH_RESOURCES})
    add_executable(trustbridge
       ${_add_executable_params}
-      ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
+      ${TRUSTBRIDGE_MAIN_WITH_RESOURCES})
 endif()
 
 add_library(ui_common STATIC ${UICOMMON_SOURCES})
-add_library(tbadminlib STATIC ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
-add_library(tblib STATIC ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
+add_library(tbadminlib STATIC ${ADMINSTRATOR_SOURCES})
+add_library(tblib STATIC ${TRUSTBRIDGE_SOURCES})
 
 target_link_libraries(trustbridge-admin
    tbadminlib


More information about the Trustbridge-commits mailing list