-
Notifications
You must be signed in to change notification settings - Fork 68
/
CMakeLists.txt
55 lines (42 loc) · 1.51 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.16)
# Adapt compiler flags if using Conda compiler packages. Before project so they are not modified.
include(cmake/Conda.cmake)
# Read the version from file
include(cmake/Version.cmake)
read_version("VERSION" Ecole_VERSION)
# Set default parameters. Assumes Ecole user,
include(cmake/DefaultSettings.cmake)
project(
Ecole
VERSION "${Ecole_VERSION}"
LANGUAGES CXX
DESCRIPTION "Extensible Combinatorial Optimization Learning Environments"
)
# Add option to enable interprocedural optimization
include(cmake/InterproceduralOptimization.cmake)
# Define a target Ecole::warnings with all compiler warnings.
include(cmake/CompilerWarnings.cmake)
# Define a target Ecole::sanitizers with enabled sanitizers.
include(cmake/Sanitizers.cmake)
# Define a target Ecole::coverage with coverage options.
include(cmake/Coverage.cmake)
# Utilities to automatically download missing dependencies
include(cmake/DependenciesResolver.cmake)
# Adapt which Python is found
include(cmake/Python.cmake)
# Enable CTest for registering tests
include(CTest)
# Ecole library
if(ECOLE_BUILD_LIB)
# Build the Ecole library
add_subdirectory(libecole)
else()
# Find the Ecole library of same version already installed
option(ECOLE_DOWNLOAD_DEPENDENCIES "Download the static and header libraries used in Ecole public interface" ON)
find_package(Ecole ${Ecole_VERSION} EXACT REQUIRED)
endif()
# Ecole Python extension
if(ECOLE_BUILD_PY_EXT)
add_subdirectory(python/extension-helper)
add_subdirectory(python/ecole)
endif()