-
Notifications
You must be signed in to change notification settings - Fork 16
/
CMakeLists.txt
50 lines (41 loc) · 1.88 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
# This is a minimalist cmake file designed to be used
# with libigl. If you need CoMISo for other purposes
# please use the CMakeLists_original.cmake which
# supports all the features of CoMISo
cmake_minimum_required(VERSION 3.11)
project(CoMISo)
add_library(CoMISo STATIC
Solver/EigenLDLTSolver.hh Solver/EigenLDLTSolver.cc
Solver/MISolver.hh Solver/MISolver.cc
Solver/ConstrainedSolver.hh Solver/ConstrainedSolver.cc
Solver/IterativeSolverT.hh Solver/IterativeSolverT.cc
Solver/GMM_Tools.hh Solver/GMM_Tools.cc)
target_include_directories(CoMISo PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_include_directories(CoMISo PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../eigen>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/eigen>)
target_include_directories(CoMISo PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ext/gmm-4.2/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/ext/gmm-4.2/include>)
target_compile_definitions(CoMISo PUBLIC -DINCLUDE_TEMPLATES)
target_link_libraries(CoMISo PUBLIC Eigen3::Eigen)
# Generate position independent code
set_target_properties(CoMISo PROPERTIES POSITION_INDEPENDENT_CODE ON)
if(WIN32)
target_compile_definitions(CoMISo PRIVATE -D_USE_MATH_DEFINES -DNOMINMAX)
target_compile_options(CoMISo PUBLIC /D_SCL_SECURE_NO_DEPRECATE)
add_library(CoMISo_blas STATIC IMPORTED)
set_target_properties(CoMISo_blas PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/ext/OpenBLAS-v0.2.14-Win64-int64/lib/libopenblas.dll.a.lib")
target_link_libraries(CoMISo PRIVATE CoMISo_blas)
endif()
if(APPLE)
find_library(accelerate_library Accelerate)
target_link_libraries(CoMISo PUBLIC ${accelerate_library})
elseif(UNIX)
find_package(BLAS REQUIRED)
target_link_libraries(CoMISo PUBLIC ${BLAS_LIBRARIES})
endif()