generated from osamhack2020/Sample_Technology_ProjectName_TeamName
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (47 loc) · 2.08 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
#Cmake
cmake_minimum_required(VERSION 2.8.12)
# Every project needs a name. We call this the "examples" project.
project(sleep_detection)
# Tell cmake we will need dlib. This command will pull in dlib and compile it
# into your project. Note that you don't need to compile or install dlib. All
# it needs is the dlib source code folder and it will take care of everything.
include(../dlib/cmake)
# To compile this program all you need to do is ask cmake. You would type
# these commands from within the directory containing this CMakeLists.txt
# file:
# mkdir build
# cd build
# cmake ..
# cmake --build . --config Release
#
# The cmake .. command looks in the parent folder for a file named
# CMakeLists.txt, reads it, sets up everything needed to build program. Also,
# note that CMake can also generate Visual Studio or XCode project files. So
# if instead you had written:
# mkdir build
# cmake .. -G "Visual Studio 14 2015 Win64" ..
#
# You would be able to open the resulting visual studio project and compile and
# edit the example programs within the visual studio IDE. CMake can generate a
# lot of different types of IDE projects. Run the cmake -h command to see a list
# of arguments to -G to see what kinds of projects cmake can generate for you.
# It probably includes your favorite IDE in the list.
# Since there are a lot of examples I'm going to use a macro to simply this
# CMakeLists.txt file. However, usually you will create only one executable in
# your cmake projects and use the syntax shown above.
macro(add_example name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name} dlib::dlib )
endmacro()
if (DLIB_NO_GUI_SUPPORT)
message("No GUI support, so we won't build the sleep_detection example.")
else()
find_package(OpenCV QUIET)
if (OpenCV_FOUND)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(sleep_detection sleep_detection.cpp)
target_link_libraries(sleep_detection dlib::dlib ${OpenCV_LIBS} )
else()
message("OpenCV not found, so we won't build the sleep_detection example.")
endif()
endif()