-
Notifications
You must be signed in to change notification settings - Fork 42
/
CMakeLists.txt
35 lines (24 loc) · 961 Bytes
/
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
cmake_minimum_required(VERSION 3.4)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake")
# Create new Visual Studio solution
set(PROJECT_NAME CV_SUMMER_CAMP)
project(${PROJECT_NAME})
set(LIBRARY "${PROJECT_NAME}_lib")
# Enable C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
#Include dairectories with sources
include_directories(src)
# Move executable files
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
# Find OpenCV installation folder
find_package(OpenCV 4.0 REQUIRED)
set(LIBRARY_DEPS ${OpenCV_LIBS})
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include" ${OpenCV_INCLUDE_DIRS})
# Add projects in solution
add_subdirectory(src)
add_subdirectory(samples)