-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
38 lines (30 loc) · 1.06 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
# Minimum CMake version required, we'll just use the latest version.
cmake_minimum_required(VERSION 3.22)
# Project name, version and description
project(test VERSION 1.0 DESCRIPTION "Polarity Test")
set(sources ${CMAKE_SOURCE_DIR}/src)
file(GLOB_RECURSE sources CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/src/* )
find_package(OpenCV REQUIRED)
find_package(Armadillo REQUIRED)
find_package(SDL2 REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include )
link_directories(${CMAKE_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
add_executable(${PROJECT_NAME} ${sources})
target_link_libraries( ${PROJECT_NAME} PRIVATE ${OpenCV_LIBS} ${Armadillo_LIBS})
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
# Set C++ version
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED ON
)
# Set Compiler flags
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE
/W4
)
else()
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall -Wextra -O3 -march=native
)
endif()