-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
95 lines (81 loc) · 2.8 KB
/
Copy pathCMakeLists.txt
File metadata and controls
95 lines (81 loc) · 2.8 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
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
cmake_minimum_required(VERSION 3.22)
project(optymalizacja_kombinatoryczna)
# Set C++ standard and optimization flags
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Set optimization level to O3
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall -Wextra -Werror")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
# Find Python (if needed)
#find_package(Python3 COMPONENTS Interpreter REQUIRED)
# Define include directories at the top level
include_directories(
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}
)
# Source files
set(SOURCES
src/configuration/genetic_algorithm_configuration.cpp
src/metaheuristics/mutation_impl.cpp
src/metaheuristics/mutation.cpp
src/metaheuristics/selection.cpp
src/metaheuristics/crossover_impl.cpp
src/metaheuristics/crossover.cpp
src/metaheuristics/permutation_representation.cpp
src/metaheuristics/genetic_algorithm.cpp
src/metaheuristics/genetic_algorithm_runner.cpp
src/metaheuristics/adaptive_crossover.cpp
src/metaheuristics/fitness.cpp
src/metaheuristics/individual.cpp
src/metaheuristics/stopping_criteria.cpp
src/metaheuristics/path_analyzer.cpp
src/metaheuristics/edge_table.cpp
src/dna/dna_instance.cpp
src/dna/dna_instance_io.cpp
src/dna/dna_instance_builder.cpp
src/dna/error_introduction.cpp
src/dna/dna_generator.cpp
src/dna/spectrum_generator.cpp
src/utils/logging.cpp
src/utils/utility_functions.cpp
src/utils/performance_profilling_framework.cpp
src/tuning/parameter_tuning_manager.cpp
src/tuning/parameter_parser.cpp
src/tuning/tuning_structures.cpp
)
# Create library
add_library(${PROJECT_NAME}_lib STATIC ${SOURCES})
# Set include directories for the library
target_include_directories(${PROJECT_NAME}_lib PUBLIC
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src
)
# Main executable
add_executable(${PROJECT_NAME} src/main.cpp)
# Link the library
target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_lib)
# Copy configuration files to build directory
file(COPY ${CMAKE_SOURCE_DIR}/config DESTINATION ${CMAKE_BINARY_DIR})
# Set working directory for the executable
set_target_properties(${PROJECT_NAME} PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
# Only include tests if ENABLE_TESTING is set
option(ENABLE_TESTING "Enable testing" ON)
if(ENABLE_TESTING)
# Google Test setup
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip
DOWNLOAD_EXTRACT_TIMESTAMP true
)
FetchContent_MakeAvailable(googletest)
# Enable testing
enable_testing()
# Add tests
add_subdirectory(google_tests)
endif()