annotate ui/CMakeLists.txt @ 46:d28e2624c1d5

Reset connection before the next request. This makes the downloader work for the first simple test.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 17 Mar 2014 10:51:47 +0000
parents c6125d73faf4
children d1aaee32e491
rev   line source
33
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 find_package(Qt5Widgets REQUIRED)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 include_directories(${Qt5Widgets_INCLUDE_DIRS})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 add_definitions(${Qt5Widgets_DEFINITIONS})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 set(CERTIFICATELIST_SOURCES
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 ${CMAKE_CURRENT_SOURCE_DIR}/certificatelist.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8 ${CMAKE_CURRENT_SOURCE_DIR}/certificate.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 ${CMAKE_CURRENT_SOURCE_DIR}/certificate_win.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10 ${CMAKE_CURRENT_SOURCE_DIR}/certificate_linux.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
11 ${CMAKE_SOURCE_DIR}/common/listutil.c
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
12 )
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
13
45
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
14 set(DOWNLOADER_SOURCES
33
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15 ${CMAKE_CURRENT_SOURCE_DIR}/downloader.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 ${CMAKE_CURRENT_SOURCE_DIR}/downloader_win.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 ${CMAKE_CURRENT_SOURCE_DIR}/downloader_linux.cpp
45
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
18 ${CMAKE_CURRENT_SOURCE_DIR}/sslconnection.cpp
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
19 )
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
20
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
21 set(M13UI_SOURCES
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
22 ${CMAKE_CURRENT_SOURCE_DIR}/mainwindow.cpp
33
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
23 ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24 ${CERTIFICATELIST_SOURCES}
45
c6125d73faf4 Move SSLConnection into it's own class
Andre Heinecke <aheinecke@intevation.de>
parents: 39
diff changeset
25 ${DOWNLOADER_SOURCES}
33
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 )
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 # Seperated to make it easier to include the sources in tests
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 set(M13UI_RESOURCES
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30 ${CMAKE_CURRENT_SOURCE_DIR}/icons.qrc
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 ${CMAKE_CURRENT_SOURCE_DIR}/certs.qrc
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32 )
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 if(UNIX)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 # See: https://bugreports.qt-project.org/browse/QTBUG-35918
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
36 # XCB_EXTRA_LIBS should be gotten automatically.
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37 # The following list is taken from the .pri file
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 get_target_property(_loc Qt5::Widgets LOCATION)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 get_filename_component(_qtpath ${_loc} PATH)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
40 set(XCB_EXTRA_LIBS
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41 -L${_qtpath}
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42 -lX11 -lX11-xcb -lXi -lxcb-render-util -lXrender -lSM -lICE -lxcb-render -ldbus-1
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
44 -lxkbcommon -lxcb-shape -lxcb-keysyms -lQt5PlatformSupport
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
45 -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
46 -lz -lm -ldl -lrt -lpthread)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
47
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
48 set(EXTRA_STATIC_LIBS -lz -lpthread -ldl -lpng -ljpeg
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
49 Qt5::QXcbIntegrationPlugin ${XCB_EXTRA_LIBS})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
50
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
51 elseif(WIN32)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
52 get_target_property(_loc Qt5::Widgets LOCATION)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
53 get_filename_component(_qtpath ${_loc} PATH)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
54 set(WINDOWS_EXTRA_LIBS
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
55 -L${_qtpath}
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
56 -lwinspool -lshlwapi -lfreetype -lbz2 -lpng16
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
57 -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
58 -lglu32 -lopengl32 -lgdi32 -ljpeg -lpng -lQt5Core -lole32 -luuid -lws2_32
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
59 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lsicuin -lsicuuc -lsicudt -lpcre16)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
60
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
61 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS} -lwinhttp -lcrypt32)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
62 endif()
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
63
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
64 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
65
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
66 generate_cppcheck(SOURCES ${CINST_SOURCES} ${M13UI_SOURCES} TARGET_NAME m13)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
67 add_dependencies(static_check cppcheck)
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
68
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
69 # Adding resources here in an extra variable to enable reuse of
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
70 # M13UI_SOURCES in the test subdirectory.
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
71 set(M13UI_SOURCES_WITH_RESOURCES ${M13UI_SOURCES})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
72 qt5_add_resources(M13UI_SOURCES_WITH_RESOURCES ${M13UI_RESOURCES})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
73 add_executable(m13ui ${M13UI_SOURCES_WITH_RESOURCES})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
74
39
ee27186fc8e6 Minor: Whitespace change
Andre Heinecke <aheinecke@intevation.de>
parents: 37
diff changeset
75 target_link_libraries(m13ui Qt5::Widgets
33
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
76 ${EXTRA_STATIC_LIBS}
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
77 ${PROFILING_LIBS}
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
78 ${POLARSSL_LIBRARIES})
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
79
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
80 # Tests
25c08d63d2b7 Add CMakeLists in UI
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
81 add_subdirectory(tests)

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