-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
59 lines (50 loc) · 1.72 KB
/
Copy pathCMakeLists.txt
File metadata and controls
59 lines (50 loc) · 1.72 KB
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
cmake_minimum_required(VERSION 3.15...3.31)
project(
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)
# include(FetchContent)
# FetchContent_Declare(stim
# GIT_REPOSITORY https://github.com/quantumlib/stim.git
# GIT_TAG v1.14.0)
# FetchContent_GetProperties(stim)
# if(NOT stim_POPULATED)
# FetchContent_Populate(stim)
# add_subdirectory(${stim_SOURCE_DIR})
# endif()
# Core source files - utility and code implementation.
set(WEAVE_CORE_SOURCES
weave/_core/src/codes/noise_model.cpp
weave/_core/src/util/pcm.cpp
weave/_core/src/util/graph.cpp
)
# Python binding source files.
set(WEAVE_BINDINGS_SOURCES
weave/_core/src/bindings/weave.pybind.cpp
weave/_core/src/bindings/codes.pybind.cpp
weave/_core/src/bindings/util.pybind.cpp
)
# Create the Python module.
pybind11_add_module(_core ${WEAVE_CORE_SOURCES} ${WEAVE_BINDINGS_SOURCES})
target_include_directories(_core PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/weave/_core/include
${CMAKE_CURRENT_SOURCE_DIR}/weave/_core/lib/eigen
)
# target_link_libraries(_core PRIVATE libstim)
# Install the module to the Python package directory.
install(TARGETS _core DESTINATION ${SKBUILD_PROJECT_NAME})
# Define header files for IDE integration.
file(GLOB_RECURSE WEAVE_HEADERS
weave/_core/include/weave/*.hpp
weave/_core/include/weave/*.h
weave/_core/include/bindings/*.hpp
weave/_core/include/bindings/*.h
)
# Add headers to target sources for IDE integration.
target_sources(_core PRIVATE ${WEAVE_HEADERS})