-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
165 lines (127 loc) · 2.93 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
project(jiguiviou)
cmake_minimum_required( VERSION 2.8)
set(
CMAKE_BUILD_TYPE
# Release)
Debug)
option(GUI "Build with QtGui" ON)
if(GUI)
MESSAGE(STATUS "QtGui support")
add_definitions(-DGUI)
endif()
option(GENICAM "Build with GenICam control support" ON)
if(GENICAM)
MESSAGE(STATUS "GenICam support")
add_definitions(-DGENICAM)
include_directories(genicam)
add_subdirectory(genicam)
endif()
set(
CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(
Qt4
REQUIRED QtCore QtGui QtNetwork QtXml QtDbus)
set(
QT_USE_QTNETWORK TRUE)
set(
QT_USE_QTXML TRUE)
set(
QT_USE_QTDBUS TRUE)
include(
${QT_USE_FILE})
add_definitions(
${QT_DEFINITIONS})
include_directories(
gev
defaultbackend
gstreamerbackend
ihm
remotegsvp
gvsp
gvspgstreamer
gvcp)
add_subdirectory(
gvsp)
add_subdirectory(
gvspgstreamer)
add_subdirectory(
gstreamerbackend)
add_subdirectory(
defaultbackend)
add_subdirectory(
gev)
add_subdirectory(
ihm)
add_subdirectory(
gvcp)
set(
JIGUIVIOU_SOURCES
main.cpp)
set(
JIGUIVIOU_RESOURCES
ressources.qrc)
qt4_add_resources(
JIGUIVIOU_RESOURCES_RCC
${JIGUIVIOU_RESOURCES})
add_definitions(
-Wall
-O3
-march=native)
# sortie complete make
set(
CMAKE_VERBOSE_MAKEFILE
OFF)
# fixe le chemin de liaison dans la section dynamique elf
set(
CMAKE_INSTALL_RPATH
"${CMAKE_INSTALL_PREFIX}/lib")
# remplit la section RPATH du binaire au moment de l'installation
set(
CMAKE_INSTALL_RPATH_USE_LINK_PATH
TRUE)
# demande la duplication du RPATH vers RUNPATH
set(
CMAKE_EXE_LINKER_FLAGS
"-Wl,--enable-new-dtags")
add_executable(
${PROJECT_NAME}
${JIGUIVIOU_SOURCES}
${JIGUIVIOU_RESOURCES_RCC})
target_link_libraries(
${PROJECT_NAME}
ihm
gev
gvcp
gvsp
genicam
gstreamerbackend
${QT_LIBRARIES})
install(TARGETS
${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)
find_program(
FILECAP_EXECUTABLE
filecap)
if(FILECAP_EXECUTABLE)
set(FILECAP_FOUND true)
else(FILECAP_EXECUTABLE)
message(WARNING "failed to find filecap, ${PROJECT_NAME} will not have capacities net_raw !")
set(FILECAP_FOUND false)
endif(FILECAP_EXECUTABLE)
install(
CODE
"if(${FILECAP_FOUND} STREQUAL \"true\")
message(STATUS \"doing filecap ${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME} net_raw\")
execute_process (
COMMAND ${FILECAP_EXECUTABLE} ${CMAKE_INSTALL_PREFIX}/bin/${PROJECT_NAME} net_raw
RESULT_VARIABLE FILECAP_RESULT)
if(FILECAP_RESULT)
message( WARNING \"filecap failed !\")
endif()
else()
message( WARNING \"filecap failed, can't find cap-ng !\")
endif()"
)