-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
69 lines (57 loc) · 2.11 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
61
62
63
64
65
66
67
68
69
#Generated by VisualGDB project wizard.
#Note: VisualGDB will automatically update this file when you add new sources to the project.
cmake_minimum_required(VERSION 2.7)
cmake_policy(SET CMP0015 NEW)
project(DuoInterface)
#Hardcoded arm for now
set(ARM ON)
#using pkg-config
find_package(PkgConfig)
# Add duo library directory to suit system
if (UNIX)
set(DUOLibNames "DUO")
if (ARM)
link_directories("lib/linux/arm")
else (ARM)
link_directories("lib/linux/x64")
endif(ARM)
elseif (MSVC)
set(DUOLibNames "DUOLib")
link_directories("lib/win/x64")
endif (UNIX)
# Check if we are building with openCV
find_package( OpenCV OPTIONAL_COMPONENTS gpu)
if( OPENCV_GPU_FOUND)
add_definitions(-DWITH_GPU)
message(AUTHOR_WARNING "Found opencv gpu component")
endif()
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
link_directories("${OpenCV_LIB_DIR_OPT}")
# Check if we are building with Nvidia Vision Works
option(ENABLE_NVX "This will enable Nividia Vision Works related code" OFF)
if (PkgConfig_FOUND)
pkg_search_module(visionworks REQUIRED visionworks)
if(visionworks_FOUND)
set( ENABLE_NVX ON)
add_definitions(-DWITH_NVX)
include_directories("${visionworks_INCLUDE_DIRS}")
link_directories("${visionworks_LIBRARY_DIRS}")
endif()
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=gnu++11")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=gnu++11")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=gnu++11")
add_library(DuoInterface src/DUOInterface.cpp)
target_link_libraries(DuoInterface "${OpenCV_LIBS}" "${DUOLibNames}" "${LIBRARIES_FROM_REFERENCES}")
if (MSVC) # On windows it seems only this works...
target_link_libraries(DuoInterface "${OpenCV_LIBRARIES}")
endif ()
# Add optional libraries
if (visionworks_FOUND)
target_compile_options(DuoInterface PUBLIC "${visionworks_CFLAGS_OTHER}")
target_link_libraries(DuoInterface "${visionworks_LIBRARIES}" )
endif()
add_executable(DuoInterfaceTest src/mainTest.cpp)
add_dependencies(DuoInterfaceTest DuoInterface)
target_link_libraries(DuoInterfaceTest DuoInterface "${LIBRARIES_FROM_REFERENCES}")