-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (50 loc) · 1.8 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
cmake_minimum_required(VERSION 3.16.3)
SET(PROJECT_NAME "IntegerSequence")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
# Project information
project(${PROJECT_NAME} VERSION 0.0.1 LANGUAGES CXX)
# Include directory for the project
include_directories(include)
# External library to do large int operations
find_library(LARGEINT NAMES largeint HINTS "${CMAKE_SOURCE_DIR}/library/")
# Enable CTest
enable_testing()
# List of manual sequences
file(STRINGS msequence.txt MANUAL_SEQUENCES)
# Create target for each sequence
foreach(seq ${MANUAL_SEQUENCES})
# Add source files
set(SOURCES
source/manual/${seq}.cpp
source/processor.cpp)
# Make ctest target
add_executable(${seq} ${SOURCES})
# Create sequence number based class
target_compile_definitions(${seq} PRIVATE "-DSEQUENCE=${seq}" "-DPARI")
# Set build options
target_compile_options(${seq} PRIVATE -O3 -Wall -Wextra)
# Links the executable to the LargeInt C++ library.
target_link_libraries (${seq} PRIVATE ${LARGEINT})
# Add CTest to CI
add_test(CTest${seq} ${seq})
endforeach()
# List of generated sequences
file(STRINGS gsequence.txt GENERATED_SEQUENCES)
# Create target for each sequence
foreach(seq ${GENERATED_SEQUENCES})
# Add source files
set(SOURCES
source/generated/${seq}.cpp
source/processor.cpp)
# Make ctest target
add_executable(${seq} ${SOURCES})
# Create sequence number based class
target_compile_definitions(${seq} PRIVATE "-DSEQUENCE=${seq}" "-DPARI")
# Set build options
target_compile_options(${seq} PRIVATE -O3 -Wall -Wextra)
# Links the executable to the LargeInt C++ library.
target_link_libraries (${seq} PRIVATE ${LARGEINT})
# Add CTest to CI
add_test(CTest${seq} ${seq})
endforeach()