comparison CMakeLists.txt @ 0:cb0cde2c5eb9

Initial commit. Basically a Hello World with a Tray Icon.
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 07 Feb 2014 11:41:15 +0000
parents
children 524cd4908656
comparison
equal deleted inserted replaced
-1:000000000000 0:cb0cde2c5eb9
1 cmake_minimum_required(VERSION 2.8.8)
2 project(m13)
3
4 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
5
6 # Use cmake's automoc and make sure the generated files are included
7 set(CMAKE_AUTOMOC ON)
8 set(CMAKE_INCLUDE_CURRENT_DIR ON)
9
10 find_package(Qt5Widgets REQUIRED)
11
12 include_directories(${Qt5Widgets_INCLUDE_DIRS})
13 add_definitions(${Qt5Widgets_DEFINITIONS})
14 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
15
16 set(M13UI_SOURCES
17 ui/main.cpp
18 ui/mainwindow.cpp
19 )
20
21 set(M13UI_RESOURCES
22 ui/icons.qrc
23 )
24
25 if(UNIX)
26 # See: https://bugreports.qt-project.org/browse/QTBUG-35918
27 # XCB_EXTRA_LIBS should be gotten automatically.
28 # The following list is taken from the .pri file
29 get_target_property(_loc Qt5::Widgets LOCATION)
30 get_filename_component(_qtpath ${_loc} PATH)
31 set(XCB_EXTRA_LIBS
32 -L${_qtpath}
33 -lX11 -lX11-xcb -lXi -lxcb-render-util -lXrender -lSM -lICE -lxcb-render -ldbus-1
34 -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr
35 -lxcb-shape -lxcb-keysyms -lQt5PlatformSupport
36 -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core
37 -lz -lm -ldl -lrt -lpthread)
38
39 set(EXTRA_STATIC_LIBS -lz -lpthread -ldl -lpng -ljpeg
40 Qt5::QXcbIntegrationPlugin ${XCB_EXTRA_LIBS})
41 elseif(WIN32)
42 get_target_property(_loc Qt5::Widgets LOCATION)
43 get_filename_component(_qtpath ${_loc} PATH)
44 set(WINDOWS_EXTRA_LIBS
45 -L${_qtpath}
46 -lwinspool -lshlwapi -lfreetype -lbz2 -lpng16
47 -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm
48 -lglu32 -lopengl32 -lgdi32 -ljpeg -lpng -lQt5Core -lole32 -luuid -lws2_32
49 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lsicuin -lsicuuc -lsicudt -lpcre16)
50 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS})
51 endif()
52
53 qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES})
54
55 add_executable(m13ui ${M13UI_SOURCES})
56
57 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS})

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