Mercurial > clickerconvert
annotate CMakeLists.txt @ 98:dd322a4b90d9 tip
Fix resource finding and installation
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 07 Oct 2016 12:44:50 +0200 |
parents | a43d8cf2fa95 |
children |
rev | line source |
---|---|
0
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
1 # Copyright (C) 2016 by ETH Zürich |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
2 # Software engineering by Intevation GmbH |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
3 # |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
4 # This file is Free Software under the GNU GPL (v>=2) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
5 # and comes with ABSOLUTELY NO WARRANTY! |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
6 # See LICENSE.txt for details. |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
7 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
8 cmake_minimum_required(VERSION 2.8.8) |
44
aa47b8e4f807
Rename to EduExportConvert
Andre Heinecke <andre.heinecke@intevation.de>
parents:
22
diff
changeset
|
9 project(eduexportconvert) |
53
a43d8cf2fa95
Various fixes and improvements. Fix windows packaging.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
44
diff
changeset
|
10 set(PRETTY_NAME EduExportConverter) |
0
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
11 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
12 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
13 ### Generic Setup |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
14 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
15 #Old qtmain linking behavior to be compatible with cmake versions < 2.8.11 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
16 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
17 if(POLICY CMP0020) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
18 cmake_policy(SET CMP0020 OLD) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
19 endif() |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
20 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
21 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
22 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
23 include(HGVersion) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
24 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
25 if(HG_REVISION) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
26 If(HG_REVISION_DIST STREQUAL "0") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
27 add_definitions(-DIS_TAG_BUILD) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
28 endif() |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
29 set(PROJECT_VERSION ${HG_REVISION}) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
30 else() |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
31 set(PROJECT_VERSION unknown) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
32 endif() |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
33 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
34 add_definitions(-DVERSION="${PROJECT_VERSION}") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
35 add_definitions(-DAPPNAME="${PROJECT_NAME}") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
36 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
37 find_package(Qt5Widgets) |
22
e8320104979d
Depend on Printsupport use c++11
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
38 find_package(Qt5PrintSupport) |
0
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
39 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
40 set(CMAKE_AUTOMOC ON) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
41 set(CMAKE_INCLUDE_CURRENT_DIR ON) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
42 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
43 ### Hardening flags |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
44 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
45 if(NOT APPLE) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
46 set(HARDENING_FLAGS " -Wall -s -fstack-protector-all -fno-exceptions") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
47 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
48 set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
49 set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
50 endif(NOT APPLE) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
51 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
52 if(WIN32) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
53 add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
54 add_definitions(-DWINVER=0x0600) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
55 add_definitions(-DUNICODE -D_UNICODE) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
56 add_definitions(-DMINGW_HAS_SECURE_API) # for _s functions |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
57 endif(WIN32) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
58 |
22
e8320104979d
Depend on Printsupport use c++11
Andre Heinecke <andre.heinecke@intevation.de>
parents:
0
diff
changeset
|
59 set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") |
0
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
60 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
61 # Cmake does not correctly identify gcc windres when cross compiling |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
62 # making this line neccessary to set the correct flags for it. |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
63 # See: http://public.kitware.com/Bug/view.php?id=11773 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
64 SET(CMAKE_RC_COMPILE_OBJECT |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
65 "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -Ocoff <SOURCE> <OBJECT>") |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
66 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
67 #add_subdirectory(img) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
68 ### Include the actual source directories |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
69 add_subdirectory(src) |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
70 |
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
71 configure_file (doc/Doxyfile.in doc/Doxyfile) |
53
a43d8cf2fa95
Various fixes and improvements. Fix windows packaging.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
44
diff
changeset
|
72 configure_file (packaging/win-createpackage.sh.in packaging/win-createpackage.sh) |
0
49cd5cc0b072
Initial commit of project template (based on RetraceIT)
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff
changeset
|
73 add_subdirectory(doc) |