comparison CMakeLists.txt @ 4:9849250f50f2

Start implementation of certificatelist parser
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 11 Feb 2014 16:46:02 +0000
parents 524cd4908656
children 992c0ec57660
comparison
equal deleted inserted replaced
3:b684e25adbbb 4:9849250f50f2
13 add_definitions(${Qt5Widgets_DEFINITIONS}) 13 add_definitions(${Qt5Widgets_DEFINITIONS})
14 14
15 set(M13UI_SOURCES 15 set(M13UI_SOURCES
16 ui/main.cpp 16 ui/main.cpp
17 ui/mainwindow.cpp 17 ui/mainwindow.cpp
18 ui/listutil.c
18 ) 19 )
19 20
20 set(M13UI_RESOURCES 21 set(M13UI_RESOURCES
21 ui/icons.qrc 22 ui/icons.qrc
22 ) 23 )
26 27
27 # Hardening flags 28 # Hardening flags
28 set(HARDENING_FLAGS " -Werror -fstack-protector-all") 29 set(HARDENING_FLAGS " -Werror -fstack-protector-all")
29 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector") 30 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector")
30 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") 31 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4")
31 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv")
32 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O2") 32 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O2")
33 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,-z,relro,-z,now")
34 33
35 if(UNIX) 34 if(UNIX)
36 # See: https://bugreports.qt-project.org/browse/QTBUG-35918 35 # See: https://bugreports.qt-project.org/browse/QTBUG-35918
37 # XCB_EXTRA_LIBS should be gotten automatically. 36 # XCB_EXTRA_LIBS should be gotten automatically.
38 # The following list is taken from the .pri file 37 # The following list is taken from the .pri file
46 -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core 45 -lfreetype -lQt5DBus -lQt5Gui -ljpeg -lpng -lQt5Core
47 -lz -lm -ldl -lrt -lpthread) 46 -lz -lm -ldl -lrt -lpthread)
48 47
49 set(EXTRA_STATIC_LIBS -lz -lpthread -ldl -lpng -ljpeg 48 set(EXTRA_STATIC_LIBS -lz -lpthread -ldl -lpng -ljpeg
50 Qt5::QXcbIntegrationPlugin ${XCB_EXTRA_LIBS}) 49 Qt5::QXcbIntegrationPlugin ${XCB_EXTRA_LIBS})
50
51 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -pie -fPIE -ftrapv")
52 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,-z,relro,-z,now")
51 elseif(WIN32) 53 elseif(WIN32)
52 get_target_property(_loc Qt5::Widgets LOCATION) 54 get_target_property(_loc Qt5::Widgets LOCATION)
53 get_filename_component(_qtpath ${_loc} PATH) 55 get_filename_component(_qtpath ${_loc} PATH)
54 set(WINDOWS_EXTRA_LIBS 56 set(WINDOWS_EXTRA_LIBS
55 -L${_qtpath} 57 -L${_qtpath}
57 -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm 59 -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm
58 -lglu32 -lopengl32 -lgdi32 -ljpeg -lpng -lQt5Core -lole32 -luuid -lws2_32 60 -lglu32 -lopengl32 -lgdi32 -ljpeg -lpng -lQt5Core -lole32 -luuid -lws2_32
59 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lsicuin -lsicuuc -lsicudt -lpcre16) 61 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz -lsicuin -lsicuuc -lsicudt -lpcre16)
60 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS}) 62 set(EXTRA_STATIC_LIBS Qt5::QWindowsIntegrationPlugin ${WINDOWS_EXTRA_LIBS})
61 63
62 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,dynamicbase -Wl,nxcompat") 64 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat")
63 endif() 65 endif()
64 66
65 qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES}) 67 qt5_add_resources(M13UI_SOURCES ${M13UI_RESOURCES})
66 68
67 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") 69 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
68 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") 70 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}")
71 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_WARN_FLAGS} ${HARDENING_FLAGS}")
69 72
70 add_executable(m13ui ${M13UI_SOURCES}) 73 add_executable(m13ui ${M13UI_SOURCES})
71 74
72 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS}) 75 target_link_libraries(m13ui Qt5::Widgets ${EXTRA_STATIC_LIBS})
73 76

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