CMakeLists.txt 1.78 KB
Newer Older
1
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
2
PROJECT(video_analyser)
3
4

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
5
6
7
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
SET(CMAKE_CXX_STANDARD 23)

Matteo's avatar
update    
Matteo committed
8
9
10
11
12
13
14
15
16
17
# include(FetchContent)
# FetchContent_Declare(
#     googletest
#     URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
# )

# # For Windows: Prevent overriding the parent project's compiler/linker settings
# SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# FetchContent_MakeAvailable(googletest)

18
LINK_DIRECTORIES(/usr/local/lib)
19

Matteo's avatar
update    
Matteo committed
20
21
22
23
add_library(analyser_lib
    src/lib/colors.h
    src/lib/time.cpp
    src/lib/time.h
Matteo's avatar
update    
Matteo committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    src/lib/enums.h
    src/lib/enums.cpp
    src/lib/Irregularity.h
    src/lib/Irregularity.cpp
    src/lib/IrregularityFile.h
    src/lib/IrregularityFile.cpp
    src/lib/TimeLabel.h
    src/lib/TimeLabel.cpp
    src/utility.h
    src/utility.cpp
)

add_library(files
    src/lib/files.h
    src/lib/files.cpp
Matteo's avatar
update    
Matteo committed
39
40
)

41
42
FIND_PACKAGE(OpenCV REQUIRED)
FIND_PACKAGE(nlohmann_json 3.2.0 REQUIRED)
43
FIND_PACKAGE(Boost COMPONENTS program_options REQUIRED)
44
45
46
47

INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})

Matteo's avatar
update    
Matteo committed
48
49
50
51
52
53
54
ADD_EXECUTABLE(video_analyser ./src/main.cpp)

TARGET_LINK_LIBRARIES(video_analyser
    ${OpenCV_LIBRARIES}
    nlohmann_json::nlohmann_json
    ${Boost_PROGRAM_OPTIONS_LIBRARY}
    analyser_lib
Matteo's avatar
update    
Matteo committed
55
    files
Matteo's avatar
update    
Matteo committed
56
)
Matteo's avatar
update    
Matteo committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

# enable_testing()

# ADD_EXECUTABLE(
#   test_suite
#   tests/irregularity_test.cpp
#   tests/enums_test.cpp
# )

# TARGET_LINK_LIBRARIES(
#   test_suite
#   GTest::gtest_main
#   analyser_lib
#   ${OpenCV_LIBRARIES}
#   ${Boost_PROGRAM_OPTIONS_LIBRARY}
#   nlohmann_json::nlohmann_json
# )

# include(GoogleTest)
# gtest_discover_tests(test_suite)