The TS-GitLab will have to shut down towards the end of the year — please think about migrating your projects to GitLab.com or GitHub.
(This is still a very early message, meant to keep you informed. There will be more urgent ones in the future.)

CMakeLists.txt 1.32 KB
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1 2 3
cmake_minimum_required(VERSION 2.8.12)
project(dorie CXX)

Dion Haefner's avatar
Dion Haefner committed
4 5 6 7 8 9 10 11 12 13 14 15
# set build type
if(NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE "Release")
endif()

string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
if(CMAKE_BUILD_TYPE_UPPER MATCHES DEBUG)
	set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")

# 
Dion Haefner's avatar
Dion Haefner committed
16 17 18 19 20 21
if(NOT (dune-common_DIR OR dune-common_ROOT OR
      "${CMAKE_PREFIX_PATH}" MATCHES ".*dune-common.*"))
    string(REPLACE  ${CMAKE_PROJECT_NAME} dune-common dune-common_DIR
      ${PROJECT_BINARY_DIR})
endif()

Dion Haefner's avatar
Dion Haefner committed
22
# find dune-common and set the module path
Dion Haefner's avatar
Dion Haefner committed
23 24 25 26
find_package(dune-common REQUIRED)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
  ${dune-common_MODULE_PATH})

Dion Haefner's avatar
Dion Haefner committed
27
# include the dune macros
Dion Haefner's avatar
Dion Haefner committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
include(DuneMacros)

# start a dune project with information from dune.module
dune_project()
dune_enable_all_packages()
dune_require_cxx_standard(MODULE "dorie" VERSION 14)

# add subdirectories
add_subdirectory("bin")
add_subdirectory("m4")
add_subdirectory("dune")
add_subdirectory("python")
add_subdirectory("doc")
if(dune-testtools_FOUND)
    add_subdirectory("testing")
endif()
add_subdirectory("cmake/modules")
                  
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
48

Dion Haefner's avatar
Dion Haefner committed
49
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")