forked from cda-tum/mqt-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·75 lines (60 loc) · 2.03 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
# set required cmake version
cmake_minimum_required(VERSION 3.19...3.28)
project(
mqt-core
LANGUAGES CXX
DESCRIPTION "MQT Core - The Backbone of the Munich Quantum Toolkit")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(cmake/StandardProjectSettings.cmake)
include(cmake/PreventInSourceBuilds.cmake)
include(cmake/PackageAddTest.cmake)
include(cmake/Cache.cmake)
option(BUILD_MQT_CORE_BINDINGS "Build the MQT Core Python bindings" OFF)
if(BUILD_MQT_CORE_BINDINGS)
# ensure that the BINDINGS option is set
set(BINDINGS
ON
CACHE INTERNAL "Enable settings related to Python bindings")
# top-level call to find Python
find_package(
Python 3.8 REQUIRED
COMPONENTS Interpreter Development.Module
OPTIONAL_COMPONENTS Development.SABIModule)
endif()
# try to determine the version from either git or the Python package
include(cmake/GetVersion.cmake)
get_version()
project(
mqt-core
LANGUAGES CXX
VERSION ${MQT_CORE_VERSION}
DESCRIPTION "MQT Core - The Backbone of the Munich Quantum Toolkit")
# check if this is the master project or used via add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(MQT_CORE_MASTER_PROJECT ON)
else()
set(MQT_CORE_MASTER_PROJECT OFF)
endif()
option(MQT_CORE_INSTALL "Generate installation instructions for MQT Core"
${MQT_CORE_MASTER_PROJECT})
option(BUILD_MQT_CORE_TESTS "Also build tests for the MQT Core project" ${MQT_CORE_MASTER_PROJECT})
include(cmake/ExternalDependencies.cmake)
# set the include directory for the build tree
set(MQT_CORE_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/include")
# add main library code
add_subdirectory(src)
# add test code
if(BUILD_MQT_CORE_TESTS)
enable_testing()
include(GoogleTest)
add_subdirectory(test)
endif()
option(BUILD_MQT_CORE_BENCHMARKS "Also build benchmarks for the MQT Core project" OFF)
if(BUILD_MQT_CORE_BENCHMARKS)
add_subdirectory(eval)
endif()
if(NOT MQT_CORE_MASTER_PROJECT)
set(mqt-core_FOUND
TRUE
CACHE INTERNAL "True if mqt-core is found on the system")
endif()