comparison ui/CMakeLists.txt @ 620:bc02ee484067

Add dummy logging with ressourced messages. The hack in icon.rc is necessary as with mingw 3.0 there appears to be a problem to include multiple resources after another. The data is included but the sections are not detected correctly in windows. Combining them in a single resource fixes this.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 19 Jun 2014 17:48:10 +0200
parents 63a128400bf3
children 5d6e86cf3b87
comparison
equal deleted inserted replaced
619:e780405f8150 620:bc02ee484067
107 add_dependencies(static_check custom_cppcheck) 107 add_dependencies(static_check custom_cppcheck)
108 108
109 # Adding resources here in an extra variable to enable reuse of 109 # Adding resources here in an extra variable to enable reuse of
110 # TRUSTBRIDGE_SOURCES in the test subdirectory. 110 # TRUSTBRIDGE_SOURCES in the test subdirectory.
111 set(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp 111 set(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
112 ${CMAKE_CURRENT_SOURCE_DIR}/img/icon.rc) 112 ${CMAKE_CURRENT_SOURCE_DIR}/img/icon.rc)
113 qt5_add_resources(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES}) 113 qt5_add_resources(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${TRUSTBRIDGE_RESOURCES})
114 114
115 set(ADMINISTRATOR_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp) 115 set(ADMINISTRATOR_MAIN_WITH_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/administrator.cpp)
116 qt5_add_resources(ADMINISTRATOR_MAIN_WITH_RESOURCES ${ADMINISTRATOR_RESOURCES}) 116 qt5_add_resources(ADMINISTRATOR_MAIN_WITH_RESOURCES ${ADMINISTRATOR_RESOURCES})
117 117
131 add_custom_command( 131 add_custom_command(
132 OUTPUT ${CMAKE_BINARY_DIR}/common/events.h 132 OUTPUT ${CMAKE_BINARY_DIR}/common/events.h
133 ${CMAKE_BINARY_DIR}/common/events.rc 133 ${CMAKE_BINARY_DIR}/common/events.rc
134 ${CMAKE_BINARY_DIR}/common/MSG00407.bin 134 ${CMAKE_BINARY_DIR}/common/MSG00407.bin
135 ${CMAKE_BINARY_DIR}/common/MSG00409.bin 135 ${CMAKE_BINARY_DIR}/common/MSG00409.bin
136 COMMAND ${MC_COMPILER} ${CMAKE_SOURCE_DIR}/common/events.mc -r ${CMAKE_BINARY_DIR}/common -h ${CMAKE_BINARY_DIR}/common 136 COMMAND ${MC_COMPILER} ${CMAKE_SOURCE_DIR}/common/events.mc -a -U -r ${CMAKE_BINARY_DIR}/common -h ${CMAKE_BINARY_DIR}/common
137 DEPENDS ${CMAKE_SOURCE_DIR}/common/events.mc) 137 DEPENDS ${CMAKE_SOURCE_DIR}/common/events.mc)
138 set(EXTRA_SOURCES ${CMAKE_BINARY_DIR}/common/events.h) 138 add_custom_target(create_events DEPENDS ${CMAKE_BINARY_DIR}/common/events.rc)
139 set(TRUSTBRIDGE_MAIN_WITH_RESOURCES ${TRUSTBRIDGE_MAIN_WITH_RESOURCES} ${CMAKE_BINARY_DIR}/common/events.rc)
140 endif() 139 endif()
141 140
142 if(Qt5LinguistTools_FOUND) 141 if(Qt5LinguistTools_FOUND)
143 # Include translation as a resource 142 # Include translation as a resource
144 # This works in the source directory to enable the rcc dependencies to be found 143 # This works in the source directory to enable the rcc dependencies to be found
174 add_executable(trustbridge 173 add_executable(trustbridge
175 ${_add_executable_params} 174 ${_add_executable_params}
176 ${TRUSTBRIDGE_MAIN_WITH_RESOURCES}) 175 ${TRUSTBRIDGE_MAIN_WITH_RESOURCES})
177 endif() 176 endif()
178 177
178 if (WIN32)
179 add_dependencies(trustbridge create_events)
180 endif()
181
179 add_library(ui_common STATIC ${UICOMMON_SOURCES}) 182 add_library(ui_common STATIC ${UICOMMON_SOURCES})
180 add_library(tbadminlib STATIC ${ADMINISTRATOR_SOURCES}) 183 add_library(tbadminlib STATIC ${ADMINISTRATOR_SOURCES})
181 add_library(tblib STATIC ${TRUSTBRIDGE_SOURCES}) 184 add_library(tblib STATIC ${TRUSTBRIDGE_SOURCES})
182 185
183 target_link_libraries(trustbridge-admin 186 target_link_libraries(trustbridge-admin

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