-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
55 lines (44 loc) · 1.55 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
cmake_minimum_required(VERSION 3.14)
project(qsylvan # based on sylvan 1.8.0
VERSION 1.2.0
DESCRIPTION "Sylvan, a parallel decision diagram library"
HOMEPAGE_URL "https://github.com/trolando/sylvan"
LANGUAGES C CXX
)
# Dependencies
include(FetchContent)
FetchContent_Declare(
lace
GIT_REPOSITORY https://github.com/trolando/lace.git
GIT_TAG v1.4.0
)
FetchContent_MakeAvailable(lace)
# Add CMake modules path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/")
# Add the Sylvan library target
add_subdirectory(src)
# Add the QASM parser
add_subdirectory(qasm)
if(CMAKE_CURRENT_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(qsylvan ${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()