changeset 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 0172740f5c6e
children 7dfa4555fb89
files common/events.mc ui/CMakeLists.txt
diffstat 2 files changed, 48 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/events.mc	Thu Jun 19 14:43:53 2014 +0200
@@ -0,0 +1,30 @@
+; /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
+; Software engineering by Intevation GmbH
+;
+; This file is Free Software under the GNU GPL (v>=2)
+; and comes with ABSOLUTELY NO WARRANTY!
+; See LICENSE.txt for details. */
+
+MessageIdTypedef=DWORD
+
+SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
+Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
+Warning=0x2:STATUS_SEVERITY_WARNING
+Error=0x3:STATUS_SEVERITY_ERROR
+)
+
+LanguageNames=(English=0x409:MSG00409)
+LanguageNames=(German=0x407:MSG00407)
+
+;/* THE MESSAGES */
+
+MessageId=0x1
+Severity=Informational
+Facility=Application
+SymbolicName=MSG_DEFAULT_INFO
+Language=English
+Test %0 blub
+.
+Language=German
+Schlaand Schlaand %0 blubs
+.
--- 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/