[PATCH 4 of 7] Use Win32 linker flags on Windows

Wald Commits scm-commit at wald.intevation.org
Mon Apr 28 19:15:56 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1398693595 0
# Node ID ce8325686b09815bc893342b9421b47d9123b964
# Parent  5e2af38266f688e7b014acf7496509ec440372dd
Use Win32 linker flags on Windows

diff -r 5e2af38266f6 -r ce8325686b09 ui/CMakeLists.txt
--- a/ui/CMakeLists.txt	Mon Apr 28 13:59:21 2014 +0000
+++ b/ui/CMakeLists.txt	Mon Apr 28 13:59:55 2014 +0000
@@ -111,6 +111,12 @@
 set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES})
 qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES})
 
+if(WIN32)
+   # This option causes cmake to use the appropiate liker flags to hide
+   # the console Window on Windows
+   set (_add_executable_params WIN32)
+endif()
+
 if(Qt5LinguistTools_FOUND)
    # Include translation as a resource
    # This works in the source directory to enable the rcc dependencies to be found
@@ -120,7 +126,9 @@
    qt5_add_resources(ADMINISTRATOR_L10N ${CMAKE_CURRENT_BINARY_DIR}/administrator.qrc)
    qt5_create_translation(ADMINISTRATOR_TRANSLATION ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
       ${CMAKE_CURRENT_SOURCE_DIR}/l10n/administrator_de_DE.ts)
-   add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
+   add_executable(administrator
+      ${_add_executable_params}
+      ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
       ${ADMINISTRATOR_L10N}
       ${ADMINISTRATOR_TRANSLATION}
       )
@@ -129,15 +137,21 @@
    qt5_add_resources(TRUSTBRIDGE_L10N ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.qrc)
    qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
       ${CMAKE_CURRENT_SOURCE_DIR}/l10n/trustbridge_de_DE.ts)
-   add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
+   add_executable(trustbridge
+      ${_add_executable_params}
+      ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
       ${TRUSTBRIDGE_L10N}
       ${TRUSTBRIDGE_TRANSLATION}
       )
 
 else()
    message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.")
-   add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
-   add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
+   add_executable(administrator
+      ${_add_executable_params}
+      ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
+   add_executable(trustbridge
+      ${_add_executable_params}
+      ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
 endif()
 
 add_library(ui_common STATIC ${UICOMMON_SOURCES})


More information about the Trustbridge-commits mailing list