-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
111 lines (83 loc) · 3.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
cmake_minimum_required (VERSION 2.8.12)
project(rc_genicam_3dviewer)
include(cmake/project_version.cmake)
enable_testing()
include_directories(${CMAKE_SOURCE_DIR})
# - Find manditory package cvkit -
find_package(CVKIT 2.0.3 REQUIRED)
find_package(RC_GENICAM_API 2.2.3 REQUIRED)
include_directories(${CVKIT_INCLUDE_DIRS})
include_directories(${RC_GENICAM_API_INCLUDE_DIRS})
# - Configuration for code optimization -
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "Build type: DEBUG or RELEASE" FORCE)
endif ()
include(cmake/optimization_flags.cmake)
# uncomment next line to use cuda
#include(cmake/cuda.cmake)
# - Standard definitions -
add_definitions(-Wall)
if (CMAKE_MAJOR_VERSION VERSION_LESS "3.1.0")
add_definitions(-std=c++11)
else ()
set(CMAKE_CXX_STANDARD 11)
endif ()
# - Disable some warnings when compiling with Visual Studio under Windows -
if (MSVC)
add_definitions(/DGENICAM_NO_AUTO_IMPLIB)
add_definitions("/wd4251")
add_definitions("/wd4505")
add_definitions("/wd5045")
add_definitions("/wd4100")
add_definitions("/wd4365")
add_definitions("/wd4003")
add_definitions("/wd4514")
add_definitions("/wd4710")
add_definitions("/wd4820")
add_definitions("/wd4435")
add_definitions("/wd4668")
add_definitions("/wd4127")
add_definitions("/wd4265")
add_definitions("/wd4623")
add_definitions("/wd4996")
add_definitions("/wd4437")
add_definitions("/wd4571")
add_definitions("/wd4355")
add_definitions("/wd4061")
add_definitions("/wd4800")
add_definitions("/wd4711")
add_definitions("/wd4774")
add_definitions("/wd4625")
add_definitions("/wd4626")
add_definitions("/wd5026")
add_definitions("/wd5027")
add_definitions("/wd5039")
add_definitions("/wd5204")
endif ()
# - Build individual parts -
add_subdirectory(tools)
# export project targets
# ??? Declare (shared) libraries that are created by your project. For all
# libraries that appear here, the following line should exist in a cmake
# file in a sub directory:
# install(TARGETS rcXXX EXPORT PROJECTTargets COMPONENT bin DESTINATION lib)
#set(PROJECT_LIBRARIES rcXXX)
# ??? Declare static libraries that are created by your project. For all
# libraries that appear here, the following line should exist in a cmake
# file in a sub directory:
# install(TARGETS rcXXX_static EXPORT PROJECTTargets COMPONENT dev DESTINATION lib)
#set(PROJECT_STATIC_LIBRARIES rcXXX_static)
# ??? install generated version.h file
# the destination path might have to be adjusted for your project
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/project_version.h COMPONENT dev DESTINATION include/${PROJECT_NAME})
include(cmake/configure_link_libs.cmake)
# add a target to generate API documentation with Doxygen
add_subdirectory(doc)
# - Define information for packaging -
# optionally set description and maintainer (if not set will use defaults from package_debian.cmake)
#set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Roboception package description")
# optionally set package maintainer (otherwise defaults to Roboception <[email protected]>)
#set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Your Name <[email protected]>")
# optionally specify dependencies of the debian package here (comma separated!)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "cvkit (>= 2.3.6), rc-genicam-api (>= 2.5.12)")
include(cmake/package_debian.cmake)