source: pacpussensors/trunk/Ladybug/CMakeLists.txt@ 132

Last change on this file since 132 was 81, checked in by ndiasnak, 10 years ago

add ladybug interface component

File size: 4.5 KB
RevLine 
[81]1message ("********INICIO*********")
2project(LadybugCamera)
3
4################################################################################
5create_export(EXPORT_HDR ${PROJECT_NAME})
6
7################################################################################
8IF(WIN32)
9 SET(LADYBUG_ROOT_DIR "$ENV{LADYBUG_ROOT}")
10ELSE(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 )
16ENDIF(WIN32)
17
18FIND_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
23FIND_PATH(LADYBUG_LIB_DIR
24 NAMES "ladybug.lib" "LadybugGUI.lib"
25 PATHS "${LADYBUG_ROOT_DIRS}/lib/"
26 )
27
28# List of required modules
29set(LADYBUG_MODULES "ladybug" "LadybugGUI")
30
31set(LADYBUG_LIB_MISSING FALSE)
32set(LADYBUG_LIBRARIES "")
33
34# Check the presence of each module
35foreach(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()
47endforeach()
48
49################################################################################
50# Qt
51set(QT_USE_QTXML true)
52set(QT_USE_QTNETWORK true)
53include(${QT_USE_FILE})
54
55add_definitions(
56 ${QT_DEFINITIONS}
57)
58
59
60#########################################################
61# FIND OPENGL
62#########################################################
63find_package(OpenGL REQUIRED)
64include_directories(${OpenGL_INCLUDE_DIRS})
65link_directories(${OpenGL_LIBRARY_DIRS})
66add_definitions(${OpenGL_DEFINITIONS})
67if(NOT OPENGL_FOUND)
68 message(ERROR " OPENGL not found!")
69endif(NOT OPENGL_FOUND)
70
71################################################################################
72# Find dependencies
73find_package(OpenCV REQUIRED)
74if(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
80endif(OpenCV_FOUND)
81
82################################################################################
83# Include directories
84include_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
94link_directories(
95 ${PACPUS_LIB_DIR}
96 ${LADYBUG_LIB_DIR}
97 $ENV{OPENCV_LIB_DIR}
98)
99pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME})
100
101################################################################################
102# FILES
103set(HDRS
104 ${EXPORT_HDR}
105 ladybugComponent.h
106)
107
108set(SRCS
109 ladybugComponent.cpp
110 ${PLUGIN_CPP}
111)
112
113set(MOC_FILES
114 #Ladybug.h
115 ${PLUGIN_H}
116)
117
118set(UI_FILES
119)
120
121################################################################################
122# Call moc, uic
123qt_wrap_cpp(MOC_SRCS
124 ${MOC_FILES}
125)
126qt_wrap_ui(UI_SRCS
127 ${UI_FILES}
128)
129
130################################################################################
131# BUILD and LINK
132pacpus_add_library(${PROJECT_NAME} SHARED
133 ${SRCS}
134 ${HDRS}
135 ${MOC_SRCS}
136 ${UI_SRCS}
137)
138
139################################################################################
140# LIBS
141message(STATUS ${PACPUS_DEPENDENCIES_LIB})
142
143set(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)
154if (WIN32)
155 list(APPEND LIBS
156 optimized ROAD_TIME debug ROAD_TIME_d
157 )
158endif()
159
160################################################################################
161# LINK
162target_link_libraries(${PROJECT_NAME} ${LIBS})
163
164message ("******* LIBS: ${INTERFACE_LINK_LIBRARIES} FIM LIBS********")
165
166# PROPERTIES
167set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
168# FOLDERS
169pacpus_folder(${PROJECT_NAME} "components")
170
171################################################################################
172# INSTALL
173pacpus_install(${PROJECT_NAME})
174
175message ("*******FIM*******")
176
Note: See TracBrowser for help on using the repository browser.