comparison ui/CMakeLists.txt @ 514:ce8325686b09

Use Win32 linker flags on Windows
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 28 Apr 2014 13:59:55 +0000
parents 5e77d1c4826c
children 09077eca0b0d
comparison
equal deleted inserted replaced
513:5e2af38266f6 514:ce8325686b09
109 qt5_add_resources(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES}) 109 qt5_add_resources(TRUSTBRIDGE_SOURCES_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES})
110 110
111 set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES}) 111 set(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_SOURCES})
112 qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES}) 112 qt5_add_resources(ADMINSTRATOR_SOURCES_WITH_RESOURCES ${ADMINSTRATOR_RESOURCES})
113 113
114 if(WIN32)
115 # This option causes cmake to use the appropiate liker flags to hide
116 # the console Window on Windows
117 set (_add_executable_params WIN32)
118 endif()
119
114 if(Qt5LinguistTools_FOUND) 120 if(Qt5LinguistTools_FOUND)
115 # Include translation as a resource 121 # Include translation as a resource
116 # This works in the source directory to enable the rcc dependencies to be found 122 # This works in the source directory to enable the rcc dependencies to be found
117 # and it also updates the currently available localization. 123 # and it also updates the currently available localization.
118 # This would probably be better placed in a macro 124 # This would probably be better placed in a macro
119 configure_file(l10n/administrator.qrc.in administrator.qrc) 125 configure_file(l10n/administrator.qrc.in administrator.qrc)
120 qt5_add_resources(ADMINISTRATOR_L10N ${CMAKE_CURRENT_BINARY_DIR}/administrator.qrc) 126 qt5_add_resources(ADMINISTRATOR_L10N ${CMAKE_CURRENT_BINARY_DIR}/administrator.qrc)
121 qt5_create_translation(ADMINISTRATOR_TRANSLATION ${ADMINSTRATOR_SOURCES_WITH_RESOURCES} 127 qt5_create_translation(ADMINISTRATOR_TRANSLATION ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
122 ${CMAKE_CURRENT_SOURCE_DIR}/l10n/administrator_de_DE.ts) 128 ${CMAKE_CURRENT_SOURCE_DIR}/l10n/administrator_de_DE.ts)
123 add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES} 129 add_executable(administrator
130 ${_add_executable_params}
131 ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}
124 ${ADMINISTRATOR_L10N} 132 ${ADMINISTRATOR_L10N}
125 ${ADMINISTRATOR_TRANSLATION} 133 ${ADMINISTRATOR_TRANSLATION}
126 ) 134 )
127 135
128 configure_file(l10n/trustbridge.qrc.in trustbridge.qrc) 136 configure_file(l10n/trustbridge.qrc.in trustbridge.qrc)
129 qt5_add_resources(TRUSTBRIDGE_L10N ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.qrc) 137 qt5_add_resources(TRUSTBRIDGE_L10N ${CMAKE_CURRENT_BINARY_DIR}/trustbridge.qrc)
130 qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES} 138 qt5_create_translation(TRUSTBRIDGE_TRANSLATION ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
131 ${CMAKE_CURRENT_SOURCE_DIR}/l10n/trustbridge_de_DE.ts) 139 ${CMAKE_CURRENT_SOURCE_DIR}/l10n/trustbridge_de_DE.ts)
132 add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES} 140 add_executable(trustbridge
141 ${_add_executable_params}
142 ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}
133 ${TRUSTBRIDGE_L10N} 143 ${TRUSTBRIDGE_L10N}
134 ${TRUSTBRIDGE_TRANSLATION} 144 ${TRUSTBRIDGE_TRANSLATION}
135 ) 145 )
136 146
137 else() 147 else()
138 message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.") 148 message (STATUS "WARNING: Could not find qt linguist tools. Translation will not be included.")
139 add_executable(administrator ${ADMINSTRATOR_SOURCES_WITH_RESOURCES}) 149 add_executable(administrator
140 add_executable(trustbridge ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES}) 150 ${_add_executable_params}
151 ${ADMINSTRATOR_SOURCES_WITH_RESOURCES})
152 add_executable(trustbridge
153 ${_add_executable_params}
154 ${TRUSTBRIDGE_SOURCES_WITH_RESOURCES})
141 endif() 155 endif()
142 156
143 add_library(ui_common STATIC ${UICOMMON_SOURCES}) 157 add_library(ui_common STATIC ${UICOMMON_SOURCES})
144 158
145 target_link_libraries(administrator Qt5::Widgets 159 target_link_libraries(administrator Qt5::Widgets

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