-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
33 lines (29 loc) · 959 Bytes
/
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
cmake_minimum_required(VERSION 3.15)
project(
qasmtools
VERSION 1.0
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
enable_testing()
# qasmtools root directory
add_compile_definitions(PROJECT_ROOT_DIR="${PROJECT_SOURCE_DIR}")
# Headers
add_library(libqasmtools INTERFACE)
target_include_directories(
libqasmtools
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>)
# Enable OpenQASM 2.0 Specs
option(QASMTOOLS_QASM2_SPECS
"Use OpenQASM 2.0 standard instead of Qiskit gate specifications" OFF)
if(${QASMTOOLS_QASM2_SPECS})
target_compile_definitions(libqasmtools
INTERFACE -DQASMTOOLS_QASM2_SPECS=true)
else()
target_compile_definitions(libqasmtools
INTERFACE -DQASMTOOLS_QASM2_SPECS=false)
endif()
# Unit testing
add_subdirectory(${CMAKE_SOURCE_DIR}/unit_tests/)