-
Notifications
You must be signed in to change notification settings - Fork 27
/
CMakeLists.txt
executable file
·43 lines (33 loc) · 1.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
# Set the minimum version of CMake required to build this project
cmake_minimum_required(VERSION 3.12...3.30)
# Define the main project, its description, and the languages used
project(ldpc
DESCRIPTION "ldpc - Software for classical and quantum low density parity check codes"
LANGUAGES CXX)
# Enable OpenMP support for parallel programming
# SET(CMAKE_CXX_FLAGS "-fopenmp")
# Ensure that the necessary C++11 features are available, as required by the RapidCSV library
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# check if this is the master project or used via add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(LDPC_MASTER_PROJECT ON)
else()
set(LDPC_MASTER_PROJECT OFF)
endif()
option(BUILD_LDPC_TESTS "Also build tests for the LDPC project" ${LDPC_MASTER_PROJECT})
### Library Configuration Section ###
# Define an interface library named 'ldpc' which only includes headers
add_library(ldpc INTERFACE)
# Add specific directories to the include path for any target that links with the 'ldpc' library
target_include_directories(ldpc INTERFACE src_cpp include/robin_map include/rapidcsv)
# Set the required C++ standard
target_compile_features(ldpc INTERFACE cxx_std_20)
if (LDPC_MASTER_PROJECT)
add_subdirectory(cpp_example)
endif()
if(BUILD_LDPC_TESTS)
# Add test code
enable_testing()
include(GoogleTest)
add_subdirectory(cpp_test)
endif()