-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
58 lines (45 loc) · 1.53 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
56
57
58
cmake_minimum_required(VERSION 3.13)
# Project properties
set(CLARABEL_PROJECT_VERSION 0.9.0)
project(Clarabel VERSION ${CLARABEL_PROJECT_VERSION})
# Specify the default C++ standard applied to all targets
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Specify the default C standard applied to all targets
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)
#----------------------------------------------
# Clarabel feature configuration
#----------------------------------------------
set(CLARABEL_FEATURE_SDP "none" CACHE STRING "Package for SDP to be selected")
set_property(CACHE CLARABEL_FEATURE_SDP PROPERTY STRINGS
none
sdp-accelerate
sdp-netlib
sdp-openblas
sdp-mkl
sdp-r
)
option(CLARABEL_FEATURE_SERDE "Enable clarabel `serde` option " OFF)
option(CLARABEL_FEATURE_FAER_SPARSE "Enable `faer-sparse` option" OFF)
option(CLARABEL_FEATURE_SERDE "Enable `faer-sparse` option" OFF)
#----------------------------------------------
#----------------------------------------------
# Get dependencies
# Eigen3
if (NOT TARGET Eigen3::Eigen)
find_package(Eigen3 CONFIG REQUIRED)
message(STATUS "Clarabel.cpp: `Eigen3` package found.")
else()
message(STATUS "Clarabel.cpp: `Eigen3` package already exists.")
endif()
# Build the Rust library
add_subdirectory(rust_wrapper)
# Add other subdirectories
add_subdirectory(examples)
# Add tests
option(CLARABEL_BUILD_TESTS "Build the unit tests for Clarabel.cpp" false)
if(CLARABEL_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()