-
Notifications
You must be signed in to change notification settings - Fork 15
/
CMakeLists.txt
executable file
·45 lines (37 loc) · 1.29 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
cmake_minimum_required(VERSION 2.8)
project(FaceLandmark)
add_definitions(-std=c++11)
add_definitions("-Wall")
set(OpenCV_LIB_DIR "/usr/local/lib")
set(OpenCV_INCLUDE_DIR "/usr/local/include")
if(True)
find_package(OpenMP)
if(NOT TARGET OpenMP::OpenMP_CXX AND (OpenMP_CXX_FOUND OR OPENMP_FOUND))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
endif()
include_directories(${OpenCV_INCLUDE_DIR}/opencv4
${CMAKE_CURRENT_SOURCE_DIR}/ncnn/include/ncnn
./include)
link_directories(${OpenCV_LIB_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ncnn/lib)
set(OpenCV_LIB_DIR opencv_core
opencv_highgui
opencv_imgproc
opencv_imgcodecs
opencv_videoio)
set(SRC
./src/main.cpp
./src/Pfld.cpp
./src/UltraFace.cpp
)
add_executable(FaceLandmark ${SRC})
target_link_libraries(FaceLandmark ncnn ${OpenCV_LIB_DIR})
if(OpenMP_CXX_FOUND)
if(NCNN_CMAKE_VERBOSE)
message("Building with OpenMP")
endif()
target_link_libraries(FaceLandmark PUBLIC OpenMP::OpenMP_CXX)
endif()