-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
CMakeLists.txt
37 lines (36 loc) · 1.3 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
#Set minimum version requered
cmake_minimum_required(VERSION 2.4.6)
#just to avoid the warning
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
#set project name
project(ncnn_mtcnn_tld)
#Append path to the module path
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
#OpenCV
find_package(OpenCV REQUIRED)
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/./)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/./lib)
#set the include directories
include_directories (
${PROJECT_SOURCE_DIR}/./include
${OpenCV_INCLUDE_DIRS}
/home/hans/ncnn-20181019/build/install/include)
ADD_DEFINITIONS(
-O3 -fPIC -fopenmp -std=c++11
)
#compile tld libraries
add_library(TLD ${PROJECT_SOURCE_DIR}/ ./include/TLD.cpp)
#compile shared library
add_library(ncnn_mtcnn_tld_so SHARED ./include/ncnn_mtcnn_tld_so.cpp)
FIND_LIBRARY(NCNN_LIB ncnn /home/hans/ncnn-20181019/build/install/lib NO_DEFAULT_PATH)
target_link_libraries(ncnn_mtcnn_tld_so TLD ${OpenCV_LIBS} ${NCNN_LIB})
#executables
add_executable(demo ${PROJECT_SOURCE_DIR}/ ./demo.cpp)
#link the libraries
target_link_libraries(demo ncnn_mtcnn_tld_so ${OpenCV_LIBS})
#set optimization level
set(CMAKE_BUILD_TYPE Release)