1 | message ("********INICIO*********")
|
---|
2 | project(LadybugCamera)
|
---|
3 |
|
---|
4 | ################################################################################
|
---|
5 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
6 |
|
---|
7 | ################################################################################
|
---|
8 | IF(WIN32)
|
---|
9 | SET(LADYBUG_ROOT_DIR "$ENV{LADYBUG_ROOT}")
|
---|
10 | ELSE(WIN32)
|
---|
11 | SET(LADYBUG_ROOT_DIR
|
---|
12 | /usr/local # Linux: default dir by CMake
|
---|
13 | /usr # Linux
|
---|
14 | /opt/local # OS X: default MacPorts location
|
---|
15 | )
|
---|
16 | ENDIF(WIN32)
|
---|
17 |
|
---|
18 | FIND_PATH(LADYBUG_INCLUDE_DIR
|
---|
19 | NAMES "ladybug.h" "ladybuggeom.h" "ladybugGPS.h" "ladybugImageAdjustment.h" "ladybugrenderer.h" "ladybugsensors.h" "ladybugstream.h" "ladybugvideo.h" "pgrcameragui.h"
|
---|
20 | PATHS "${LADYBUG_ROOT_DIRS}/include/"
|
---|
21 | )
|
---|
22 |
|
---|
23 | FIND_PATH(LADYBUG_LIB_DIR
|
---|
24 | NAMES "ladybug.lib" "LadybugGUI.lib"
|
---|
25 | PATHS "${LADYBUG_ROOT_DIRS}/lib/"
|
---|
26 | )
|
---|
27 |
|
---|
28 | # List of required modules
|
---|
29 | set(LADYBUG_MODULES "ladybug" "LadybugGUI")
|
---|
30 |
|
---|
31 | set(LADYBUG_LIB_MISSING FALSE)
|
---|
32 | set(LADYBUG_LIBRARIES "")
|
---|
33 |
|
---|
34 | # Check the presence of each module
|
---|
35 | foreach(module ${LADYBUG_MODULES})
|
---|
36 | find_library(
|
---|
37 | LADYBUG_${module}_LIB
|
---|
38 | NAMES ${module}
|
---|
39 | HINTS ${LADYBUG_LIB_DIR}
|
---|
40 | )
|
---|
41 | if(LADYBUG_${module}_LIB)
|
---|
42 | list(APPEND LADYBUG_LIBRARIES general ${LADYBUG_${module}_LIB})
|
---|
43 | else()
|
---|
44 | message(SEND_ERROR "Cannot find Ladybug module ${module}")
|
---|
45 | set(LADYBUG_LIB_MISSING TRUE)
|
---|
46 | endif()
|
---|
47 | endforeach()
|
---|
48 |
|
---|
49 | ################################################################################
|
---|
50 | # Qt
|
---|
51 | set(QT_USE_QTXML true)
|
---|
52 | set(QT_USE_QTNETWORK true)
|
---|
53 | include(${QT_USE_FILE})
|
---|
54 |
|
---|
55 | add_definitions(
|
---|
56 | ${QT_DEFINITIONS}
|
---|
57 | )
|
---|
58 |
|
---|
59 |
|
---|
60 | #########################################################
|
---|
61 | # FIND OPENGL
|
---|
62 | #########################################################
|
---|
63 | find_package(OpenGL REQUIRED)
|
---|
64 | include_directories(${OpenGL_INCLUDE_DIRS})
|
---|
65 | link_directories(${OpenGL_LIBRARY_DIRS})
|
---|
66 | add_definitions(${OpenGL_DEFINITIONS})
|
---|
67 | if(NOT OPENGL_FOUND)
|
---|
68 | message(ERROR " OPENGL not found!")
|
---|
69 | endif(NOT OPENGL_FOUND)
|
---|
70 |
|
---|
71 | ################################################################################
|
---|
72 | # Find dependencies
|
---|
73 | find_package(OpenCV REQUIRED)
|
---|
74 | if(OpenCV_FOUND)
|
---|
75 | list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})
|
---|
76 | list(APPEND OpenCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS})
|
---|
77 |
|
---|
78 | #message ("Libs to add: ${OpenCV_LIBS}")
|
---|
79 |
|
---|
80 | endif(OpenCV_FOUND)
|
---|
81 |
|
---|
82 | ################################################################################
|
---|
83 | # Include directories
|
---|
84 | include_directories(
|
---|
85 | ${PACPUSINCLUDE_DIRECTORY}
|
---|
86 | ${PROJECT_BINARY_DIR}
|
---|
87 | ${QT_INCLUDE_DIR}
|
---|
88 | ${LADYBUG_INCLUDE_DIR}
|
---|
89 | ${OpenCV_INCLUDE_DIR}
|
---|
90 | )
|
---|
91 |
|
---|
92 | ################################################################################
|
---|
93 | # Link directories
|
---|
94 | link_directories(
|
---|
95 | ${PACPUS_LIB_DIR}
|
---|
96 | ${LADYBUG_LIB_DIR}
|
---|
97 | $ENV{OPENCV_LIB_DIR}
|
---|
98 | )
|
---|
99 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME})
|
---|
100 |
|
---|
101 | ################################################################################
|
---|
102 | # FILES
|
---|
103 | set(HDRS
|
---|
104 | ${EXPORT_HDR}
|
---|
105 | ladybugComponent.h
|
---|
106 | )
|
---|
107 |
|
---|
108 | set(SRCS
|
---|
109 | ladybugComponent.cpp
|
---|
110 | ${PLUGIN_CPP}
|
---|
111 | )
|
---|
112 |
|
---|
113 | set(MOC_FILES
|
---|
114 | #Ladybug.h
|
---|
115 | ${PLUGIN_H}
|
---|
116 | )
|
---|
117 |
|
---|
118 | set(UI_FILES
|
---|
119 | )
|
---|
120 |
|
---|
121 | ################################################################################
|
---|
122 | # Call moc, uic
|
---|
123 | qt_wrap_cpp(MOC_SRCS
|
---|
124 | ${MOC_FILES}
|
---|
125 | )
|
---|
126 | qt_wrap_ui(UI_SRCS
|
---|
127 | ${UI_FILES}
|
---|
128 | )
|
---|
129 |
|
---|
130 | ################################################################################
|
---|
131 | # BUILD and LINK
|
---|
132 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
133 | ${SRCS}
|
---|
134 | ${HDRS}
|
---|
135 | ${MOC_SRCS}
|
---|
136 | ${UI_SRCS}
|
---|
137 | )
|
---|
138 |
|
---|
139 | ################################################################################
|
---|
140 | # LIBS
|
---|
141 | message(STATUS ${PACPUS_DEPENDENCIES_LIB})
|
---|
142 |
|
---|
143 | set(LIBS
|
---|
144 | ${PACPUS_LIBRARIES}
|
---|
145 | ${QT_LIBRARIES}
|
---|
146 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
147 | ${OpenCV_LIBS}
|
---|
148 | optimized FileLib debug FileLib_d
|
---|
149 | optimized PacpusLib debug PacpusLib_d
|
---|
150 | optimized PacpusTools debug PacpusTools_d
|
---|
151 | ${LADYBUG_LIBRARIES}
|
---|
152 | ${OpenCV_LIBS}
|
---|
153 | )
|
---|
154 | if (WIN32)
|
---|
155 | list(APPEND LIBS
|
---|
156 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
157 | )
|
---|
158 | endif()
|
---|
159 |
|
---|
160 | ################################################################################
|
---|
161 | # LINK
|
---|
162 | target_link_libraries(${PROJECT_NAME} ${LIBS})
|
---|
163 |
|
---|
164 | message ("******* LIBS: ${INTERFACE_LINK_LIBRARIES} FIM LIBS********")
|
---|
165 |
|
---|
166 | # PROPERTIES
|
---|
167 | set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
|
---|
168 | # FOLDERS
|
---|
169 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
170 |
|
---|
171 | ################################################################################
|
---|
172 | # INSTALL
|
---|
173 | pacpus_install(${PROJECT_NAME})
|
---|
174 |
|
---|
175 | message ("*******FIM*******")
|
---|
176 |
|
---|