forked from diku-dk/RAINBOW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (74 loc) · 2.42 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cmake_minimum_required(VERSION 3.12)
project(ISL VERSION 0.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(
FATAL_ERROR
"CMake generation for ISL is not allowed
within the source directory!"
)
endif()
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.6.2
GIT_PROGRESS TRUE
SOURCE_DIR "${PROJECT_SOURCE_DIR}/cpp/external/pybind11"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
FetchContent_MakeAvailable(pybind11)
find_package (Eigen3 3.3 NO_MODULE)
if (NOT TARGET Eigen3::Eigen)
message("Could not find Eigen3 on your system, getting it myself, please wait")
# Unfortunately, FetchContent does not work nicely. It does
# not includ ethe target Eigen3::Eigen and it pollutes the
# project file with many Eigen targets that is not needed.
#include(FetchContent)
#FetchContent_Declare(
# eigen
# GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
# GIT_TAG 3.3.9
# GIT_PROGRESS TRUE
# SOURCE_DIR "${PROJECT_SOURCE_DIR}/cpp/external/Eigen3"
# CONFIGURE_COMMAND ""
# BUILD_COMMAND ""
# INSTALL_COMMAND ""
# TEST_COMMAND ""
# )
#set(BUILD_TESTING OFF CACHE BOOL "")
#set(EIGEN_BUILD_DOC OFF CACHE BOOL "")
#set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "")
#FetchContent_MakeAvailable(eigen)
#set(BUILD_TESTING OFF CACHE BOOL "")
#set(EIGEN_BUILD_DOC OFF CACHE BOOL "")
#set(EIGEN_BUILD_PKGCONFIG OFF CACHE BOOL "")
#FetchContent_MakeAvailable(eigen)
include(ExternalProject)
ExternalProject_Add(
eigen
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.3.9
GIT_PROGRESS TRUE
SOURCE_DIR "${PROJECT_SOURCE_DIR}/cpp/external/Eigen3"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
add_library(libisl_eigen INTERFACE)
target_include_directories(libisl_eigen SYSTEM INTERFACE
$<BUILD_INTERFACE: ${PROJECT_SOURCE_DIR}/cpp/external/Eigen3/>
$<INSTALL_INTERFACE:include>
)
set_property(TARGET libisl_eigen PROPERTY EXPORT_NAME Eigen3::Eigen)
add_library(Eigen3::Eigen ALIAS libisl_eigen)
endif ()
add_subdirectory(cpp)