diff ui/CMakeLists.txt @ 620:bc02ee484067

Add dummy logging with ressourced messages. The hack in icon.rc is necessary as with mingw 3.0 there appears to be a problem to include multiple resources after another. The data is included but the sections are not detected correctly in windows. Combining them in a single resource fixes this.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 19 Jun 2014 17:48:10 +0200
parents 63a128400bf3
children 5d6e86cf3b87
line wrap: on
line diff
--- a/ui/CMakeLists.txt	Thu Jun 19 17:45:06 2014 +0200
+++ b/ui/CMakeLists.txt	Thu Jun 19 17:48:10 2014 +0200
@@ -109,7 +109,7 @@
 # Adding resources here in an extra variable to enable reuse of
 # TRUSTBRIDGE_SOURCES in the test subdirectory.
 set(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/img/icon.rc)
+   ${CMAKE_CURRENT_SOURCE_DIR}/img/icon.rc)
 qt5_add_resources(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES})
 
 set(ADMINISTRATOR_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp)
@@ -133,10 +133,9 @@
               ${CMAKE_BINARY_DIR}/common/events.rc
               ${CMAKE_BINARY_DIR}/common/MSG00407.bin
               ${CMAKE_BINARY_DIR}/common/MSG00409.bin
-       COMMAND ${MC_COMPILER} ${CMAKE_SOURCE_DIR}/common/events.mc -r ${CMAKE_BINARY_DIR}/common -h ${CMAKE_BINARY_DIR}/common
+       COMMAND ${MC_COMPILER} ${CMAKE_SOURCE_DIR}/common/events.mc -a -U -r ${CMAKE_BINARY_DIR}/common -h ${CMAKE_BINARY_DIR}/common
        DEPENDS ${CMAKE_SOURCE_DIR}/common/events.mc)
-   set(EXTRA_SOURCES ${CMAKE_BINARY_DIR}/common/events.h)
-   set(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${TRUSTBRIDGE_MAIN_WITH_RESOURCES} ${CMAKE_BINARY_DIR}/common/events.rc)
+    add_custom_target(create_events DEPENDS ${CMAKE_BINARY_DIR}/common/events.rc)
 endif()
 
 if(Qt5LinguistTools_FOUND)
@@ -176,6 +175,10 @@
       ${TRUSTBRIDGE_MAIN_WITH_RESOURCES})
 endif()
 
+if (WIN32)
+   add_dependencies(trustbridge create_events)
+endif()
+
 add_library(ui_common STATIC ${UICOMMON_SOURCES})
 add_library(tbadminlib STATIC ${ADMINISTRATOR_SOURCES})
 add_library(tblib STATIC ${TRUSTBRIDGE_SOURCES})

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