-
Notifications
You must be signed in to change notification settings - Fork 29
/
CMakeLists.txt
59 lines (49 loc) · 1.71 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
cmake_minimum_required(VERSION 3.17)
project(sylvan
VERSION 1.8.1
DESCRIPTION "Sylvan, a parallel decision diagram library"
HOMEPAGE_URL "https://github.com/trolando/sylvan"
LANGUAGES C CXX
)
# Add CMake modules path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/")
# Dependencies
# with CMake >= 3.24, Lace is only downloaded if it is not already installed
# with CMake <= 3.23, Lace is always downloaded
if(NOT TARGET lace)
find_package(lace QUIET)
if(NOT lace_FOUND)
include(FetchContent)
FetchContent_Declare(
lace
GIT_REPOSITORY https://github.com/trolando/lace.git
GIT_TAG v1.4.2
)
FetchContent_MakeAvailable(lace)
endif()
endif()
# Add the Sylvan library target
add_subdirectory(src)
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# If we are in the root, add some options to build examples/tests
option(SYLVAN_BUILD_EXAMPLES "Build example tools" ON)
option(SYLVAN_BUILD_DOCS "Build documentation" OFF)
option(SYLVAN_BUILD_TESTS "Build tests" ON)
# Build examples
if(SYLVAN_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
# Make documentation
if(SYLVAN_BUILD_DOCS)
configure_file("docs/conf.py.in" "docs/conf.py" @ONLY)
find_package(Sphinx REQUIRED)
Sphinx_add_targets(sylvan ${CMAKE_CURRENT_BINARY_DIR}/docs ${CMAKE_CURRENT_SOURCE_DIR}/docs ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(update_gh_pages COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/UpdateGHPages.cmake")
add_dependencies(update_gh_pages sylvan_html)
endif()
# Add tests
if(SYLVAN_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
endif()