-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
71 lines (54 loc) · 2.21 KB
/
Copy pathCMakeLists.txt
File metadata and controls
71 lines (54 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ---------------------------------------------------------------------
#
# Copyright (C) 2019 by the SampleFlow authors.
#
# This file is part of the SampleFlow library.
#
# The SampleFlow library is free software; you can use it, redistribute
# it, and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# The full text of the license can be found in the file LICENSE.md at
# the top level directory of SampleFlow.
#
# ---------------------------------------------------------------------
CMAKE_MINIMUM_REQUIRED (VERSION 3.1)
PROJECT (SampleFlow CXX)
#########################################
### Set up compiler flags and input paths
# Compile everything with C++11 and with debug flags
SET (CMAKE_CXX_STANDARD 11)
SET (CMAKE_CXX_STANDARD_REQUIRED ON)
SET (CMAKE_CXX_EXTENSIONS OFF)
ADD_DEFINITIONS("-ggdb")
# Also make sure we link with the threads library in question
FIND_PACKAGE (Threads)
# Source files need to know where headers are:
INCLUDE_DIRECTORIES(include ${CMAKE_BINARY_DIR}/include)
# Set paths correctly to take BOOST from wherever it is
# installed on the current system
FIND_PACKAGE(Boost REQUIRED COMPONENTS system)
INCLUDE(CheckIncludeFileCXX)
MESSAGE(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
SET(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIRS})
CHECK_INCLUDE_FILE_CXX("boost/signals2.hpp" SF_HAVE_SIGNALS2)
IF (NOT SF_HAVE_SIGNALS2)
MESSAGE(FATAL_ERROR "Could not find boost/signals2.hpp")
ENDIF()
CHECK_INCLUDE_FILE_CXX("boost/numeric/ublas/matrix.hpp" SF_HAVE_MATRIX)
IF (NOT SF_HAVE_MATRIX)
MESSAGE(FATAL_ERROR "Could not find boost/numeric/ublas/matrix.hpp")
ENDIF()
#########################################
### Provide "indent" target for indenting all headers and source files
ADD_CUSTOM_TARGET(indent
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ./doc/indent
COMMENT "Indenting all SampleFlow header and source files..."
)
#########################################
### Next, set up the testsuite, and the documentation generation machinery
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(doc)