This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
84 lines (71 loc) · 2.35 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
# set required cmake version
cmake_minimum_required(VERSION 3.19)
# This avoids googletest complaining that this (IPO) policy is not set
cmake_policy(SET CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
# project definition
project(
DDPackage
LANGUAGES CXX
VERSION 2.1.0
DESCRIPTION "MQT decision diagram package tailored to quantum computing")
include(cmake/StandardProjectSettings.cmake)
include(cmake/PreventInSourceBuilds.cmake)
include(cmake/CheckSubmodule.cmake)
include(cmake/PackageAddTest.cmake)
if(NOT TARGET project_warnings)
# Use the warnings specified in CompilerWarnings.cmake
add_library(project_warnings INTERFACE)
# Standard compiler warnings
include(cmake/CompilerWarnings.cmake)
set_project_warnings(project_warnings)
endif()
if(NOT TARGET project_options)
# Use the options specified in CompilerOptions.cmake
add_library(project_options INTERFACE)
# Standard compiler options
include(cmake/CompilerOptions.cmake)
enable_project_options(project_options)
# Sanitizer options if supported by compiler
include(cmake/Sanitizers.cmake)
enable_sanitizers(project_options)
endif()
# add main library code
if(NOT TARGET ${PROJECT_NAME})
add_library(
${PROJECT_NAME}
INTERFACE
include/dd/Complex.hpp
include/dd/ComplexCache.hpp
include/dd/ComplexNumbers.hpp
include/dd/ComplexTable.hpp
include/dd/ComplexValue.hpp
include/dd/ComputeTable.hpp
include/dd/Control.hpp
include/dd/Definitions.hpp
include/dd/Edge.hpp
include/dd/Export.hpp
include/dd/GateMatrixDefinitions.hpp
include/dd/Node.hpp
include/dd/Package.hpp
include/dd/ToffoliTable.hpp
include/dd/UnaryComputeTable.hpp
include/dd/DensityNoiseTable.hpp
include/dd/StochasticNoiseOperationTable.hpp
include/dd/UniqueTable.hpp)
# add options and warnings to library
target_link_libraries(${PROJECT_NAME} INTERFACE project_options project_warnings)
# set include directories
target_include_directories(${PROJECT_NAME} INTERFACE include ${PROJECT_BINARY_DIR}/include)
# add MQT alias
add_library(MQT::DDPackage ALIAS ${PROJECT_NAME})
endif()
# add test code
option(BUILD_DD_PACKAGE_TESTS "Also build tests for DD package")
if(BUILD_DD_PACKAGE_TESTS)
check_submodule_present(googletest)
check_submodule_present(benchmark)
enable_testing()
include(GoogleTest)
add_subdirectory(test)
endif()