-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCmakeLists.txt
More file actions
86 lines (70 loc) · 2.07 KB
/
CmakeLists.txt
File metadata and controls
86 lines (70 loc) · 2.07 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
# cmake_minimum_required(VERSION 3.10)
# project(EKF-Localisation)
# # set the C++ standard.
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_PREFIX_PATH "/opt/homebrew/Cellar/sfml/3.0.0_1")
# # find packages
# find_package(SFML 3 COMPONENTS System Window Graphics Network Audio REQUIRED)
# # Add the include directory so that headers in /include are found.
# include_directories(${PROJECT_SOURCE_DIR}/include)
# # Collect all source files.
# file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/src/*.cpp")
# # Create the executable.
# add_executable(ekf_localisation ${SOURCES})
# # Link SFML libraries using the imported targets.
# target_link_libraries(ekf_localisation
# SFML::System
# SFML::Window
# SFML::Graphics
# SFML::Network
# SFML::Audio
# )
cmake_minimum_required(VERSION 3.10)
project(EKF-Localisation)
# =====================
# Compiler Settings
# =====================
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# =====================
# Dependency Configuration
# =====================
# Eigen (Homebrew-specific paths)
list(APPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/eigen")
find_package(Eigen3 3.4 REQUIRED NO_MODULE)
# SFML
find_package(SFML 3 COMPONENTS System Window Graphics REQUIRED)
# =====================
# Project Configuration
# =====================
file(GLOB SOURCES "src/*.cpp")
add_executable(ekf_localisation ${SOURCES})
# =====================
# Include Directories
# =====================
target_include_directories(ekf_localisation PRIVATE
${PROJECT_SOURCE_DIR}/include
/opt/homebrew/opt/eigen/include/eigen3
${EIGEN3_INCLUDE_DIRS}
)
# =====================
# Link Libraries
# =====================
target_link_libraries(ekf_localisation PRIVATE
SFML::System
SFML::Window
SFML::Graphics
Eigen3::Eigen
)
# =====================
# IDE Support
# =====================
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
target_compile_options(ekf_localisation PRIVATE
-Wall
-Wextra
-Wpedantic
)
endif()