[PATCH 1 of 4] Add message compiler logic and messages file

Wald Commits scm-commit at wald.intevation.org
Thu Jun 19 17:48:17 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1403181833 -7200
# Node ID 63a128400bf332a646979848cbc81ad937e75551
# Parent  0172740f5c6e4e5ae34e2d6918f33fcc1f67b479
Add message compiler logic and messages file

diff -r 0172740f5c6e -r 63a128400bf3 common/events.mc
--- /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
+.
diff -r 0172740f5c6e -r 63a128400bf3 ui/CMakeLists.txt
--- 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)


More information about the Trustbridge-commits mailing list