changeset 561:4433f9d57f6d

Add resources to main. You can not add resources to a library
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 22 May 2014 13:23:07 +0000
parents 3af16cbc961d
children ccdc4c6b97ce
files ui/CMakeLists.txt
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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

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