1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2019 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See http://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * ViSP configuration.
33 *
34 * Authors:
35 * Fabien Spindler
36 *
37 *****************************************************************************/
38
39#ifndef vpConfig_h
40#define vpConfig_h
41
42// To get access to EXIT_SUCCESS and EXIT_FAILURE
43#include <cstdlib>
44
45#if defined _MSC_VER && _MSC_VER >= 1200
46  #pragma warning( disable: 4100 4127 4251 4275 4351 4514 4668 4710 4820 )
47  #if _MSC_VER >= 1400 // 1400 = MSVC 8 2005
48    #pragma warning( disable: 4548 )
49  #endif
50  #if _MSC_VER > 1500 // 1500 = MSVC 9 2008
51    #pragma warning( disable: 4986 )
52  #endif
53  #ifdef WINRT
54    #pragma warning(disable:4447)
55  #endif
56
57  // 4100 : undocumented ("unreferenced formal parameter")
58  // 4127 : conditional expression is constant
59  // 4251 : 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2', ie. disable warnings related to inline functions
60  // 4275 : non – DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
61  // 4351 : new behavior: elements of array will be default initialized
62  // 4447 : Disable warning 'main' signature found without threading model
63  // 4514 : 'function' : unreferenced inline function has been removed
64  // 4548 : expression before comma has no effect
65  // 4668 : 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
66  // 4710 : 'function' : function not inlined
67  // 4820 : 'bytes' bytes padding added after construct 'member_name'
68  // 4986 : undocumented
69
70  #ifndef NOMINMAX
71    #define NOMINMAX
72  #endif
73#endif
74
75#if defined _MSC_VER && (_MSC_VER == 1500)
76// Visual Studio 9 2008 specific stuff
77// Fix running 64-bit OpenMP Debug Builds compiled with Visual Studio 2008 SP1
78// See discussion on https://gforge.inria.fr/forum/message.php?msg_id=149273&group_id=397
79// and the proposed fix: http://www.johanseland.com/2010/08/running-64-bit-openmp-debug-builds.html
80#  define _BIND_TO_CURRENT_OPENMP_VERSION 1
81#endif
82
83#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
84// Work arround to fix build issues that may occur with Mingw:
85// error: 'DBL_EPSILON' was not declared in this scope
86// error: 'FLT_EPSILON' was not declared in this scope
87
88#  include <float.h>
89
90#  ifndef DBL_EPSILON
91#    define DBL_EPSILON __DBL_EPSILON__
92#  endif
93#  ifndef FLT_EPSILON
94#    define FLT_EPSILON __FLT_EPSILON__
95#  endif
96#endif
97
98#include <visp3/visp_modules.h>
99
100// ViSP major version.
101#define VISP_VERSION_MAJOR ${VISP_VERSION_MAJOR}
102
103// ViSP minor version.
104#define VISP_VERSION_MINOR ${VISP_VERSION_MINOR}
105
106// ViSP patch version.
107#define VISP_VERSION_PATCH ${VISP_VERSION_PATCH}
108
109// ViSP version with dots "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}".
110#cmakedefine VISP_VERSION ${VISP_VERSION}
111
112// ViSP version as an integer
113#define VP_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
114#define VISP_VERSION_INT VP_VERSION_INT(VISP_VERSION_MAJOR, \
115                                        VISP_VERSION_MINOR, \
116                                        VISP_VERSION_PATCH)
117
118// Enable debug and trace printings
119#cmakedefine VP_TRACE
120#cmakedefine VP_DEBUG
121#cmakedefine VP_DEBUG_MODE ${VP_DEBUG_MODE}
122
123// ViSP library is either compiled static or shared
124// Used to set declspec(import, export) in headers if required under Windows
125#cmakedefine VISP_BUILD_SHARED_LIBS
126
127// Defined if deprecated functionalities are requested to build
128#cmakedefine VISP_BUILD_DEPRECATED_FUNCTIONS
129
130// Defined if MSVC is the compiler
131#cmakedefine VISP_USE_MSVC
132
133// Defined if Clipper is build and available.
134#cmakedefine VISP_HAVE_CLIPPER
135
136// Defined if AprilTag is build and available.
137#cmakedefine VISP_HAVE_APRILTAG
138
139// Defined if AprilTag big family (41h12, 48h12, 49h12, 52h13) known to produce long build time issue
140// with gcc < 5.5 in RelWithDebInfo and Visual Studio 12 2013 in Release are available
141#cmakedefine VISP_HAVE_APRILTAG_BIG_FAMILY
142
143// Defined if X11 library available.
144#cmakedefine VISP_HAVE_X11
145
146// Always define pugixml for compatibility.
147#define VISP_HAVE_PUGIXML
148
149// Defined if XML2 library available.
150#cmakedefine VISP_HAVE_XML2
151
152// Defined if pthread library available.
153#cmakedefine VISP_HAVE_PTHREAD
154
155// Defined if YARP available.
156#cmakedefine VISP_HAVE_YARP
157
158// Defined if OpenCV available.
159#cmakedefine VISP_HAVE_OPENCV
160
161// Defined if OpenCV nonfree module available. Only with OpenCV < 3.0.0
162#cmakedefine VISP_HAVE_OPENCV_NONFREE
163
164// Defined if OpenCV xfeatures2d module available. Only since OpenCV >= 3.0.0
165#cmakedefine VISP_HAVE_OPENCV_XFEATURES2D
166
167// Defined if OpenCV dnn module available.
168#cmakedefine VISP_HAVE_OPENCV_DNN
169
170// Defined if OpenCV objdetect module available.
171#cmakedefine VISP_HAVE_OPENCV_OBJDETECT
172
173// OpenCV version in hexadecimal (for example 2.1.0 gives 0x020100).
174#ifdef VISP_HAVE_OPENCV
175#  define VISP_HAVE_OPENCV_VERSION ${VISP_HAVE_OPENCV_VERSION}
176#endif
177
178// Defined if gtk+-2.0 library available
179#cmakedefine VISP_HAVE_GTK
180
181// Defined if GDI (Graphics Device Interface) library available
182#cmakedefine VISP_HAVE_GDI
183
184// Defined if Direct3D9 library available
185#cmakedefine VISP_HAVE_D3D9
186
187// Defined if one of the display device is available
188#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK)
189#  define VISP_HAVE_DISPLAY
190#endif
191
192// Defined if Catch2 library available
193#cmakedefine VISP_HAVE_CATCH2
194
195// Defined if Eigen3 library available
196#cmakedefine VISP_HAVE_EIGEN3
197
198// Defined if Intel MKL library available
199#cmakedefine VISP_HAVE_MKL
200#ifdef VISP_HAVE_MKL
201#define VISP_HAVE_LAPACK_MKL
202#endif
203
204// Defined if OpenBLAS library available
205#cmakedefine VISP_HAVE_OPENBLAS
206#ifdef VISP_HAVE_OPENBLAS
207#define VISP_HAVE_LAPACK_OPENBLAS
208#endif
209
210// Defined if Atlas library available
211#cmakedefine VISP_HAVE_ATLAS
212#ifdef VISP_HAVE_ATLAS
213#define VISP_HAVE_LAPACK_ATLAS
214#endif
215
216// Defined if Netlib library available (-lblas -llapack)
217#cmakedefine VISP_HAVE_NETLIB
218#ifdef VISP_HAVE_NETLIB
219#define VISP_HAVE_LAPACK_NETLIB
220#endif
221
222// Defined if GSL library available (-lgsl -lgslcblas)
223#cmakedefine VISP_HAVE_GSL
224#ifdef VISP_HAVE_GSL
225#define VISP_HAVE_LAPACK_GSL
226#endif
227
228// Defined if lapack/blas libraries are available (MKL, OpenBLAS, Atlas, Netlib or built-in)
229#cmakedefine VISP_HAVE_LAPACK
230// To keep compat with previous versions
231#ifdef VISP_HAVE_NETLIB
232#  define VISP_HAVE_LAPACK_C
233#endif
234
235// Defined if clapack built-in
236#cmakedefine VISP_HAVE_LAPACK_BUILT_IN
237
238// Defined the path to the basic scenes used by the simulator
239#cmakedefine VISP_SCENES_DIR "${VISP_SCENES_DIR}"
240
241// Defined the path to the robot's arms 3D model used by the robot simulators
242#cmakedefine VISP_ROBOT_ARMS_DIR "${VISP_ROBOT_ARMS_DIR}"
243
244// Defined if Ogre3d is available.
245#cmakedefine VISP_HAVE_OGRE
246
247// Defined if Ogre3d plugins.cfg is available.
248#cmakedefine VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_HAVE_OGRE_PLUGINS_PATH}"
249
250// Defined if Ogre3d resources.cfg is available.
251#cmakedefine VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}"
252
253// Defined if OIS (Object Oriented Input System) library available.
254#cmakedefine VISP_HAVE_OIS
255
256// Defined if Coin3D and one of the GUI (SoXt, SoWin, SoQt + Qt)
257// libraries are available.
258#cmakedefine VISP_HAVE_COIN3D_AND_GUI
259// provided for compat with previous releases
260#ifdef VISP_HAVE_COIN3D_AND_GUI
261#  define VISP_HAVE_COIN_AND_GUI
262#endif
263
264// Defined if Coin3D library available.
265#cmakedefine VISP_HAVE_COIN3D
266// provided for compat with previous releases
267#ifdef VISP_HAVE_COIN3D
268#  define VISP_HAVE_COIN
269#endif
270
271// Defined if OpenGL library available.
272#cmakedefine VISP_HAVE_OPENGL
273
274// Defined if Qt library available (either Qt-3 or Qt-4).
275#cmakedefine VISP_HAVE_QT
276
277// Defined if SoQt library available.
278#cmakedefine VISP_HAVE_SOQT
279
280// Defined if SoWin library available.
281#cmakedefine VISP_HAVE_SOWIN
282
283// Defined if SoXt library available.
284#cmakedefine VISP_HAVE_SOXT
285
286// Defined if libjpeg library available.
287#cmakedefine VISP_HAVE_JPEG
288#ifdef VISP_HAVE_JPEG
289#  define VISP_HAVE_LIBJPEG
290#endif
291
292// Defined if libpng library available.
293#cmakedefine VISP_HAVE_PNG
294#ifdef VISP_HAVE_PNG
295#  define VISP_HAVE_LIBPNG
296#endif
297
298// Defined if libfreenect, libusb-1.0 and libpthread libraries available.
299#cmakedefine VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES
300
301// Defined if libfreenect library available.
302#cmakedefine VISP_HAVE_LIBFREENECT
303
304// Defined if libfreenect library in an old version package for
305// ubuntu 10.04 lucid is available.
306// This is a workaround useful to initialise vpKinect depending on the
307// libfreenect version
308//#ifdef VISP_HAVE_LIBFREENECT_OLD
309//  Freenect::Freenect<vpKinect> freenect;
310//  vpKinect & kinect = freenect.createDevice(0);
311//#else
312//  Freenect::Freenect freenect;
313//  vpKinect & kinect = freenect.createDevice<vpKinect>(0);
314//#endif
315#cmakedefine VISP_HAVE_LIBFREENECT_OLD
316
317// Defined if libusb-1.0 library available.
318#cmakedefine VISP_HAVE_LIBUSB_1
319
320// Defined if librealSense library is available.
321#cmakedefine VISP_HAVE_REALSENSE
322
323// Defined if librealSense2 library is available.
324#cmakedefine VISP_HAVE_REALSENSE2
325
326// Defined if raw1394 and dc1394-2.x libraries available.
327#cmakedefine VISP_HAVE_DC1394
328#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394)
329#  define VISP_HAVE_DC1394_2
330#endif
331
332// Defined if dc1394_camera_enumerate() is available in dc1394-2.x.
333// dc1394_camera_enumerate() was introduced after libdc1394-2.0.0-rc7.
334#cmakedefine VISP_HAVE_DC1394_CAMERA_ENUMERATE
335#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394_CAMERA_ENUMERATE)
336#  define VISP_HAVE_DC1394_2_CAMERA_ENUMERATE
337#endif
338
339// Defined if dc1394_find_cameras() is available in dc1394-2.x
340// dc1394_find_cameras() is still present until libdc1394-2.0.0-rc7.
341// This function was suppress and replace by dc1394_camera_enumerate()
342// in more recent releases.
343#cmakedefine VISP_HAVE_DC1394_FIND_CAMERAS
344#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394_FIND_CAMERAS)
345#  define VISP_HAVE_DC1394_2_FIND_CAMERAS
346#endif
347
348// Defined if CMU 1394 Digital Camera SDK available.
349#cmakedefine VISP_HAVE_CMU1394
350
351// Defined if Video For Linux Two available.
352#cmakedefine VISP_HAVE_V4L2
353
354// Defined if DirectShow library is available (only under Windows).
355#cmakedefine VISP_HAVE_DIRECTSHOW
356
357// Defined if FLIR FlyCapture SDK available.
358#cmakedefine VISP_HAVE_FLYCAPTURE
359
360// Defined if Basler Pylon SDK available.
361#cmakedefine VISP_HAVE_PYLON
362
363// Defined if IDS uEye SDK available.
364#cmakedefine VISP_HAVE_UEYE
365
366// Defined if Comedi (linux control and measurement cdevice interface) available.
367#cmakedefine VISP_HAVE_COMEDI
368
369// Defined if ATIDAQ-C is build and available.
370#cmakedefine VISP_HAVE_ATIDAQ
371
372// Defined if IIT force-torque SDK is available.
373#cmakedefine VISP_HAVE_FT_IIT_SDK
374
375// Defined if Irisa's Afma4 robot available.
376#cmakedefine VISP_HAVE_AFMA4
377
378// Defined if Irisa's Afma6 robot available.
379#cmakedefine VISP_HAVE_AFMA6
380
381// Defined if Irisa's Afma6 data files (camera intrinsic/extrinsic parameters) are available
382#cmakedefine VISP_HAVE_AFMA6_DATA
383#define VISP_AFMA6_DATA_PATH "${VISP_AFMA6_DATA_PATH}"
384
385// Defined if Biclops pan-tilt head available.
386#cmakedefine VISP_HAVE_BICLOPS
387#cmakedefine VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION
388
389// Defined if Irisa's Ptu-46 pan-tilt head available.
390#cmakedefine VISP_HAVE_PTU46
391
392// Defined if Flir PTU SDK is available to control Flir PTU robot.
393#cmakedefine VISP_HAVE_FLIR_PTU_SDK
394
395// Defined if Irisa's Viper S650 robot available.
396#cmakedefine VISP_HAVE_VIPER650
397
398// Defined if Inria's Viper650 data files (camera intrinsic/extrinsic parameters) are available
399#cmakedefine VISP_HAVE_VIPER650_DATA
400#define VISP_VIPER650_DATA_PATH "${VISP_VIPER650_DATA_PATH}"
401
402// Defined if Irisa's Viper S850 robot available.
403#cmakedefine VISP_HAVE_VIPER850
404
405// Defined if Inria's Viper850 data files (camera intrinsic/extrinsic parameters) are available
406#cmakedefine VISP_HAVE_VIPER850_DATA
407#define VISP_VIPER850_DATA_PATH "${VISP_VIPER850_DATA_PATH}"
408
409// Defined if libfranka from Franka Emika available to control Panda robot.
410#cmakedefine VISP_HAVE_FRANKA
411
412// libfranka version in hexadecimal (for example 0.5.0 gives 0x000500).
413#ifdef VISP_HAVE_FRANKA
414#  define VISP_HAVE_FRANKA_VERSION ${VISP_HAVE_FRANKA_VERSION}
415#endif
416
417// Defined if Kinova Jaco SDK is available to control Kinova robot.
418#cmakedefine VISP_HAVE_JACOSDK
419
420// Defined if the Aria library and (pthread, rt, dl libraries under Unix) is found.
421// These libraries are used to control Pioneer mobile robots.
422#cmakedefine VISP_HAVE_PIONEER
423
424// Defined if the Parrot ARSDK is found.
425// This library is used to control Bebop2 drone.
426#cmakedefine VISP_HAVE_ARSDK
427// Defined if the Parrot ARSDK is found but also ffmpeg to get camera stream.
428#cmakedefine VISP_HAVE_FFMPEG
429
430// Defined if Haption Virtuose SDK available.
431#cmakedefine VISP_HAVE_VIRTUOSE
432
433// Defined if qbdevice api from qb-robotics available.
434#cmakedefine VISP_HAVE_QBDEVICE
435
436// Defined if takktile2 api from Right Hand Robotics available.
437#cmakedefine VISP_HAVE_TAKKTILE2
438
439// Defined if linux/parport.h is available for parallel port usage.
440#cmakedefine VISP_HAVE_PARPORT
441
442// Defined if libzbar is available for bar code detection
443#cmakedefine VISP_HAVE_ZBAR
444
445// Defined if Point Cloud Library is available
446#cmakedefine VISP_HAVE_PCL
447
448// Defined if libdmtx is available for bar code detection
449#cmakedefine VISP_HAVE_DMTX
450
451// Defined if Doxygen documentation tool is found
452#cmakedefine VISP_HAVE_DOXYGEN
453
454// Defined if we want to compute interaction matrices by combining
455// other interaction matrices
456#cmakedefine VISP_MOMENTS_COMBINE_MATRICES
457
458// Defined if we want to use openmp
459#cmakedefine VISP_HAVE_OPENMP
460
461// Define c++ standard values also available in __cplusplus when gcc is used
462#define VISP_CXX_STANDARD_98 ${VISP_CXX_STANDARD_98}
463#define VISP_CXX_STANDARD_11 ${VISP_CXX_STANDARD_11}
464#define VISP_CXX_STANDARD_14 ${VISP_CXX_STANDARD_14}
465#define VISP_CXX_STANDARD_17 ${VISP_CXX_STANDARD_17}
466
467#define VISP_CXX_STANDARD ${VISP_CXX_STANDARD}
468
469// Defined to keep compat with previous releases when c++ 11 available
470#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
471#  define VISP_HAVE_CXX11
472#  define VISP_HAVE_CPP11_COMPATIBILITY
473#endif
474
475// Defined if isnan macro is available
476#cmakedefine VISP_HAVE_FUNC_ISNAN
477
478// Defined if std::isnan function is available
479#cmakedefine VISP_HAVE_FUNC_STD_ISNAN
480
481// Defined if _isnan (Microsoft version) is available
482#cmakedefine VISP_HAVE_FUNC__ISNAN
483
484// Defined if isinf macro is available
485#cmakedefine VISP_HAVE_FUNC_ISINF
486
487// Defined if std::isinf function is available
488#cmakedefine VISP_HAVE_FUNC_STD_ISINF
489
490// Defined if _finite (Microsoft version) function is available
491#cmakedefine VISP_HAVE_FUNC__FINITE
492
493// Defined if round function is available
494#cmakedefine VISP_HAVE_FUNC_ROUND
495
496// Defined if std::round function is available
497#cmakedefine VISP_HAVE_FUNC_STD_ROUND
498
499// Defined if erfc function is available
500#cmakedefine VISP_HAVE_FUNC_ERFC
501
502// Defined if std::erfc function is available
503#cmakedefine VISP_HAVE_FUNC_STD_ERFC
504
505// Defined if strtof function is available
506#cmakedefine VISP_HAVE_FUNC_STRTOF
507
508// Defined if log1p function is available
509#cmakedefine VISP_HAVE_FUNC_LOG1P
510
511// Defined if inet_ntop function is available
512#cmakedefine VISP_HAVE_FUNC_INET_NTOP
513
514// Defined if xrandr program available
515#cmakedefine VISP_HAVE_XRANDR
516
517// Handle portable symbol export.
518// Defining manually which symbol should be exported is required
519// under Windows whether MinGW or MSVC is used.
520//
521// The headers then have to be able to work in two different modes:
522// - dllexport when one is building the library,
523// - dllimport for clients using the library.
524//
525// On Linux, set the visibility accordingly. If C++ symbol visibility
526// is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility
527# if defined(_WIN32) || defined(__CYGWIN__)
528// On Microsoft Windows, use dllimport and dllexport to tag symbols.
529#  define VISP_DLLIMPORT __declspec(dllimport)
530#  define VISP_DLLEXPORT __declspec(dllexport)
531#  define VISP_DLLLOCAL
532# else
533// On Linux, for GCC >= 4, tag symbols using GCC extension.
534#  if __GNUC__ >= 4
535#   define VISP_DLLIMPORT __attribute__ ((visibility("default")))
536#   define VISP_DLLEXPORT __attribute__ ((visibility("default")))
537#   define VISP_DLLLOCAL  __attribute__ ((visibility("hidden")))
538#  else
539// Otherwise (GCC < 4 or another compiler is used), export everything.
540#   define VISP_DLLIMPORT
541#   define VISP_DLLEXPORT
542#   define VISP_DLLLOCAL
543#  endif // __GNUC__ >= 4
544# endif // defined(_WIN32) || defined(__CYGWIN__)
545
546// Under Windows, for shared libraries (DLL) we need to define export on
547// compilation or import on use (like a third party project).
548// We exploit here the fact that cmake auto set xxx_EXPORTS (with S) on
549// compilation.
550#if defined(VISP_BUILD_SHARED_LIBS)
551// Depending on whether one is building or using the
552// library define VISP_EXPORT to import or export.
553#  ifdef visp_EXPORTS
554#    define VISP_EXPORT VISP_DLLEXPORT
555#  else
556#    define VISP_EXPORT VISP_DLLIMPORT
557#  endif
558#  define VISP_LOCAL VISP_DLLLOCAL
559#else
560// If one is using the library statically, get rid of
561// extra information.
562#  define VISP_EXPORT
563#  define VISP_LOCAL
564#endif
565
566// Add the material to produce a warning when deprecated functions are used
567#ifndef vp_deprecated
568#  if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
569#    define vp_deprecated __attribute__((deprecated))
570#  else
571#    define vp_deprecated __declspec(deprecated)
572#  endif
573#endif
574
575#endif
576
577
578