Mercurial > retraceit
view CMakeLists.txt @ 105:ddd82d6bfef7
Added tag 1.3 for changeset 4302ca793c5a
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Fri, 18 Nov 2016 12:51:05 +0100 |
parents | 098a10fc2e83 |
children | 32dd6ea6a582 |
line wrap: on
line source
# Copyright (C) 2015 by ETH Zürich # Software engineering by Intevation GmbH # # This file is Free Software under the GNU GPL (v>=2) # and comes with ABSOLUTELY NO WARRANTY! # See LICENSE.txt for details. cmake_minimum_required(VERSION 2.8.8) project(retraceit) ### Generic Setup #Old qtmain linking behavior to be compatible with cmake versions < 2.8.11 if(POLICY CMP0020) cmake_policy(SET CMP0020 OLD) endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") include(HGVersion) if(HG_REVISION) If(HG_REVISION_DIST STREQUAL "0") add_definitions(-DIS_TAG_BUILD) endif() set(PROJECT_VERSION ${HG_REVISION}) else() set(PROJECT_VERSION unknown) endif() add_definitions(-DVERSION="${PROJECT_VERSION}") add_definitions(-DAPPNAME="${PROJECT_NAME}") find_package(Qt5Widgets) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) ### Hardening flags if(NOT APPLE) set(HARDENING_FLAGS " -Wall -s -fstack-protector-all -fno-exceptions") set(HARDENING_FLAGS " ${HARDENING_FLAGS} -Wstack-protector") set(HARDENING_FLAGS " ${HARDENING_FLAGS} --param ssp-buffer-size=4") set(HARDENING_FLAGS " ${HARDENING_FLAGS} -D_FORTIFY_SOURCE=2 -O0") endif(NOT APPLE) if(WIN32) add_definitions(-D_WIN32_WINNT=0x0600) # Windows vista add_definitions(-DWINVER=0x0600) add_definitions(-DUNICODE -D_UNICODE) add_definitions(-DMINGW_HAS_SECURE_API) # for _s functions endif(WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HARDENING_FLAGS}") # Cmake does not correctly identify gcc windres when cross compiling # making this line neccessary to set the correct flags for it. # See: http://public.kitware.com/Bug/view.php?id=11773 SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -Ocoff <SOURCE> <OBJECT>") #add_subdirectory(img) ### Include the actual source directories add_subdirectory(src) configure_file (doc/Doxyfile.in doc/Doxyfile) add_subdirectory(doc)