forked from dtmoodie/EagleEye
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
89 lines (79 loc) · 3.5 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# requires a rather new version of cmake to correctly handle target_include_directories when compiling .cu files
cmake_minimum_required(VERSION 3.5)
project(EagleEye)
SET(BIN_DIRS "" CACHE STRING "" FORCE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
option(BUILD_DEPENDENCIES "Build dependencies within the AquilOS family" ON)
find_package(CUDA REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
set(PROJECT_BIN_DIRS_DEBUG)
set(PROJECT_BIN_DIRS_RELWITHDEBINFO)
set(PROJECT_BIN_DIRS_RELEASE "")
CMAKE_POLICY(SET CMP0020 NEW)
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release")
SET(CMAKE_DEBUG_POSTFIX "d")
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
include("cmake/FindNVToolsExt.cmake")
include("cmake/Utils.cmake")
IF(WIN32)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
ADD_DEFINITIONS(-D_ENABLE_ATOMIC_ALIGNMENT_FIX)
ELSE(WIN32)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
ENDIF(WIN32)
set(Boost_required_components system thread log log_setup program_options)
find_package(Boost REQUIRED COMPONENTS ${Boost_required_components})
include_directories(${Boost_INCLUDE_DIRS})
set(Boost_TARGETS "")
foreach(cmp ${Boost_required_components})
list(APPEND Boost_TARGETS "Boost::${cmp}")
endforeach()
IF(WIN32)
add_definitions(-DWIN32)
add_definitions(-D_WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FS /EHsc /FC /Zo /d2Zi+ /Zi /MP /Zm512 /bigobj")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /Od")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /O2 /Ob1 /D /Oy- /Zo /DNDEBUG")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Oy-")
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0601)
ELSE(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/Plugins")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-reorder -Wno-sign-compare -O0")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-omit-frame-pointer")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -g -Wl,--no-as-needed")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin/Plugins" CACHE PATH "Library output path" FORCE)
SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin" CACHE PATH "Executable output path" FORCE)
ENDIF(WIN32)
SET(Aquila_JETSON FALSE CACHE BOOL "True if building for jetson platform")
if(NOT BUILD_DEPENDENCIES)
find_package(Aquila REQUIRED)
include_directories(${Aquila_INCLUDE_DIRS})
else()
message(STATUS "Building Aquila as part of project")
add_subdirectory(Aquila)
endif()
LINK_DIRECTORIES(${LINK_DIRS_DEBUG})
LINK_DIRECTORIES(${LINK_DIRS_RELEASE})
INCLUDE_DIRECTORIES(${Aquila_INCLUDE_DIRS})
add_subdirectory(Plugins)
add_subdirectory(samples)
add_subdirectory(tests)
add_subdirectory(EagleEye)