forked from oxfordcontrol/Clarabel.cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
65 lines (51 loc) · 1.73 KB
/
CMakeLists.txt
File metadata and controls
65 lines (51 loc) · 1.73 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
cmake_minimum_required(VERSION 3.13)
# Project properties
set(CLARABEL_PROJECT_VERSION 0.5.1)
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)
# Include directories
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/c)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# SDP 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
)
# 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
option(CLARABEL_BUILD_EXAMPLES "Build examples for Clarabel.cpp" true)
if(CLARABEL_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Add tests
option(CLARABEL_BUILD_TESTS "Build the unit tests for Clarabel.cpp" false)
if(CLARABEL_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
message(STATUS "Clarabel.cpp: CMAKE_INSTALL_LIBDIR = ${CMAKE_INSTALL_LIBDIR}")
message(STATUS "Clarabel.cpp: LIBRARY = ${LIBRARY}")
message(STATUS "Clarabel.cpp: PROJECT_NAME = ${PROJECT_NAME}")
install(TARGETS libclarabel_c_shared EXPORT ${PROJECT_NAME}
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(EXPORT ${PROJECT_NAME} DESTINATION cmake)