-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
142 lines (103 loc) · 4.28 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
cmake_minimum_required(VERSION 3.15)
#! Check every comment after the "#!"
#! CHANGE YOUR PROJECT NAME
# It is used as your project's main executable name.
set(PROJECT_NAME ga_lib)
project(${PROJECT_NAME} C CXX) # project(${PROJECT_NAME} C CXX ASM)
set(CMAKE_CXX_STANDARD 20)
##########################################################
# User configurable options of the template
##########################################################
#! It is a good practice to set "WARNINGS_AS_ERRORS" ON,
# but sometimes it creates too much trouble, so default is OFF.
option(WARNINGS_AS_ERRORS
"Promotes compile-time warnings to errors that prevent the successful builds" OFF)
#! Always use PVS Studio while developing.
option(ENABLE_PVS_STUDIO "PVS Studio code analyser" OFF)
#! Select appropriate sanitizers.
# Definitely enable sanitizers while developing.
# Disable it for the production builds and before submitting for grading.
# Only one of Memory (MSAN), Address (ASAN), or Thread (TSan)
# sanitizers is applicable at the time -- the first defined.
#! UndefinedBehaviorSanitizer (UBSan).
# Info: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
set(ENABLE_UBSan OFF)
#! AddressSanitizer -- detects use after free or after scope exit,
# memory overflows and leaks.
# Info: https://github.com/google/sanitizers/wiki/AddressSanitizer
set(ENABLE_ASAN OFF)
#! ThreadSanitizer -- detects data races.
# Info: https://clang.llvm.org/docs/ThreadSanitizer.html
set(ENABLE_TSan OFF)
#! MemorySanitizer -- detects uninitialized memory reads
# Info: https://github.com/google/sanitizers/wiki/MemorySanitizer
set(ENABLE_MSAN OFF)
#! Be default -- build release version if not specified otherwise.
option(CMAKE_BUILD_TYPE
"Select the build optimization type Debug/RelseaseWithDebugInfo/Release" Release)
# Warnings as errors should be imported here -- do not move this line
include(cmake/CompilerWarnings.cmake)
##########################################################
# Project files, packages, libraries and so on
##########################################################
#! Project main executable source compilation
#add_executable(held-carp held-carp.cpp timer.h)
###### uncomment ######
add_executable(sizeThreadTest
examples/sizeThreadsComparison.cpp
include/Population.h
src/Population.cpp
include/SalesmanPopulation.h
examples/SalesmanPopulation.cpp
include/Solver.h
src/Solver.cpp
include/timer.h
include/TreadSafeQ.h
include/TPool.h
src/TPool.cpp
)
add_executable(knapsack_ga
examples/main.cpp
include/Population.h
src/Population.cpp
examples/KnapsackPopulation.cpp
include/KnapsackPopulation.h
include/Solver.h
src/Solver.cpp
include/timer.h
include/TreadSafeQ.h
include/TPool.h
src/TPool.cpp
)
#! Put path to your project headers
#target_include_directories(held-carp_parallel PRIVATE include)
#target_include_directories(TSP_GA PRIVATE include)
#target_include_directories(TSP_GA_parallel PRIVATE include)
#target_include_directories(GA PRIVATE include)
#target_include_directories(structured_ga PRIVATE include)
#target_include_directories(sizeThreadTest PRIVATE include)
target_include_directories(knapsack_ga PRIVATE include)
target_include_directories(sizeThreadTest PRIVATE include)
###### uncomment ######
# find_package(TBB REQUIRED)
# target_link_libraries(held-carp_parallel PRIVATE TBB::tbb)
###### uncomment ######
#! Add external packages
# options_parser requires boost::program_options library
#find_package(Boost 1.71.0 COMPONENTS program_options system REQUIRED)
#target_include_directories(${PROJECT_NAME} PRIVATE ${Boost_INCLUDE_DIR})
#target_link_libraries(${PROJECT_NAME} Boost::program_options Boost::system)
##########################################################
# Fixed CMakeLists.txt part
##########################################################
###### uncomment ######
#INSTALL(PROGRAMS
# $<TARGET_FILE:held-carp> # ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}
# DESTINATION bin)
###### uncomment ######
# Define ALL_TARGETS variable to use in PVS and Sanitizers
###### uncomment ######
# set(ALL_TARGETS GA)
###### uncomment ######
# Include CMake setup
include(cmake/main-config.cmake)