diff ui/CMakeLists.txt @ 617:63a128400bf3

Add message compiler logic and messages file
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 19 Jun 2014 14:43:53 +0200
parents 292c590ba9cb
children bc02ee484067
line wrap: on
line diff
--- a/ui/CMakeLists.txt	Thu Jun 19 12:06:47 2014 +0200
+++ b/ui/CMakeLists.txt	Thu Jun 19 14:43:53 2014 +0200
@@ -119,6 +119,24 @@
    # This option causes cmake to use the appropiate liker flags to hide
    # the console Window on Windows
    set (_add_executable_params WIN32)
+
+   # Add the event messages
+   if (MINGW)
+      STRING(REGEX REPLACE "windres" "windmc" MC_COMPILER ${CMAKE_RC_COMPILER})
+   else()
+      # untested
+      set(MC_COMPILER "mc.exe")
+   endif()
+
+   add_custom_command(
+       OUTPUT ${CMAKE_BINARY_DIR}/common/events.h
+              ${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
+       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)
 endif()
 
 if(Qt5LinguistTools_FOUND)

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