pax_global_header00006660000000000000000000000064126412644200014513gustar00rootroot0000000000000052 comment=f95bb9f162200adcfc64176ae80a135509fbe091 visp-3.0.0/000077500000000000000000000000001264126442000124745ustar00rootroot00000000000000visp-3.0.0/.gitignore000066400000000000000000000000751264126442000144660ustar00rootroot00000000000000*~ */CMakeFiles CMakeCache.txt .DS_Store CMakeLists.txt.user*visp-3.0.0/.travis.yml000066400000000000000000000040501264126442000146040ustar00rootroot00000000000000language: cpp os: - linux - osx env: - VISP_INPUT_IMAGE_PATH=${TRAVIS_BUILD_DIR} compiler: - gcc - clang sudo: required dist: trusty before_install: - cd ${TRAVIS_BUILD_DIR} && { curl -O http://visp-doc.inria.fr/download/dataset/ViSP-images-3.0.0.zip ; cd -; } - unzip ${TRAVIS_BUILD_DIR}/ViSP-images-3.0.0.zip -d ${TRAVIS_BUILD_DIR} # Get libs for OSX - "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew update; fi" #- "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew tap homebrew/science; fi" #- "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew install opencv3; fi" - "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew install libxml2 libdc1394 gsl; fi" # Get libs for Linux - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get update -qq; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq cmake libopencv-dev libx11-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq liblapack-dev libgsl0-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libdc1394-22-dev libv4l-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libcoin80-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libxml2-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libjpeg-dev libpng12-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libswscale-dev libavutil-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libavformat-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libavcodec-dev libbz2-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libogre-1.9-dev libois-dev; fi" - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libzbar-dev libdmtx-dev; fi" before_script: - mkdir build - cd build - cmake .. # Show 3rd parties that are detected - cat ViSP-third-party.txt script: - make - ctest notifications: email: - Fabien.Spindler@inria.fr on_success: change on_failure: always visp-3.0.0/CMakeLists.txt000066400000000000000000000757121264126442000152500ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP overall configuration file. Detect third party libraries (X11, GTK, ...) # # Authors: # Fabien Spindler # ############################################################################# # Need to be befor project(VISP) to work if(WIN32) set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") endif() project(VISP C CXX) cmake_minimum_required(VERSION 2.8.3) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") include(cmake/VISPUtils.cmake) vp_clear_vars(VISPModules_TARGETS) #----------------------------------------------------------------------------- # VISP version number. An even minor number corresponds to releases. set(VISP_VERSION_MAJOR "3") set(VISP_VERSION_MINOR "0") set(VISP_VERSION_PATCH "0") set(VISP_VERSION "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}") # Package revision number set(VISP_REVISION "1") find_file(GNU_INSTALL_DIRS_FROM_CMAKE NAMES GNUInstallDirs.cmake PATHS ${CMAKE_ROOT}/Modules) mark_as_advanced(GNU_INSTALL_DIRS_FROM_CMAKE) if(GNU_INSTALL_DIRS_FROM_CMAKE) include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake) else() include(cmake/GNUInstallDirs.cmake) endif() # the include directory we depend on set(VISP_INCLUDE_DIR ${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) set(VISP_DOC_DIR "${VISP_BINARY_DIR}/doc") # The location in which to install VISP libraries. set(LIBRARY_OUTPUT_PATH ${VISP_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) # The location in which to install some VISP binaries. set(BINARY_OUTPUT_PATH ${VISP_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) include_directories(${VISP_BINARY_DIR}/include) if(WIN32) # Postfix of .lib and .dll set(VISP_DEBUG_POSTFIX "d") set(VISP_DLLVERSION "${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}${VISP_VERSION_PATCH}") else() set(VISP_DEBUG_POSTFIX "") set(VISP_DLLVERSION "") endif() # ---------------------------------------------------------------------------- # Handle always full RPATH # http://www.cmake.org/Wiki/CMake_RPATH_handling # ---------------------------------------------------------------------------- # avoid CMP0042 warning if(APPLE) set(CMAKE_MACOSX_RPATH ON) endif() # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) # when building, don't use the install RPATH already # (but later on when installing) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") # add the automatically determined parts of the RPATH # which point to directories outside the build tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # the RPATH to be used when installing, but only if it's not a system directory list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir) if("${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") endif("${isSystemDir}" STREQUAL "-1") # ---------------------------------------------------------------------------- # Path for additional contrib modules # ---------------------------------------------------------------------------- set(VISP_CONTRIB_MODULES_PATH "" CACHE PATH "Where to look for additional contrib ViSP modules") # Get the OS set(OS ${CMAKE_SYSTEM_NAME}) set(OGRE_HOME $ENV{OGRE_HOME}) if(OGRE_HOME) # replace \ with / especially for windows STRING(REGEX REPLACE "\\\\" "/" OGRE_HOME ${OGRE_HOME}) endif() # add the path to detect Ogre3D if(WIN32) list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/CMake") endif(WIN32) if(UNIX) list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/cmake") list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/CMake") list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/OGRE/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/lib/OGRE/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/local/lib64/OGRE/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/lib64/OGRE/cmake") list(APPEND CMAKE_MODULE_PATH "/usr/share/OGRE/cmake/modules") endif(UNIX) #-------------------------------------------------------------------- # Option management #-------------------------------------------------------------------- # Choose static or shared libraries. VP_OPTION(BUILD_SHARED_LIBS "" "" "Build ViSP shared libraries (.dll/.so) instead of static ones (.lib/.a)" "" ON) # Build examples as an option. VP_OPTION(BUILD_EXAMPLES "" "" "Build ViSP examples" "" ON) # Build examples as an option. VP_OPTION(BUILD_TESTS "" "" "Build ViSP tests" "" ON) VP_OPTION(BUILD_COVERAGE "" "" "Enables test coverage" "" OFF IF (BUILD_TESTS AND CMAKE_COMPILER_IS_GNUCXX AND NOT BUILD_SHARED_LIBS AND CMAKE_BUILD_TYPE MATCHES "Debug")) # Build demos as an option. VP_OPTION(BUILD_DEMOS "" "" "Build ViSP demos" "" ON) # Build demos as an option. VP_OPTION(BUILD_TUTORIALS "" "" "Build ViSP tutorials" "" ON) # Build deprecated functions as an option. VP_OPTION(BUILD_DEPRECATED_FUNCTIONS "" "" "Build deprecated functionalities" "" ON) # Debug and trace cflags VP_OPTION(ACTIVATE_DEBUG_TRACE "" "" "Enable debug and trace printings" "" ON) VP_OPTION(BUILD_WITH_STATIC_CRT "" "" "Enables use of staticaly linked CRT for staticaly linked ViSP" "" ON IF MSVC) # Note that it is better to set MOMENTS_COMBINE_MATRICES to OFF VP_OPTION(MOMENTS_COMBINE_MATRICES "" "" "Use linear combination of matrices instead of linear combination of moments to compute interaction matrices." "MOMENTS_COMBINE_MATRICES" OFF) VP_OPTION(ENABLE_TEST_WITHOUT_DISPLAY "" "" "Don't use display features when testing" "ENABLE_TEST_WITHOUT_DISPLAY" ON) if(ENABLE_TEST_WITHOUT_DISPLAY) set(OPTION_TO_DESACTIVE_DISPLAY "-d") endif() # Check for Inria's robot drivers VP_CHECK_PACKAGE(RAW1394) VP_CHECK_PACKAGE(RT) VP_CHECK_PACKAGE(CALINUX) VP_CHECK_PACKAGE(IRISA) # Try to determine if Inria's NAS server hosting /udd/ is available VP_CHECK_PACKAGE(NAS) # check for linux/parport.h VP_CHECK_PACKAGE(PARPORT) # Find IsNaN VP_CHECK_PACKAGE(IsNaN) # Find IsInf VP_CHECK_PACKAGE(IsInf) # Find Round VP_CHECK_PACKAGE(Round) # OpenGL VP_CHECK_PACKAGE(OpenGL) # for pioneer VP_CHECK_PACKAGE(RT) VP_CHECK_PACKAGE(DL) VP_OPTION(USE_AFMA4 "" "" "Include Afma4 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) VP_OPTION(USE_AFMA6 "" "" "Include Afma6 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) VP_OPTION(USE_VIPER650 "" "" "Include Viper s650 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) VP_OPTION(USE_VIPER850 "" "" "Include Viper s850 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) VP_OPTION(USE_DC1394 DC1394 "" "Include dc1394 support" "" ON IF UNIX) VP_OPTION(USE_V4L2 V4L2 "" "Include v4l2 support" "" ON IF UNIX) VP_OPTION(USE_BICLOPS BICLOPS "" "Include biclops support" "" ON IF UNIX) VP_OPTION(USE_PTU46 PTU46 "" "Include ptu-46 support" "" ON IF UNIX) VP_OPTION(USE_CMU1394 CMU1394 "" "Include cmu1494 support" "" ON IF WIN32) VP_OPTION(USE_GDI GDI "" "Include gdi support" "" ON IF WIN32) VP_OPTION(USE_DIRECT3D DIRECT3D "" "Include d3d support" "" ON IF WIN32) VP_OPTION(USE_DIRECTSHOW DIRECTSHOW "" "Include dshow support" "" ON IF WIN32) VP_OPTION(USE_OPENMP OpenMP "" "Include openmp support" "" ON) VP_OPTION(USE_CPP11 CPP11 "" "Include c++11 support" "" OFF) # Since the FindLAPACK.cmake provided with CMake is for Fortran language, # in CMakeModules we have added FindLAPACK_C.cmake for C language VP_OPTION(USE_LAPACK LAPACK_C "" "Include lapack support" "" ON) VP_OPTION(USE_GSL GSL "" "Include gsl support" "" ON) VP_OPTION(USE_COIN3D "Coin3D;MyCoin3D" "" "Include coin3d support" "" ON IF OPENGL_FOUND) VP_OPTION(USE_YARP YARP QUIET "Include yarp support" "YARP_DIR" ON) VP_OPTION(USE_OGRE OGRE QUIET "Include Ogre support" "OGRE_DIR" ON) VP_OPTION(USE_OIS OIS QUIET "Include Ogre/ois support" "OIS_DIR" ON IF USE_OGRE) VP_OPTION(USE_LIBFREENECT LIBFREENECT "" "Include libfreenect support" "" ON) VP_OPTION(USE_LIBUSB_1 LIBUSB_1 "" "Include libusb-1 support" "" ON) VP_OPTION(USE_SOWIN SOWIN "" "Include Coin/SoWin support" "" OFF IF (WIN32 AND USE_COIN3D)) VP_OPTION(USE_SOQT SOQT "" "Include Coin/SoQt support" "" OFF IF USE_COIN3D) VP_OPTION(USE_QT Qt "" "Include Coin/SoQt/Qt support" "" ON IF USE_SOQT) VP_OPTION(USE_SOXT SOXT "" "Include Coin/SoXt support" "" OFF IF USE_COIN3D) VP_OPTION(USE_PTHREAD PTHREAD "" "Include pthread support" "" ON) VP_OPTION(USE_XML2 XML2 "" "Include xml support" "" ON) VP_OPTION(USE_OPENCV OpenCV QUIET "Include OpenCV support" "OpenCV_DIR;OpenCV_FOUND;OPENCV_FOUND" ON) VP_OPTION(USE_ZLIB "ZLIB;MyZLIB" "" "Include zlib support" "" ON) VP_OPTION(USE_X11 X11 "" "Include X11 support" "" ON) # The native FindGTK2.cmake doesn't consider libgobject-2.0 that is # requested by ViSP. That's why we use our FindMyGTK2.cmake VP_OPTION(USE_GTK2 MyGTK2 "" "Include gtk2 support" "" OFF) VP_OPTION(USE_JPEG "JPEG;MyJPEG" "" "Include jpeg support" "" ON) VP_OPTION(USE_PNG "PNG;MyPNG" "" "Include png support" "" ON) VP_OPTION(USE_FFMPEG FFMPEG "" "Include ffmpeg support" "" OFF) # To control Pioneer mobile robots, under UNIX we need Aria, pthread, rt and dl 3rd party libraries VP_OPTION(USE_ARIA ARIA "" "Include aria support" "" ON) #VP_OPTION(USE_RT RT "" "Include rt support" "" ON) #VP_OPTION(USE_DL DL "" "Include dl support" "" ON) # bar codes VP_OPTION(USE_ZBAR ZBAR "" "Include zbar support" "" ON) VP_OPTION(USE_DMTX DMTX "" "Include dmtx support" "" ON) #---------------------------------------------------------------------- # For Dart server and tests # We use CDash set through CTestConfig.cmake file # Dashboards are sent to http://cdash.irisa.fr/CDash/index.php?project=ViSP #---------------------------------------------------------------------- if(BUILD_TESTS) enable_testing() mark_as_advanced(DART_ROOT) mark_as_advanced(BUILD_TESTING) endif() #---------------------------------------------------------------------- # Try to find doxygen for documentation generation # Use "make visp_doc" target to generate the documentation #---------------------------------------------------------------------- find_package(Doxygen) if(DOXYGEN_FOUND) set(VISP_HAVE_DOXYGEN "yes") # for header vpConfig.h set(VISP_HAVE_DOXYGEN_FOUND "yes") # for ViSP-third-party.txt ## we need latex for doxygen because of the formulas find_package(LATEX) if(NOT LATEX_COMPILER) message(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user interaction on doxy run.") endif() if(NOT MAKEINDEX_COMPILER) message(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.") endif() if(NOT DVIPS_CONVERTER) message(STATUS "dvips command DVIPS_CONVERTER not found but usually required.") endif() configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in ${VISP_DOC_DIR}/config-doxygen @ONLY ) configure_file(${VISP_SOURCE_DIR}/doc/mainpage.doc.in ${VISP_DOC_DIR}/mainpage.doc @ONLY ) else() set(VISP_HAVE_DOXYGEN "no") # for header vpConfig.h set(VISP_HAVE_DOXYGEN_FOUND "no") # for ViSP-third-party.txt endif() # ---------------------------------------------------------------------------- # Solution folders: # ---------------------------------------------------------------------------- if(MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) option(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" ON) endif() if(ENABLE_SOLUTION_FOLDERS) set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets") endif() # Extra ViSP targets: uninstall, etc. include(cmake/VISPExtraTargets.cmake) include(CheckLibraryExists) # ---------------------------------------------------------------------------- # Check for system libs # ---------------------------------------------------------------------------- if(UNIX) # try to found -lm requested on some platforms to link with X11 find_library(M_LIBRARY NAMES m) mark_as_advanced(M_LIBRARY) if(M_LIBRARY) list(APPEND VISP_LINKER_LIBS ${M_LIBRARY}) endif() # try to found -lsocket -lnsl requested for vpNetwork and vpSickLDMRS find_library(SOCKET_LIBRARY NAMES socket) find_library(NSL_LIBRARY NAMES nsl) mark_as_advanced(SOCKET_LIBRARY NSL_LIBRARY) if (SOCKET_LIBRARY) list(APPEND VISP_LINKER_LIBS ${SOCKET_LIBRARY}) endif() if (NSL_LIBRARY) list(APPEND VISP_LINKER_LIBS ${NSL_LIBRARY}) endif() endif() #---------------------------------------------------------------------- # Add definitions #---------------------------------------------------------------------- # With Visual Studio 2005, Microsoft deprecates the standard C library, for # example fopen() and sprintf(), to non-portable functions fopen_s() and # sprintf_s(). These functions are considered by Microsoft more secure. This is # a worthwhile exercise ! The use of these deprecated functions causes a lot of # warnings. To suppress it, we add the _CRT_SECURE_NO_DEPRECATE preprocessor # definition if(WIN32 AND MSVC) add_definitions("-D_CRT_SECURE_NO_DEPRECATE") endif() #---------------------------------------------------------------------- # Use statically or dynamically linked CRT? # Default: dynamic #---------------------------------------------------------------------- if(MSVC) include(cmake/VISPCRTLinkage.cmake) endif(MSVC) #---------------------------------------------------------------------- # Platform specific #---------------------------------------------------------------------- include(cmake/VISPDetectPlatform.cmake) # Set the path where to install the lib if(WIN32) if(DEFINED VISP_RUNTIME AND DEFINED VISP_ARCH) set(VISP_INSTALL_BINARIES_PREFIX "${VISP_ARCH}/${VISP_RUNTIME}/") else() message(STATUS "Can't detect runtime and/or arch") set(VISP_INSTALL_BINARIES_PREFIX "") endif() else() set(VISP_INSTALL_BINARIES_PREFIX "") endif() # where to install the library if(WIN32) if(VISP_STATIC) set(VISP_LIB_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}") else() set(VISP_LIB_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}") endif() set(VISP_BIN_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_BINDIR}") else() set(VISP_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}) set(VISP_BIN_INSTALL_PATH ${CMAKE_INSTALL_BINDIR}) endif() #---------------------------------------------------------------------- # Configure the files that depend on the build or # installation usage. This is the case of: # vpConfig.h #---------------------------------------------------------------------- # case 1: when ViSP is build with make; files are used in #-------------- set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${VISP_BINARY_DIR}") set(VISP_SCENES_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/wireframe-simulator) set(VISP_ROBOT_ARMS_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/robot-simulator) # case 2: when ViSP is build with make install; files are used in #-------------- IF(UNIX) set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}") ELSE() set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}") ENDIF() list(APPEND VISP_SCENES_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/wireframe-simulator) list(APPEND VISP_ROBOT_ARMS_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/robot-simulator) # Only if resources.cfg created by hand, we change the path to resources.cfg in install/vpConfig.h if(VISP_INSTALL_DIR_OGRE_RESOURCES) list(APPEND VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/ogre-simulator") endif() # append to VISP_HAVE_OGRE_PLUGINS_PATH the path of the installed plugins.cfg file # to be able to use ViSP from build tree or install tree if(VISP_INSTALL_DIR_OGRE_RESOURCES) list(APPEND VISP_HAVE_OGRE_PLUGINS_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator") endif() #---------------------------------------------------------------------- # Create and install visp-config.1.gz man page #---------------------------------------------------------------------- if(UNIX) FIND_PROGRAM(GZIP gzip) file(MAKE_DIRECTORY ${VISP_BINARY_DIR}/doc/man/man1) ADD_CUSTOM_COMMAND( OUTPUT ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz COMMAND ${GZIP} --best -c ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/man1/visp-config.1 > ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/man1/visp-config.1 ) ADD_CUSTOM_TARGET(man ALL DEPENDS ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz ) INSTALL(FILES ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1 PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) MARK_AS_ADVANCED(GZIP) endif() #---------------------------------------------------------------------- # Modules #---------------------------------------------------------------------- include(cmake/VISPModule.cmake) # process subdirectories add_subdirectory(modules) #----------------------------------------------------------------------------- # Add extra compilation flags under UNIX #----------------------------------------------------------------------------- include(cmake/AddExtraCompilationFlags.cmake) # should be called after FindOpenMP vp_add_extra_compilation_flags() #------------------------------------------------------------------------------- # specific things that need to be updated in vpConfig.h and ViSP-third-party.txt #------------------------------------------------------------------------------- VP_SET(VISP_HAVE_OPENMP TRUE IF USE_OPENMP) VP_SET(VISP_HAVE_OPENCV TRUE IF (BUILD_MODULE_visp_core AND USE_OPENCV)) VP_SET(VISP_HAVE_X11 TRUE IF (BUILD_MODULE_visp_core AND USE_X11)) VP_SET(VISP_HAVE_GTK TRUE IF (BUILD_MODULE_visp_core AND USE_GTK2)) VP_SET(VISP_HAVE_GDI TRUE IF (BUILD_MODULE_visp_core AND USE_GDI)) VP_SET(VISP_HAVE_D3D9 TRUE IF (BUILD_MODULE_visp_core AND USE_DIRECT3D)) VP_SET(VISP_HAVE_JPEG TRUE IF (BUILD_MODULE_visp_core AND USE_JPEG)) VP_SET(VISP_HAVE_PNG TRUE IF (BUILD_MODULE_visp_core AND USE_PNG)) VP_SET(VISP_HAVE_YARP TRUE IF (BUILD_MODULE_visp_core AND USE_YARP)) VP_SET(VISP_HAVE_GSL TRUE IF (BUILD_MODULE_visp_core AND USE_GSL)) VP_SET(VISP_HAVE_LAPACK_C TRUE IF (BUILD_MODULE_visp_core AND USE_LAPACK)) VP_SET(VISP_HAVE_PTHREAD TRUE IF (BUILD_MODULE_visp_core AND USE_PTHREAD)) VP_SET(VISP_HAVE_XML2 TRUE IF (BUILD_MODULE_visp_core AND USE_XML2)) VP_SET(VISP_HAVE_FFMPEG TRUE IF (BUILD_MODULE_visp_core AND USE_FFMPEG)) VP_SET(VISP_HAVE_OGRE TRUE IF (BUILD_MODULE_visp_ar AND USE_OGRE)) VP_SET(VISP_HAVE_OIS TRUE IF (BUILD_MODULE_visp_ar AND USE_OIS)) VP_SET(VISP_HAVE_COIN3D TRUE IF (BUILD_MODULE_visp_ar AND USE_COIN3D)) VP_SET(VISP_HAVE_SOWIN TRUE IF (BUILD_MODULE_visp_ar AND USE_SOWIN)) VP_SET(VISP_HAVE_SOXT TRUE IF (BUILD_MODULE_visp_ar AND USE_SOXT)) VP_SET(VISP_HAVE_SOQT TRUE IF (BUILD_MODULE_visp_ar AND USE_SOQT)) VP_SET(VISP_HAVE_QT TRUE IF (BUILD_MODULE_visp_ar AND USE_QT)) VP_SET(VISP_HAVE_ZBAR TRUE IF (BUILD_MODULE_visp_detection AND USE_ZBAR)) VP_SET(VISP_HAVE_DMTX TRUE IF (BUILD_MODULE_visp_detection AND USE_DMTX)) VP_SET(VISP_HAVE_AFMA4 TRUE IF (BUILD_MODULE_visp_robot AND USE_AFMA4)) VP_SET(VISP_HAVE_AFMA6 TRUE IF (BUILD_MODULE_visp_robot AND USE_AFMA6)) VP_SET(VISP_HAVE_VIPER650 TRUE IF (BUILD_MODULE_visp_robot AND USE_VIPER650)) VP_SET(VISP_HAVE_VIPER850 TRUE IF (BUILD_MODULE_visp_robot AND USE_VIPER850)) VP_SET(VISP_HAVE_BICLOPS TRUE IF (BUILD_MODULE_visp_robot AND USE_BICLOPS)) VP_SET(VISP_HAVE_PTU46 TRUE IF (BUILD_MODULE_visp_robot AND USE_PTU46)) #VP_SET(VISP_HAVE_PIONEER TRUE IF (BUILD_MODULE_visp_robot AND USE_ARIA)) if(BUILD_MODULE_visp_robot AND USE_ARIA) if(UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) set(VISP_HAVE_PIONEER TRUE) elseif(NOT UNIX) set(VISP_HAVE_PIONEER TRUE) endif() endif() VP_SET(VISP_HAVE_COIN3D TRUE IF (BUILD_MODULE_visp_robot AND USE_COIN3D)) VP_SET(VISP_HAVE_V4L2 TRUE IF (BUILD_MODULE_visp_sensor AND USE_V4L2)) VP_SET(VISP_HAVE_DC1394 TRUE IF (BUILD_MODULE_visp_sensor AND USE_DC1394)) VP_SET(VISP_HAVE_CMU1394 TRUE IF (BUILD_MODULE_visp_sensor AND USE_CMU1394)) VP_SET(VISP_HAVE_DIRECTSHOW TRUE IF (BUILD_MODULE_visp_sensor AND USE_DIRECTSHOW)) VP_SET(VISP_HAVE_LIBFREENECT TRUE IF (BUILD_MODULE_visp_sensor AND USE_LIBFREENECT)) VP_SET(VISP_HAVE_LIBUSB_1 TRUE IF (BUILD_MODULE_visp_sensor AND USE_LIBUSB_1)) #VP_SET(VISP_HAVE_COIN3D TRUE IF (BUILD_MODULE_visp_mbt AND USE_COIN3D)) VP_SET(VISP_BUILD_SHARED_LIBS TRUE IF BUILD_SHARED_LIBS) # for header vpConfig.h VP_SET(VISP_HAVE_DC1394_CAMERA_ENUMERATE TRUE IF (USE_DC1394 AND DC1394_CAMERA_ENUMERATE_FOUND)) # for header vpConfig.h VP_SET(VISP_HAVE_DC1394_FIND_CAMERAS TRUE IF (USE_DC1394 AND DC1394_FIND_CAMERAS_FOUND)) # for header vpConfig.h VP_SET(VISP_HAVE_D3D9 TRUE IF USE_DIRECT3D) # for header vpConfig.h VP_SET(VISP_HAVE_GTK TRUE IF USE_GTK2) # for header vpConfig.h # Check if libfreenect dependencies (ie libusb-1.0 and libpthread) are available if(USE_LIBFREENECT AND USE_LIBUSB_1 AND USE_PTHREAD) if(LIBFREENECT_FOUND AND LIBUSB_1_FOUND AND PTHREAD_FOUND) set(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES TRUE) set(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES_FOUND "yes") # for ViSP-third-party.txt # The material is found. Check if libfreenect is an old version include(CheckCXXSourceCompiles) set(CMAKE_REQUIRED_LIBRARIES ${LIBFREENECT_LIBRARIES} ${PTHREAD_LIBRARIES} ${LIBUSB_1_LIBRARIES}) set(CMAKE_REQUIRED_INCLUDES ${LIBFREENECT_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIRS} ${LIBUSB_1_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES(" #include class vpMyKinect : public Freenect::FreenectDevice { }; int main() { Freenect::Freenect freenect; } " LIBFREENECT_IS_OLD_VERSION) #MESSAGE("LIBFREENECT_IS_OLD_VERSION: ${LIBFREENECT_IS_OLD_VERSION}") if(LIBFREENECT_IS_OLD_VERSION) set(VISP_HAVE_LIBFREENECT_OLD TRUE) # for header vpConfig.h else() set(VISP_HAVE_LIBFREENECT_OLD FALSE) # for header vpConfig.h endif() endif() endif() # check OpenCV nonfree modules and version if(USE_OPENCV) set(VISP_HAVE_OPENCV_VERSION "(${OpenCV_VERSION_MAJOR}*65536 + ${OpenCV_VERSION_MINOR}*256 + ${OpenCV_VERSION_PATCH})") # for vpConfig.h if(OpenCV_VERSION) if(OpenCV_VERSION VERSION_LESS "2.4.0") message(STATUS "opencv nonfree module found") set(VISP_HAVE_OPENCV_NONFREE TRUE) # for header vpConfig.h elseif(OPENCV_NONFREE_FOUND) # OpenCV < 3.0.0 message(STATUS "opencv xfeatures2d module found") set(VISP_HAVE_OPENCV_NONFREE TRUE) # for header vpConfig.h elseif(OPENCV_XFEATURES2D_FOUND) # OpenCV >= 3.0.0 set(VISP_HAVE_OPENCV_XFEATURES2D TRUE) # for header vpConfig.h else() message(STATUS "opencv nonfree or xfeature2d module not found") endif() else() message(STATUS "opencv nonfree not found") set(VISP_HAVE_OPENCV_VERSION "(0)") # for vpConfig.h endif() endif() # coin and gui set(VISP_HAVE_COIN3D_AND_GUI_FOUND "no") # for ViSP-third-party.txt set(VISP_HAVE_QT3_FOUND "no") # for ViSP-third-party.txt set(VISP_HAVE_QT4_FOUND "no") # for ViSP-third-party.txt if(USE_SOWIN) set(VISP_HAVE_COIN3D_AND_GUI TRUE) # for header vpConfig.h set(VISP_HAVE_COIN3D_AND_GUI_FOUND "yes") # for ViSP-third-party.txt elseif(USE_SOXT) set(VISP_HAVE_COIN3D_AND_GUI TRUE) # for header vpConfig.h set(VISP_HAVE_COIN3D_AND_GUI_FOUND "yes") # for ViSP-third-party.txt elseif(USE_SOQT AND USE_QT) set(VISP_HAVE_COIN3D_AND_GUI TRUE) # for header vpConfig.h set(VISP_HAVE_COIN3D_AND_GUI_FOUND "yes") # for ViSP-third-party.txt if(DESIRED_QT_VERSION MATCHES 3) set(VISP_HAVE_QT3_FOUND "yes") # for ViSP-third-party.txt elseif(DESIRED_QT_VERSION MATCHES 4) set(VISP_HAVE_QT4_FOUND "yes") # for ViSP-third-party.txt endif() endif() # Ogre plugins and resources if(USE_OGRE) include(cmake/OgreTools.cmake) vp_set_ogre_media() endif() # Find isnan macro (C-style) VP_SET(VISP_HAVE_FUNC_ISNAN TRUE IF HAVE_FUNC_ISNAN) # for header vpConfig.h # Find std::isnan function (cmath) VP_SET(VISP_HAVE_FUNC_STD_ISNAN TRUE IF HAVE_FUNC_STD_ISNAN) # for header vpConfig.h # Find _isnan function for MSVC VP_SET(VISP_HAVE_FUNC__ISNAN TRUE IF HAVE_FUNC__ISNAN) # for header vpConfig.h # Find isinf macro (C-style) VP_SET(VISP_HAVE_FUNC_ISINF TRUE IF HAVE_FUNC_ISINF) # for header vpConfig.h # Find std::isinf function (cmath) VP_SET(VISP_HAVE_FUNC_STD_ISINF TRUE IF HAVE_FUNC_STD_ISINF) # for header vpConfig.h # Find _finite function for MSVC VP_SET(VISP_HAVE_FUNC__FINITE TRUE IF HAVE_FUNC__FINITE) # for header vpConfig.h # Find round function (math.h) VP_SET(VISP_HAVE_FUNC_ROUND TRUE IF HAVE_FUNC_ROUND) # for header vpConfig.h # Find std::round function (cmath) VP_SET(VISP_HAVE_FUNC_STD_ROUND TRUE IF HAVE_FUNC_STD_ROUND) # for header vpConfig.h VP_SET(VISP_HAVE_ACCESS_TO_NAS TRUE IF NAS_FOUND) # for header vpConfig.h VP_SET(VISP_BUILD_DEPRECATED_FUNCTIONS TRUE IF BUILD_DEPRECATED_FUNCTIONS) # for header vpConfig.h VP_SET(MOMENTS_COMBINE_MATRICES TRUE IF VISP_MOMENTS_COMBINE_MATRICES) # for header vpConfig.h VP_SET(VISP_USE_MSVC TRUE IF MSVC) # for header vpConfig.h VP_SET(VISP_HAVE_CPP11_COMPATIBILITY TRUE IF USE_CPP11) # for header vpConfig.h VP_SET(VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION TRUE IF (USE_BICLOPS AND BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION)) # for header vpConfig.h if(USE_CPP11) set(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "yes") # for ViSP-third-party.txt else() set(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "no") # for ViSP-third-party.txt endif() # libraries for Pioneer mobile robots if(USE_ARIA AND UNIX) if(ARIA_FOUND AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) set(VISP_HAVE_PIONEER TRUE) # for header vpConfig.h set(VISP_HAVE_PIONEER_FOUND "yes") # for ViSP-third-party.txt endif() elseif(USE_ARIA AND NOT UNIX) set(VISP_HAVE_PIONEER TRUE) # for header vpConfig.h set(VISP_HAVE_PIONEER_FOUND "yes") # for ViSP-third-party.txt else() set(VISP_HAVE_PIONEER_FOUND "no") # for ViSP-third-party.txt endif() if(USE_AFMA4) set(VISP_HAVE_AFMA4_FOUND "yes") # for ViSP-third-party.txt else() set(VISP_HAVE_AFMA4_FOUND "no") # for ViSP-third-party.txt endif() if(USE_AFMA6) set(VISP_HAVE_AFMA6_FOUND "yes") # for ViSP-third-party.txt else() set(VISP_HAVE_AFMA6_FOUND "no") # for ViSP-third-party.txt endif() if(USE_VIPER650) set(VISP_HAVE_VIPER650_FOUND "yes") # for ViSP-third-party.txt else() set(VISP_HAVE_VIPER650_FOUND "no") # for ViSP-third-party.txt endif() if(USE_VIPER850) set(VISP_HAVE_VIPER850_FOUND "yes") # for ViSP-third-party.txt else() set(VISP_HAVE_VIPER850_FOUND "no") # for ViSP-third-party.txt endif() # ---------------------------------------------------------------------------- # Finalization: generate configuration-based files # ---------------------------------------------------------------------------- # Generate platform-dependent and configuration-dependent headers include(cmake/VISPGenerateHeaders.cmake) # Configure the file describing how to use ViSP. VISPConfig.cmake # is the main file configuring a CMake package. # . Exports build settings and dependencies for projects using ViSP as a # third party project. # . Create and install files for simple use of find_package(VISP) # by other cmakified "user" projects and libraries depending on ViSP. # (see "Mastering CMake", pp.72) # . To use ViSP in a third party project based on CMake: # find_package(VISP REQUIRED) # include_directories(${VISP_INCLUDE_DIRS}) # target_link_libraries( ${VISP_LIBRARIES}) include(cmake/VISPGenerateConfig.cmake) #---------------------------------------------------------------------- # For Dart server and tests # We use CDash set through CTestConfig.cmake file # Dashboards are sent to http://cdash.irisa.fr/CDash/index.php?project=ViSP #---------------------------------------------------------------------- if(BUILD_TESTS) include(CTest) endif() #---------------------------------------------------------------------- # For CPack packaging tool #---------------------------------------------------------------------- option(BUILD_PACKAGE "Configure ViSP packaging" OFF) if(BUILD_PACKAGE) if(UNIX AND NOT APPLE AND NOT WIN32) # =linux option(BUILD_PACKAGE_DEBIAN "Build debian package" ON) option(BUILD_PACKAGE_RPM "Build rpm package" ON) endif() include(cmake/CPackConfig.cmake) endif(BUILD_PACKAGE) #---------------------------------------------------------------------- # Generate the package dependent visp-config shell script for projects which # are not using CMake: # Usage: # visp-config --cflags ... #---------------------------------------------------------------------- include(cmake/VISPGeneratePkgConfigScript.cmake) #---------------------------------------------------------------------- # Propagation in sub dirs to build demo, example, test, tutorial #---------------------------------------------------------------------- set(VISP_DIR ${PROJECT_BINARY_DIR}) mark_as_advanced(VISP_DIR) mark_as_advanced(VISP_INCLUDE_DIRS) if(BUILD_DEMOS) add_subdirectory(demo) endif() if(BUILD_EXAMPLES) add_subdirectory(example) endif() if(BUILD_TUTORIALS) add_subdirectory(tutorial) endif() visp-3.0.0/CTestConfig.cmake000066400000000000000000000165761264126442000156650ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # CDash configuration. # # Authors: # Fabien Spindler # ############################################################################# set(CTEST_PROJECT_NAME "ViSP") set(CTEST_NIGHTLY_START_TIME "00:00:00 GMT") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "cdash.inria.fr") set(CTEST_DROP_LOCATION "/CDash/submit.php?project=ViSP") set(CTEST_DROP_SITE_CDASH TRUE) #-------------------------------------------------------------------- # BUILNAME variable construction # This variable will be used to set the build name which will appear # on the ViSP dashboard http://cdash.irisa.fr/CDash/ #-------------------------------------------------------------------- # Start with the short system name, e.g. "Linux", "FreeBSD" or "Windows" if(BUILDNAME) set(BUILDNAME "${BUILDNAME}-${CMAKE_SYSTEM_NAME}") else(BUILDNAME) # To suppress the first space if BUILDNAME is not set set(BUILDNAME "${CMAKE_SYSTEM_NAME}") endif(BUILDNAME) # Add i386 or amd64 if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(BUILDNAME "${BUILDNAME}-amd64") else() set(BUILDNAME "${BUILDNAME}-i386") endif() # Add the compiler name, e.g. "g++, msvc7..." if(MSVC70) set(BUILDNAME "${BUILDNAME}-msvc70") elseif(MSVC71) set(BUILDNAME "${BUILDNAME}-msvc71") elseif(MSVC80) set(BUILDNAME "${BUILDNAME}-msvc80") elseif(MSVC90) set(BUILDNAME "${BUILDNAME}-msvc90") elseif(MSVC10) set(BUILDNAME "${BUILDNAME}-msvc10") elseif(MSVC11) set(BUILDNAME "${BUILDNAME}-msvc11") elseif(MSVC12) set(BUILDNAME "${BUILDNAME}-msvc12") elseif(MSVC) set(BUILDNAME "${BUILDNAME}-msvc") elseif(BORLAND) set(BUILDNAME "${BUILDNAME}-borland") elseif(MINGW) set(BUILDNAME "${BUILDNAME}-mingw") else() # g++ set(BUILDNAME "${BUILDNAME}-${CMAKE_BASE_NAME}") endif() # Find out the version of gcc being used. if(CMAKE_COMPILER_IS_GNUCC) exec_program(${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE COMPILER_VERSION ) #message("COMPILER_VERSION 1: ${COMPILER_VERSION}") string(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9].*" "\\1\\2" COMPILER_VERSION ${COMPILER_VERSION}) #message("COMPILER_VERSION 2: ${COMPILER_VERSION}") set(BUILDNAME "${BUILDNAME}${COMPILER_VERSION}") endif(CMAKE_COMPILER_IS_GNUCC) # Add the type of library generation, e.g. "Dynamic or Static" if(BUILD_SHARED_LIBS) set(BUILDNAME "${BUILDNAME}-Dyn") else(BUILD_SHARED_LIBS) set(BUILDNAME "${BUILDNAME}-Sta") endif(BUILD_SHARED_LIBS) # Add the build type, e.g. "Debug, Release..." if(CMAKE_BUILD_TYPE) set(BUILDNAME "${BUILDNAME}-${CMAKE_BUILD_TYPE}") endif(CMAKE_BUILD_TYPE) #---- Robots ---- # Add specific Afma4 robots if(VISP_HAVE_AFMA4) set(BUILDNAME "${BUILDNAME}-Afma4") endif(VISP_HAVE_AFMA4) # Add specific Afma6 robots if(VISP_HAVE_AFMA6) set(BUILDNAME "${BUILDNAME}-Afma6") endif(VISP_HAVE_AFMA6) # Add specific Ptu46 robots if(VISP_HAVE_PTU46) set(BUILDNAME "${BUILDNAME}-Ptu46") endif(VISP_HAVE_PTU46) # Add specific Biclops robots if(VISP_HAVE_BICLOPS) set(BUILDNAME "${BUILDNAME}-Biclops") endif(VISP_HAVE_BICLOPS) # Add specific Pioneer robots if(VISP_HAVE_PIONEER) set(BUILDNAME "${BUILDNAME}-aria") endif() #---- Framegrabers ---- # Firewire dc1394-2.x if(VISP_HAVE_DC1394) set(BUILDNAME "${BUILDNAME}-dc1394") endif(VISP_HAVE_DC1394) # Video 4 linux 2 (V4L2) if(VISP_HAVE_V4L2) set(BUILDNAME "${BUILDNAME}-v4l2") endif(VISP_HAVE_V4L2) # Directshow if(VISP_HAVE_DIRECTSHOW) set(BUILDNAME "${BUILDNAME}-dshow") endif(VISP_HAVE_DIRECTSHOW) if(VISP_HAVE_CMU1394) set(BUILDNAME "${BUILDNAME}-CMU1394") endif(VISP_HAVE_CMU1394) if(VISP_HAVE_LIBFREENECT) set(BUILDNAME "${BUILDNAME}-freenect") endif() if(VISP_HAVE_LIBUSB_1) set(BUILDNAME "${BUILDNAME}-usb") endif() #---- Video-devices ---- # X11 if(VISP_HAVE_X11) set(BUILDNAME "${BUILDNAME}-X11") endif(VISP_HAVE_X11) # GTK if(VISP_HAVE_GTK) set(BUILDNAME "${BUILDNAME}-gtk") endif(VISP_HAVE_GTK) # GDI (Windows Graphics Device Interface) if(VISP_HAVE_GDI) set(BUILDNAME "${BUILDNAME}-gdi") endif(VISP_HAVE_GDI) # D3D (Direct3D9) if(VISP_HAVE_D3D9) set(BUILDNAME "${BUILDNAME}-Direct3D") endif(VISP_HAVE_D3D9) # OpenCV if(VISP_HAVE_OPENCV) if(OpenCV_VERSION) if(OPENCV_XFEATURES2D_FOUND OR OPENCV_XFEATURES2D_FOUND) set(BUILDNAME "${BUILDNAME}-OpenCV_contrib${OpenCV_VERSION}") else() set(BUILDNAME "${BUILDNAME}-OpenCV${OpenCV_VERSION}") endif() else() set(BUILDNAME "${BUILDNAME}-OpenCV") endif() endif(VISP_HAVE_OPENCV) #---- Mathematics ---- # Lapack (Linear Algebra PACKage) if(VISP_HAVE_LAPACK_C) set(BUILDNAME "${BUILDNAME}-lapack") endif() # GSL (Gnu Scientific Library) if(VISP_HAVE_GSL) set(BUILDNAME "${BUILDNAME}-gsl") endif(VISP_HAVE_GSL) #---- Simulator ---- # Ogre if(VISP_HAVE_OGRE) set(BUILDNAME "${BUILDNAME}-Ogre") endif() if(VISP_HAVE_OIS) set(BUILDNAME "${BUILDNAME}-OIS") endif() # Coin if(VISP_HAVE_COIN3D) set(BUILDNAME "${BUILDNAME}-Coin") endif(VISP_HAVE_COIN3D) # SoQt if(VISP_HAVE_SOQT) set(BUILDNAME "${BUILDNAME}-SoQt") endif(VISP_HAVE_SOQT) # Qt if(VISP_HAVE_QT) set(BUILDNAME "${BUILDNAME}-Qt${DESIRED_QT_VERSION}") endif(VISP_HAVE_QT) # SoWin if(VISP_HAVE_SOWIN) set(BUILDNAME "${BUILDNAME}-SoWin") endif(VISP_HAVE_SOWIN) # SoXt if(VISP_HAVE_SOXT) set(BUILDNAME "${BUILDNAME}-SoXt") endif(VISP_HAVE_SOXT) #---- Images ---- if(VISP_HAVE_FFMPEG) set(BUILDNAME "${BUILDNAME}-ffmpeg") endif(VISP_HAVE_FFMPEG) if(VISP_HAVE_JPEG) set(BUILDNAME "${BUILDNAME}-jpeg") endif(VISP_HAVE_JPEG) if(VISP_HAVE_PNG) set(BUILDNAME "${BUILDNAME}-png") endif(VISP_HAVE_PNG) #if(VISP_HAVE_ZLIB) # set(BUILDNAME "${BUILDNAME}-zlib") #endif() #---- Misc ---- # XML if(VISP_HAVE_XML2) set(BUILDNAME "${BUILDNAME}-xml") endif() # PThread if(VISP_HAVE_PTHREAD) set(BUILDNAME "${BUILDNAME}-pthread") endif() # OpenMP if(VISP_HAVE_OPENMP) set(BUILDNAME "${BUILDNAME}-OpenMP") endif() if(VISP_HAVE_DMTX) set(BUILDNAME "${BUILDNAME}-dmtx") endif() if(VISP_HAVE_ZBAR) set(BUILDNAME "${BUILDNAME}-zbar") endif() #---- Special compiler flags ---- if(ACTIVATE_WARNING_STRICT_OVERFLOW) set(BUILDNAME "${BUILDNAME}-Wov") endif() if(ACTIVATE_WARNING_FLOAT_EQUAL) set(BUILDNAME "${BUILDNAME}-Weq") endif() if(USE_CPP11) set(BUILDNAME "${BUILDNAME}-c11") endif() if(MOMENTS_COMBINE_MATRICES) set(BUILDNAME "${BUILDNAME}-Moment") endif() #---- Suffix contrib ---- if(VISP_CONTRIB_MODULES_PATH) set(BUILDNAME "${BUILDNAME}-contrib") endif() #message("BUILDNAME=${BUILDNAME}") visp-3.0.0/ChangeLog000066400000000000000000001315771264126442000142640ustar00rootroot00000000000000 ViSP Visual Servoing Platform Resume of the change log Copyright Projet Lagadic / IRISA-INRIA Rennes, 2005 - 2015 http://team.inria.fr/lagadic ViSP 3.0.0 (released December 18th, 2015) - New features . Compatibility with Windows 8.1 and 10 . Compatibility with Microsoft Visual C++ 2015 (MSCV 14) . Compatibility with Odroid XU4 . Source code migrates to GitHub: http://github.org/lagadic/visp . Introduce Travis continuous integration . New website: http://visp.inria.fr . Reorganize source in modules (core, vision, mbt, tt, …) with a library per module named libvisp_. Keep compat with previous releases. . Allow to link contributions to ViSP source code using VISP_CONTRIB_MODULES_PATH CMake var; see http://github.org/lagadic/visp_contrib . Model-based tracker: + New visibility tests based on the scanline rendering algorithm. + Improve Ogre3D visibility tests in order to use it in a probalistic approach via the setNbRayCastingAttemptsForVisibility() and setGoodNbRayCastingAttemptsRatio() functions. + Introduction of cylinder tracking with the model-based trackers using key points. + Improve the setPose() functionnality to use the given pose as a prediction of the key points position while using vpMbKltTracker and vpMbEdgeKltTracker. . Introduce vpArray2D template class that is inherited by all matrices and vectors. . vpKeyPoint class: + Full code compatibility with OpenCV 3.0. + Add support to the new Features introduce in OpenCV 3.0 and contrib module releases. + Add possibility to detect keypoints on an image pyramid with OpenCV 3.0. + Add possibility to change the image type (jpeg, png, ppm, pgm) when saving a learning file. + Add OpenMP support for Affine SIFT. + Add single matching filter (discard pairs of keypoints where multiple query keypoints are matched to the same train keypoints). + Add possibility to match train keypoints to query keypoints (could be useful when we learn only on one image, it allows to avoid to match background keypoints with train keypoints). + Optimize the FLANN matching by learning once the train descriptors instead of doing it at each call of the matching function (noticeable with large train descriptors). + Add possibility to use the FLANN matcher with binary descriptors. + Fix displayMatching function and fix small memory leak in loadLearningData. + Should be possible to read / write learning files in binary mode regardless of the endianness of the host (need to be tested on a real case). + Save learning files in XML mode with the full precision (according to the data type). . and a lot of improvements and fixes - Tutorials . New tutorial: Bridge over OpenCV . New tutorial: Installation from source with Homebrew . Update all the installation tutorials since GitHub migration and modules introduction and make more explicit 3rd party installation . Update tutorial: Markerless 3D model-based tracking - Bug fixed . [18748] Ogre and wireframe resources not found after ViSP installation . [18823] vpMatrix::kernel method returns false result if matrix has less rows than columns . [18939] vpParseArgv::ARGV_CONSTANT segfault . [19312] Model-based tracker unable to initialize the number of cylinder or circle from cao file . [19326] segfault when using vpDisplayX::init(unsigned int, unsigned int, ...) . [19368] Invalid rotation parameters in vpSimulatorViper850::getPosition() . [#3] Issue when comparing two vpRGBa . [#5] Unable to get calibration matrix K when model with distorsion is used . [#6] Issue with vpMath::round() . [#18] Issues with vpColVector::median() + with assignment operator of vpRowVector + with vpRowVector::normalize() function ---------------------------------------------- ViSP 2.10.0 (released February 13th, 2015) - New features . New object detection and localisation capabilities that allow to initialize for instance the model-based tracker (see tutorial). . New bar code detectors that uses libdmtx and libzbar (see tutorial): + vpDetectorQRcode class allows to detect QR codes + vpDetectorDataMatrixCode class allows to detect data matrices . New vpDetectorFace class that allows face detection based on OpenCV Haar cascade classifier capabilities (see tutorial) . New vpConvert class for type conversions from OpenCV to ViSP. . Model-based tracker: + Introduction of 3D circles that project as ellipses. + In *.cao files comments are allowed on lines starting with # character. + New functions getError() and getRobustWeights() useful to compute tracking quality indicators. + Introduction of setLod() for "level of detail" that checks if the size of the feature is large enough to be considered by the tracker. + Based on the rank of the interaction matrix turn off automatically the degrees of freedom that cannot be estimated. Especially useful when considering 3D objets with only cylinders and circles. + and many other improvements and fixes. . Video reader and writer support mpeg4. ffmpeg is no more requested in vpVideoReader and vpVideoWriter. If ffmpeg is not detected or installed we use OpenCV. . New vpXmlParserHomogeneousMatrix class to read/write homogeneous transformations from/to xml files . Auto detection of visp-images-data Debian or Ubuntu package that allows testing without setting VISP_INPUT_IMAGE_PATH . If OpenCV version >= 2.4.8 use only OpenCV C++ api. Classes that use IplImages as input are deprecated. . Compat with RaspberryPi architecture . Compat with OpenCV 3.x . Compat with Yarp 2.3.63 . Compat with CMake 3.x . Compat with MinGW w64 from http://mingw-w64.sourceforge.net/ - Tutorials . New tutorial to show how to install ViSP from Ubuntu official packages. . New tutorial to show how to install ViSP on CentOS. . New tutorial to show how to install ViSP on openSUSE. . New tutorial to show how to install ViSP on Raspberry Pi. . New tutorial to show how to install ViSP on Windows 8.1 with msvc. . New tutorial to show how to install ViSP on Windows 8.1 with mingw. . New keypoints matching tutorial. . New bar code detection tutorial. . New face detection tutorial. . New object detection and localization tutorial . Update KLT tracker tutorial to show how to initialize the tracker online. . Update blob tracker tutorial to show how to use v4l2 live camera. . Update model-based tracking tutorial for advanced usage. - Bug fixed . [17112] Error after second call to track() in vpMbEdgeTracker . [17212] vp1394TwoGrabber: unable to select a camera from its guid . [17457] Cannot apply a secondary task to a 7dof robot . [17550] Build error with ffmpeg libraries . [17620] vpXmlParserCamera::save() doesn't save the camera name and image size . [17644] vpDisplayX doesn't work on RaspberryPi . [17659] ViSP+Ogre3D+boost: libboost_chrono cannot be opened . [17705] Bad endianness support in vpDisplayX . [17766] Compat with cmake 3.0.0: failed due to new CMP0026 policy . [17972] Ogre examples are not working with Fedora 20 . [17983] Unable to build ViSP when an older version was previously installed . [18258] Stack overflow when using vpDot under Windows . [16895] undefined reference to `vpGaussRand::gaussianDraw()' . [18406] Infinite loop in `vpPose::poseRansac()' . [18446] Bad KLT points detection in vpMbKtlTracker and vpMbEdgeKltTracker. . [18451] Infinite loop in vpSimulatorViper850::stopMotion() . [18452] Empty filename check in vpImageIo, vpVideoReader, vpVideoWriter is erroneous . [18459] Error when initializing KLT related trackers but no key point is deteted. . [18471] Bad fov computation in vpCameraParameters. . [18550] Linking error with Homebrew install of OpenCV on MacOS ---------------------------------------------- ViSP 2.9.0 (released February 18th, 2014) - New features . Introduction of a new template tracker using SSD (vpTemplateTrackerSSD classes) or ZNCC (vpTemplateTrackerZNCC classes). These trackers are able to estimate 2D transformations such as translation, SRT (scale, rotation and translation), affine and homography. A video illustrating this tracker capabilities is available on: http://team.inria.fr/lagadic/visp/computer-vision.html . In vpServo introduction of a new controller able to ensure continuous sequencing - Improvements . Add missing const to member functions and arguments passed by reference. . Introduction of a new option BUILD_WITH_STATIC_CRT that allows to set /MT (default) or /MD msvc build option . Compatibility with mingw, msvc11 (2012), msvc12 (2013) and open solaris 11 . Trace and debug can now be enabled/disabled using CMake ACTIVATE_DEBUG_TRACE option . Fix errors detected by Covery Scan static code analyser . Fix warnings detected with Gnu g++ -Weffc++ -Wshadow compiler flags . Improve a lot of classes - New examples . New example that shows how to use the template tracker . A lot of new sample code provided in tutorial folder - New tutorials . Installation from source on Linux Fedora . Image filtering . Template tracking . Homography estimation from points . Keypoint matching . How to boost your visual servo control law . Debug and trace printings - Bug fixed . [16263] libopencv_nonfree for Surf not detected by CMake. . [16307] vpVideoReader::setLastFrameIndex() doesn't work. . [16371] No convergence in SVDcmp . [16465] FTBFS on armhf, ppc, s390: Errors while running CTest . [16696] Build with OpenCV fails with msvc (/MT conflicts with /MD) . [16781] Unable to open .pgm saved with Matlab imwrite . [16823] Problems with camera calibration code . [16889] Link error with CMU 1394 on win x64 arch . [16895] undefined reference to `vpGaussRand::gaussianDraw()' . [16919] Unable to link with OpenCV 2.4.8 under Windows . [16924] MinGW: unable to build ViSP as a shared library . [16928] vpVideoReader is unable to find the number of the first image from a generic sequence of images ---------------------------------------------- ViSP 2.8.0 (released July 24th, 2013) - New features . New camera calibration tool: example/camera_calibration.cpp - Improvements . vpV4l2Grabber and vp1394CMUGrabber does no more require a call to open(I). . In vp1394CMUGrabber new getters/setters for the framerate, shutter, gain. It is now possible to change the settings in the acquisition loop. . An exceptions is throwned when moving-edges are not initialized (vpMeTracker, vpMeLine, vpMeEllipse) . In model-based trackers, improve face visibility test using Ogre ray tracing when faces are concave or not oriented counter clockwise. . Still in model-based trackers, add functionalities to use clipping planes. . ViSP can now be used with pkg-config . New fonctions in vp1394TwoGrabber to turn auto shutter and auto gain on. Also new getter for auto shutter and auto gain min/max values. . Support Visual Studio 2012 (MSVC11) . Introduce C++ visibility support as described here http://gcc.gnu.org/wiki/Visibility . Better support of image formats: *.tiff, *.jpeg, *.bmp, *.pbm, ... - Examples . Introduction of tutorials as minimalist line by line illustrated examples. - Bug fixed . [15404] Segfault in vpMbTracker derived classes around Coin SoDB::init() and SoDB::finish() usage . [15410] Robot wireframe simulator hangs . [15422] Build issues with ffmpeg 1.0.1 third party . [15475] Segfault in cv::Mat(BGR) to vpImage(grey) conversion . [15522] Visibility tests issues in Model-Based Tracker using Ogre3D . [15566] Bad mask orientation when using model-based tracker with cylinders . [15587] visp-config conflicts with multiarch support on Debian . [15623] Possible ViSP-2.7.0 bugs detected by cppcheck . [15644] crash with vpRobotWireFrameSimulator::initScene() . [15679] vpDot and vpDot2 copy operator are incomplete . [15680] Bad pixel to meter conversion in vpFeatureLuminance . [15697] False positive exception in vpDisplay when vpDisplay::close() is used . [15730] ViSP-third-party.txt is installed in a wrong location . [15896] Ogre Boost components miss Boost.Filesystem . [15895] ViSP does not compile on FreeBSD (amd64 / i386) ---------------------------------------------- ViSP 2.7.0 (released February 11th, 2013) - New features - New vpViper650 and vpRobotViper650 classes to interface Inria's new Adept Viper s650 robot. - New robot simulators; vpSimulatorCamera, vpSimulatorPioneer, vpSimulatorPioneerPan - New model-based tracker using KLT points: vpMbKltTracker. - New hybrid model-based tracker using moving edges and KLT points: vpMbEdgeKltTracker - Improvements - Add visp-config.1 man page. - To respect Debian guidelines, remove duplicate ABI version. Library name was set to libvisp.a or libvisp.so.2.7.0 rather than libvisp-2.a or libvisp-2.so.2.7.0 - Fix typos detected by lintian - Add support for multiarch. Multiarch is the ability for a library to be installed concurrently for differents architectures (such as i386 and amd64 for instance). In practice, the changes removes the assumption made that libraries are installed in $INSTALL_PREFIX/lib and binaries in $INSTALL_PREFIX/bin. - In vp1394TwoGrabber that allows to grab images from firewire cameras, cameras are powered off when the grabber is closed. - MinGW is now supported but since MinGW currently doesn't support tls __declspec(thread) with vpDisplayGDI it is possible to open only one display. - To better organise the code, robot simulators inherit from vpRobotSimulator class. Introduction of a new vpRobotWireFrameSimulator class as a base class of robot simulated using the wireframe display capabilities. - VRML loader (based on Coin3D) now reads transform nodes and hierarchical scenes. - If Ogre3D is used, model-based trackers use now RayCasting to improve faces visibility test. - Compatibility with iOS 6 and Fedora 18 - Examples - New model-based tracker examples to show how to use the KLT and hybrid tracker. See in example/tracking mbtEdgeKltTracking.cpp and mbtKltTracking.cpp - Bug fixed - [14646] ViSP doesn't build on Windows with MinGW - [14651] Build error arround vpMatrix::pseudoInverse() with OpenCV 2.1.0 - [14661] Build error when GDI is not detected or turned off - [14818] Build error when only GTK display device is available - [14862] Lagrange pose estimation cannot handle planar objects with points in plane oX=d or oY=d - [14863] vpPose::poseRansac() can fail during Lagrange pose estimation - [14993] Segfault in mbtTracker example when only the cube is tracked - [15049] In vpFeatureSegment, bad interaction matrix associated to alpha angle - [15110] Segfault in ffmpeg video reader - [15291] Under Windows, the end of an image is not displayed ---------------------------------------------- ViSP 2.6.2 (released July 15, 2012) - New features - New vp1394CMUGrabber class that allows firewire frame acquisition under Windows using CMU 1394 Digital Camera 3rd party library. Thanks to Lucas Lopes Lemos and Guillaume Laurent from FEMTO-ST, AS2M departement, Besancon, France for this contribution. - New vpPioneer, vpPioneerPan, vpRobotPioneer classes to control Pioneer mobile robots using Aria 3rd party library. - New vpFeatureSegment class to consider a segment as a visual servoing feature. Normalized and non normalized features are considered. - New vpFeatureMomentArea class to consider moment area as a visual feature. - Introduction of new functionalities in vpIoTools to parse text config files - Introduction of YARP to ViSP image converters in vpImageConvert - New vpClient and vpServer classes for a multiclients TCP network. - New vpPoseFeatures class for pose computation from any visual features. To be able to consider other user defined features the compiler should be compatible with C++ 11 standart. - Improvements - Introduce a new Denavit Hartenberg representation of the Biclops head in vpBiclops. - Compatibility with g++ 4.7 and OpenCV 2.3.1, 2.4.0, 2.4.1 - Remove warning detected with Visual C++ /Wall flag - Use CMake native package finder for zlib, png, jpeg, coin3d, gtk2 and doxygen 3rd party libraries detection. If detection fails, we use our own package finder. - Under Windows, changes done to add "d" suffix to the library name when build in debug (libvisp-2d.lib and libvisp-2d.dll). Install stage copy libvisp-2[d].lib in $CMAKE_INSTALL_PREFIX/lib and libvisp-2[d].dll in $CMAKE_INSTALL_PREFIX/bin. - Use OpenMP to optimize the execution of the moments computation. - Possibility to compute the covariance matrix during pose estimation (vpPose and vpPoseFeatures) and model-based tracking (vpMbTracker). - All initClick() now have a non-blocking equivalent as initFromPoints(), or initFromPose(), etc. - Most of the classes that had a display() method now have the equivalent display in static function (display's externalisation). - Ransac is now improved for either pose computation or point matching. - Examples - New example plot3d.cpp to show how to plot 3D curves - New example movePioneer.cpp to illustrate Pioneer velocity control. - New example sonarPioneerReader.cpp to illustrate Pioneer sonar device usage. - New examples servoPioneerPoint2DDepth.cpp, servoPioneerPoint2DDepthWithoutVpServo.cpp and servoPioneerPanSegment3D.cpp to show how to control the pioneer mobile robot by IBVS. - New example grab1394CMU.cpp to show how to acquire images with the CMU 1394 library. - Bug fixed - [13536] Division by zero in vpMeLine - [13548] ViSP-2.6.1 produces several warnings with g++ 4.4.3, a const is missing in vpMbtDistanceLine.h - [13575] ViSP sporadic segmentation fault in vpMeLine - [13625] trackMeNurbs example produce an assertion failed with MSVC: "list iterator not incrementable" - [13626] testXmlParser produre a Debug assertion failed with MSVC - [13678] Cannot build all the examples if no display capability is available - [13679] GDI not detected on Windows 7 (64 bit) with Visual C++ Express 2010 - [13689] Memory leaks in jpeg reader: vpImageIo::readJPEG() - [13690] Memory leaks in NURBS tracker - [13843] In vpPolygon, isInside() may produce a segfault and getArea() or getCenter() give bad results - [13850] visp-config.bat produces a non compatible msvc 2010 output format - [13955] vpBasicFeature::error() is not virtual - [13963] Under Windows, vpDisplay::getClickUp() doesn't work - [14081] Error in vpThetaUVector when angles are near 180 deg +/- epsilon - [14082] Segmentation fault in model based tracking when tracking only cylinders - [14474] Fix race condition in vpXmlParser. - [14481] testFeatureSegment can lead to an exception. - [14587] Ogre media directory OGRE_MEDIA_DIR not set in Ubuntu 12.04 - [14588] vpConfig.h doesn't match with the install directory ---------------------------------------------- ViSP 2.6.1 (released October 20th, 2011) - New features - Introduction of Lapack support used for the SVD decomposition in vpMatrix - Introduction of vpAROgre that enables augmented reality applications based on Ogre 3D. Some examples are provided in examples/ogre-simulator - Add cylinder's tracking in the model-based tracker. - Reintroduce OpenCV 2.0.0 support lost in ViSP 2.6.0 - Introduction of vpKinect, a wrapper of libfreenect to support the Kinect device - Introduction of vpMoment and vpFeatureMoment classes to be able to consider 2D image moments as visual feature in visual servoing - Improvements - For firewire cameras framegrabbing with vp1394TwoGrabber, it is now possible to select a specific camera with its GUID by using setCamera() - All the specific Xml parser (vpMbtXmlParser, vpXmlParserCamera) inherit now from vpXmlParser - Memory leaks suppression in vpWireFrameSimulator, vpMe, vpXmlParser, vpMbtXmlParser, vpXmlParserCamera, vpMbTracker, vpFeatureLuminance, vpRobotSimulator, vpFFMPEG, vpBSpline - It is now possible to grab images from an usb webcam with the vpV4l2Grabber class that is based on the video 4 linux 2 driver. - When it was possible without braking the backward compatibilty std::list was introduced instead of vpList. Some of the functions that use vpList are now deprecated. - Better detection of image or video file types when used in vpImageIo, vpVideoReader and vpVideoWriter - Build - Set the build type by default to release - Improve the usage of debug versus release third-party libraries - Deprecated - vpAdaptativeGain is deprecated. Use vpAdaptiveGain instead. - vp1394Grabber is deprecated. Use vp1394TwoGrabber instead. - Most of the methods that use vpList are deprecated. Use std::list instead - vpTwistMatrix deprecated in ViSP-1.6.0 was removed. - Examples: - New example grabOpenCV-2.cpp to show how to use the OpenCV cv::VideoCapture class. This example shows how to acquire an image with cv::VideoCapture, how to transform this image in ViSP format and how to display it. - New examples to illustrate the usage of the Ogre simulator through vpAROgre class. - New example to illustrate the usage of the Kinect through vpKinect class. - New examples to illustrate the usage of 2D image moments. - Bug fixed - [11110] On OSX vpDisplayOpenCV does not display images since OpenCV 2.1.0 - [11147] Coin not installed, cannot read VRML files - [11473] vpImageTools::flip() come out error when deal with vpImage with vpRGBa type - [11529] ViSP / OpenCV(2.2.0) incompatibility - [11563] segfault in vpVideoReader - [11617] selecting a subset of features is not taken into account in vpServo - [11916] Build issues with GTK2 on ubuntu 10.10 (fatal error: gdk-pixbuf/gdk-pixbuf.h) - [11924] svdNr fails on some matrices where svdGsl succeeds - [11942] Build issues with GSL on OSX due to 32/64 bits architecture - [11943] Build issues with libjpeg on OSX due to 32/64 bits architecture - [11944] Build issues with libpng on OSX due to 32/64 bits architecture - [11981] vpV4l2Grabber class based on video 4 linux 2 is not able to grab images from an usb webcam - [12329] Bad font problem when opening vpPlot example - [12334] Under windows, link errors when some 3rd party libs are not build in the same build configuration as ViSP - [12499] servoSimu4Points: World point disposition does not match camera - [12591] Seg fault when using setCleanPreviousImage() from vpImageSimulator - [12739] Problem initialising a vpMeEllipse - [13014] Bug in vpCalibration::calibVVSMulti() jacobian - [13015] vpFFMPEG compatibility issue with ffmpeg-0.8 release - [13449] "LIBJPEG_BUILD_TEST - Failed" message in CMake for Visual 2010 - [13467] CreateWindow windows API does not correctly register class. ---------------------------------------------- ViSP 2.6.0 (released September 23rd, 2010) - License: Change the open source license from QPL to GPL v2 - New Features - Introduction of a new wireframe simulator. See vpWireFrameSimulator class. - Introduction of a new model-based tracker that allows to track an object based on its 3D model. See vpMbEdgeTracker class. - New vpForceTwistMatrix class that allows to transfer a force/torque skew from one frame to another. - New vpVelocityTwistMatrix class that allows to transfer a velocity skew from one frame to an other. The vpTwistMatrix class that does the same work previously is from now deprecated. - New vpRobotCycab class to communicate with the Cycab car-like mobile robot at Inria. - New generic vpRobotSimulator class to create robot simulators. - New vpSimulatorViper850 class which simulates the viper850 robot. - New vpSimulatorAfma6 class which simulates the Afma 6dof robot. - New vpPlanarObjectDetector class to detect a planar surface based on the Ferns Classifier. - New vpSickLDMRS class, a UNIX driver to get measures from a Sick LD-MRS laser scanner. - New vpPlot class that was recoded to suppress the XPlotter dependency. This class aims real time drawing of 2D or 3D graphics under Linux, OSX and Windows. - Third party library dependencies - OpenCV 1.1 and 2.0 are no more supported. ViSP requires at least OpenCV 2.1. - libplotter is no longer required. - Itifg8 is no longer supported. - Improvements - Copy constructors were added to better support stl lists and vectors. - In firewire framegrabbing using vp1394TwoGrabber based on libdc1394-2.x, add possibility to change during the execution the shutter, the gain, the brightness, ... (see documentation for more details) . new setIsoTransmissionSpeed(), setAutoShutter() methods - In vpThetaUVector addition of &operator=() method to initialise all the angles to the same value - In vpHomogeneousMatrix addition of . eye() method to set the transformation as identity . extract(vpThetaUVector &) to extract the rotation as a Theta U vector - In vpRobotViper850 add openGripper() and closeGripper() functions to control the Schunk two fingers electric gripper (available only at Inria). - In vpRotationVector and vpTranslationVector introduction of set() method that allows initialization from 3 doubles - Documentation improvements - Deprecated . Some deprecated classes were removed: vpItifg8Grabber, vpEulerVector, vpSubPixel, vpRA . Deprecated functions since ViSP 2.4.4 where also removed - Examples: - New example calibrateTsai.cpp to show how to use the vpCalibration class to estimate the hand to eye transformation. - New examples to illustrate the usage of the new wire-frame simulators - Bug fixed - [9476] Memory leak in vpImageIo::readPNG() functions. - [9505] Problem with the DirectShow grabber : can't be initialised. - [9516] Problem in the getValue methods in the vpImage class. - [9746] The displayPoint method of the vpDisplayOpenCV class doesn't work. - [10472] Bug in the visual features: can't select the good feature. - [10647] Delay in displaying image overlays - [10687] The GDI display is not detected with Visual Studio 2010 - [10696] [CMake] VISP_DIR path conflict - [10697] CMake standard output vars - [10719] Compilation error in vpPlot - [10723] Compilation error in vpFFMPEG.cpp - [10748] PThread and Win32 Conflict - [10928] vpPlane: rayIntersection from 2 points - [10985] In vpPlot, 2D curve plotting starts with point (0,0) and not with the first specified point. ---------------------------------------------- ViSP 2.4.4 (released January 8th, 2010) - Features removed - vpMePath has been removed. ---------------------------------------------- ViSP 2.4.4-rc1 (released December 21th, 2009) - New Features - During CMake configuration, when a third-party library is detected, it is now possible to turn off the default usage of the library. - Warning during the build if deprecated functions are used - For the Irisa's Afma6 robot addition of a new vacuum tool (vpAfma6). - New vpImagePoint class for image point coordinates. - New vpPlot class that enables real time drawing of graphics under Unix. - Ability to use other colors than the predefined ones with the rewriting of the vpColor class and modifications in display functionalities. - New vpKalmanFilter and vpLinearKalmanFilterInstantiation classes with velocity and acceleration state models. - New vpFeatureTranslation: ctc* - New USE_COIN_SIMULATOR option during CMake configuration to enable or disable simulation capabilities based on Coin3D suite. - New vpViper, vpViper850 and vpRobotViper850 classes to provide an interface for Inria's Adept Viper 850 robot. - New vpBSpline and vpNurbs classes to manipulate 2D BSpline and 2D Nurbs (Non Uniform Rational BSpline). - New vpMeNurbs class to track object edges. - New vpFFMPEG class to interface the FFmpeg library. - New vpVideoReader and vpVideoWriter classes to manipulate easily the video files and the image sequences. - Improvements - In firewire framegrabbing using vp1394TwoGrabber based on libdc1394-2.x, bus reset can be switched off in the constructor. There are also improvements in the acquisition using acquire(vpImage &I, ...) by removing the color coding format request and by support of the RAW8 and RAW16 video format. New dequeue() functions were also introduced to make possible to separate the ring buffer dequeuing and enqueuing. This behavior is for example useful when image processing needs to be introduced between the dequeuing and enqueuing stages. It may also useful to synchronise the image acquisition with an other sensor. New setPanControl() function was introduced to set the PAN register 0x884 to control single or multiple image transmission from stereo vision cameras like the PointGrey Bumblebee. - vpDot2: The tracking is restarted in vpDot2::track() if a dot is found but is not valid. - In vpDisplay, new getKeyboardEvent() functionality to handle key events and new getPointerMotionEvent() functionality to handle mouse pointer motion event. - Optimization of the vpMatrix class. - Examples: - New examples in examples/servo-viper850 to show how to use the linear Kalman filter to compensate the tracking error due to the motion of a target. - New examples in examples/servo-viper850 to show how to use the secondary task to avoid joint limits. - New plotting example in example/tools/plot.cpp - In grab1394Two.cpp example, addition of [-r] new option to reset the bus. - New examples to show how to build a 3D visual servoing without using the vpServo and vpFeature classes: servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp and servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp - Bug fixed - [7638] Memory leak in all vpFeature... classes was reopened - [7888] vpV4l2Grabber cannot acquire an image from an analog camera on Ubuntu 8.04 Hardy Heron - [7994] vpMeLine : initialization problem for horizontal lines - [8001] Coin and SoQt are not detected during CMake configuration under Fedora 10 - [8032] Link error whith GSL while compiling HelloWorld.cpp on OSX - [8225] Bug in the multiplication of a twist matrix (6x6) by a matrix (6xn) - [8248] Compilation error under Windows MSCV8 if deprecated functions are not build - [8249] Compilation error under Windows MSCV8 when building ViSP as a shared library (DLL) - [8257] Bug in vp1394TwoGrabber::resetBus() - [8259] Segfault in vpDisplayX - [8389] vpKltOpencv : Bug in the copy constructor - [8493] Problem to build ViSP as a dynamic library under windows (Visual C++) - [8495] Segmentation fault during the execution of the example grabDirectShow - [8831] Possible bug when extracting axis/angle from theta/u vector ---------------------------------------------- ViSP 2.4.3 (released April 10th, 2009) - New Features - Add vpFeaturePointPolar corresponding the a 2D image point with polar coordinates visual feature. - Add vpFeatureTranslation for cto (camera to object translation feature) - Add vpDisplay::setWindowPosition() functionality - Bug fixed - [7281] Segfault when displaying a vpCylinder. - [7308] Rotation vector not initialized to zero by the default constructor - [7309] visp-config --cflags produces a bad output - [7342] Bug in vpRobotAfma6::setVelocity(vpRobot::CAMERA_FRAME, v) - [7494] Division by 0 in vpHomography - [7424] Coin3D version 3 not supported under Windows - [7613] vpSimulator::getInternalImage() function yields to an infinite loop. - [7607] vpDisplayGTK bad window positionning - [7638] Memory leak in all vpFeature... classes ---------------------------------------------- ViSP 2.4.3-rc2 (released January 29th, 2009) - Deprecated - Creation of a deprecated section in the online documentation that gives the list of classes or member function that are deprecated - vpOSXcfoxGrabber was removed, since the C+Fox third party library available at http://cfox.sourceforge.net/ was not updated since 2005. - vpIcCompGrabber was removed, since it uses a home made wrapper based on itifg-7.2.1 driver which is not maintained yet - Testing - Use of CDash insteed of Dart2. Dashboards are sent to http://cdash.irisa.fr/CDash/index.php?project=ViSP - Platform compatibility - Compatibility with g++ 4.3.0 coming with fedora 9 - New Features - Add visp-config.bat under Windows to get the list of include dirs, library dirs and libraries ViSP depends on. This may help users to build a Visual Studio project from scratch and where ViSP is used as a third party project - vpFeatureThetaU: Add cRcd feature, with ThetaU corresponding to the rotation the camera has to achieve to move from current frame to the desired one. - vpOpenCVGrabber: New framegrabber based on OpenCV third party library (useful for USB cameras). - vp1394TwoGrabber: Get the timestamp associated to the grabbed image. - vpV4l2Grabber: Get the timestamp associated to the grabbed image. - vpRobotAfma6 and vpAfma6: Modifications to be compatible with the new low level Adept controller provided by Cerebellum Automation. - vpRobotAfma4 and vpAfma4: Modifications to be compatible with the new low level Adept controller provided by Cerebellum Automation. New vpServolens class to control the Servolens lens attached to the camera fixed on the Afma4 end-effector. - Examples: - New examples in example/manual described in ViSP guide under preparation. - example/servo-simu/servoSimu3DCamVelocity2.cpp - Documentation - Creation of a deprecated section. - Classes are now grouped in doxygen modules to help learning ViSP. - Introduction of new sample examples in the online documentation - Bug fixed - [5370] DirectShow and Visual Studio 9 2008 Express - [5371] Warnings on Visual Studio 9 2008 - [5375] Compilation error in calibrate2dGrid.cpp - [5398] display cylinder - [5438] window sizes with Coin - [5496] Compilation error in example/framegrabber/grab1394.cpp - [5508] Bug in vpImageConvert::YUV420ToRGB - [5527] Bug in vpImageTools::changeLUT() - [5539] Unhandle exception with multi vpDisplayGDI / D3D instances - [5596] Multiplying a vpRotationMatrix with a vpColVector ? - [5642] warning in vphomographyvvs.cpp with Visual C++ 2003 .Net - [5993] vpImage BI - [6330] Segfault in vpSimulator with Coin + SoXt - [6336] DLT Homography on 4 points - [6484] Bug in vpCalibration::calibrationTsai for eye-to-hand calibration - [6590] vpDisplayGDI cannot handle numerous displays (windows) - [6619] Problem vpMeLine : compute of delta - [6743] Bug in vpDisplayOpenCV::displayRectangle() - [6744] Bug in vpDisplayOpenCV - [6962] vpMeLine : problem of tracking - [7034] vpMeLine : Bug when a strip is tracked - [7126] problem with vpMatrix::eigenValuesByLU() ---------------------------------------------- ViSP 2.4.2 (released March 27th, 2008) - New classes - vpCalibration : calibration toolkit for intrinsic and extrinsic parameters of perspective camera. - vpXmlParserCamera : Parser xml to read and save camera parameters from vpCameraParameters class. - vpHinkley : Hinkley's cumulative sum test computation. - vpMePath : Tracking of a white curve by using line and parabola tracker. - vpKeyboard : Gets a key from the keyboard without waiting for the enter key. - vpParallelPort : Parallel port management under unix. - vpRingLight : Irisa's ring light controller. - vpKltOpencv : Interface for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented with opencv. - New Features - Bug fix and improvement - vpCameraParameters : support for radial distortion camera model. - vpAfma6 : Add a getCameraParameters functionnality - vpSimulator : either SoWin or SoQt or SoXt is needed to use vpSimulator class. - vpDot: setMaxDotSize(double percentage) replace setNbMaxPoint(double nb) to be less image size dependent. The maximal dot size is set by default to 0.25% (quarter image size). setGrayLevelPrecision(double grayLevelPrecision) has been added for a better management of gray dots detection. - vpDot2: Changes in searchDotsInArea() : The algorithm search now in the bounding boxes of the bad dots. Bug fixed : we could fall in an infinite loop. Split accuracy private variable into grayLevelPrecision and sizePrecision. The gray level min and max are well calculated for white and black dots. Add setEllipsoidShapePrecision() to turn on/off and modify the test related of the geometry of the shape - vpDisplayX : better management of endianness - vpDisplayGTK, vpDisplayGDI, vpDisplayD3D, vpDisplayX : To actually display drawings on the screen, a vpDisplay::flush(I) is needed. Use it with parsimony : it is time consuming. - vpDisplayGTK, vpDisplayGDI, vpDisplayD3D : The behavior of the following methods change to be similar to vpDisplayX: . getClick(..., button) : The button used to click is now an output . getClickUp(..., button) : The button used to click is now an output Moreover, in vpDisplayGDI, vpDisplayD3D middle button is now managed - vpDisplayGTK, vpDisplayGDI, vpDisplayD3D : The usage of display->init(vpImage, int, int); returned a segmentation fault : bug fixed - vpDisplayD3D : we couldn't re-use a display after the call of the function close(vpImage). We had a black image : bug fixed. - vpDisplay : changes in displayRectangle():an option parameter fill has been had to precise if the displayed rectangle is filled or not. - vpColor : Add orange color. - vpServo : To fix bug #3528 you should explicitly call vpServo::kill() in your programs. Otherwise an exception vpServoException::notKilledProperly is launched by vpServo::~vpServo() destructor. - vpMatrix : Change Infinity Norm and Euclidian Norm formula to match with the standard matrix norms definitions. Change determinant formula for 3x3 matrices to match with the standard determinant definition. - vpImageConvert : Add IplImage to vpImage and vpImage to IplImage conversion tool. Add MONO16 to grey (MONO8) conversion tool. - vp1394TwoGrabber : Supports libdc1394-2.0.0-rc7 and libdc1394-2.0.1 MONO16 color coding is supported - Testing and examples: - example/calibration/calibrate2dGrid.cpp was added - example/tracking/trackKltOpencv.cpp was added - example/light/ringLight.cpp was added - example/tools/parallelPort.cpp was added - test/video-device/testClick.cpp was added - test/video-device/testVideoDevice.cpp was added - test/visual-feature/testFeature.cpp was added - test/image/testCreateSubImage.cpp was added - test/camera/testCameraParametersConversion.cpp was added - Documentation improvement - vpRobust::MEstimator() - vpRobotAfma6: example usage of getPosition() was updated - vpDisplayGDI is included in the doxygen documentation ---------------------------------------------- ViSP 2.4.1 (released May 16th, 2007) - New classes - vpRect class for rectangle manipulations, display - vpHistogram,vpHistogramPeak and vpHistogramValey classes to handle gray level image histogram - vpSubPixel for sub-pixel manipulations - vpMouseButton for mouse click identification - New Features - MinGW supported - ViSP as a third party library in an other project. It is now possible to use ViSP as a third party project without installing ViSP by make install. ViSP can now be used directly from the build dir, or from the install dir, or from a package (NSIS, ...) - vpRobotCamera It is now possible to add a sampling time so that the behavior of this simulated camera is quite realistic. This sampling time is set by default to 40 ms. - vpExponentialMap A sampling time was introduced. - Bug fix and improvement - vpImage: getWidth() and getHeight() replace getCols() and getRows() which are now obsolete. - More restrictive types in vpImage, vpDisplay..., and vp...Grabber classes: const are added, unsigned int replace int for pixel manipulations and image or display size. - In vpDisplay classes: . vpMouseButton::vpMouseButtonType was introduced to handle mouse clicks . vpColor::vpColorType was introduced to handle colors to display - Simulator functionality based on Coin usage is now available under windows. It allows the use of vpSimulator class under this platform. - Compatibility with Windows platform. - Reference documentation improvement - cfox and std namespace were removed. To use cout you need to call std::cout, std::endl, std::cin ... ---------------------------------------------- ViSP 2.4.0 (released February 6th, 2007) - New Feature - add new framegrabber interface for itifg8 driver from Coreco Imaging Technology (http://sourceforge.net/projects/itifg) Tested with AM-STD COMP framegrabber board on 2.4 and 2.6 linux kernel (see vpItifg8Grabber). - add new framegrabber interface and test for firewire 1394 cameras using libdc1394-2.x. Need a newer version than libdc1394-2.0.0-rc4. Tested with the svn version of libdc1394-2 and Marlin F033C and F131B cameras (see vp1394TwoGrabber). Format 7 is supported in vp1394TwoGrabber. vp1394Grabber will be obsolete soon. - Bug fix and improvement - tests and examples - Video For Linux Two grabber (see vpV4l2Grabber) - memory leaks suppression - works fully under windows - doxygen documentation ---------------------------------------------- ViSP 2.2.0 (released August 25th, 2006) - Build - To increase the code portability, especially under windows), all the build process is now based on CMake (see http://www.cmake.org). - Supported platforms: Linux, Mac OSX, SunOS: g++ 2.95.3, 2.96, 3.3.x, 3.4.x, 4.1.0) Windows: MSVC7 (2003.NET), MSVC8 (2005) - Suppression of autotools support (configure) - Allows shared library building (.so and .dll) - New Feature - add control for Traclabs biclops pan-tilt head - add control for Directed Perception ptu-46 pan-tilt head - add vpDisplayGTK display under Windows - add vpDirectShowGrabber framegrabber under Windows - add vpDisplayGDI display under windows - Bug fix and improvement - vp1394Grabber settings (format, mode, framerate, shutter, gain) - vpDot (Moment computation) - some fixes in vpDisplayGTK ---------------------------------------------- ViSP 2.1.1 (released January 6th, 2006) - New examples - create an example directory - add vpDotExample.cpp - add vpDot2Example.cpp - add vpPoseExample.cpp - add 2D0.5.VisualServoingSimulation.cpp - New Feature - add this ChangleLog file - add a vpDisplayGTK class with the GTK2+ window system - new member function in vpDisplay (_uv) - add function getInteractionMatrix() in vpGenericFeature - Specification modifications - change the vpDot and vpDot2 specifications - supress demo directory - Bug fix and improvement - add a runtime warning when vpGenericFeature is not correctly used - comment in english in vpDisplayX - suppress a trace in vpPoseVirtualVisualServoing.cpp - directory.mk : add -p option to mkdir - improve XP compatibility - in vp1394Grabber, latency and memory leaks suppression - WWW - add an image sequence to download on the www site cube.tar.gz --------------------------------------- ViSP 2.1.0 (released October, 24th 2005) visp-3.0.0/INSTALL.txt000066400000000000000000000034771264126442000143560ustar00rootroot00000000000000 ViSP Visual Servoing Platform Copyright (C) 2005 - 2015 by Inria. All rights reserved. http://visp.inria.fr INSTALL howto for the ViSP library QUICKINSTALL: > get ViSP source > install CMake (see http://www.cmake.org) > cmake . > make > make install The make install step is needed if you want to use ViSP in your own projects. To do the installation, you don't need to be root. Building ViSP with CMake ------------------------ Prerequsits: (1) Install newest cmake release from http://www.cmake.org (2) checkout/install ViSP source code. (3) configure run cmake to change options and to generate makefiles. example for a build on Linux: cd to source directory of ViSP > cd ViSP To configure and generate makefiles: On Linux: > ccmake . (mind the 'dot') See the bottom line for usage instructions, in particular: - press 'c', then modify options as required and press 'c' again to configure - finally press 'g' to generate Makefiles On Win32: > CMakeSetup.exe The GUI is self-explaining. Note: You can also use > cmake . directly if you prefer command line instead of graphical interface. (4) compile: > make (5) install: > make install Copy headers in ${CMAKE_INSTALL_PREFIX}/include Copy library in ${CMAKE_INSTALL_PREFIX}/lib Copy visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin (6) uninstall: > make uninstall Dual from install. Remove headers in ${CMAKE_INSTALL_PREFIX}/include Remove library and cmake files in ${CMAKE_INSTALL_PREFIX}/lib Remove visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin (7) clean: > make clean The "make clean" target will remove files generated by the compiler and linker. (8) documentation > make visp_doc Generate doxygen html documentation in doc/html. See README.txt for further information. visp-3.0.0/LICENSE.txt000066400000000000000000000431331264126442000143230ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. visp-3.0.0/README.md000066400000000000000000000010201264126442000137440ustar00rootroot00000000000000### ViSP: Open source Visual Servoing Platform [![Build Status](https://travis-ci.org/lagadic/visp.png)](https://travis-ci.org/lagadic/visp) #### Resources - Homepage: http://visp.inria.fr - Wiki: https://github.com/lagadic/visp/wiki - Code documentation: http://visp-doc.inria.fr/doxygen/visp-daily - Q&A forum: http://gforge.inria.fr/forum/?group_id=397 - Issue tracking: https://github.com/lagadic/visp/issues #### Contributing Please read before starting work on a pull request: http://visp.inria.fr/contributing-code/ visp-3.0.0/cmake/000077500000000000000000000000001264126442000135545ustar00rootroot00000000000000visp-3.0.0/cmake/AddExtraCompilationFlags.cmake000066400000000000000000000170631264126442000214350ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP overall configuration file. Add extra compilation flags. # # Authors: # Fabien Spindler # ############################################################################# macro(vp_add_extra_compilation_flags) # By default set release configuration if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE String "Choose the type of build, options are: None Debug Release" FORCE) endif() include(CheckCXXCompilerFlag) if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") #Not only UNIX but also WIN32 for MinGW set(WARNING_ALL "-Wall") CHECK_CXX_COMPILER_FLAG(${WARNING_ALL} WARNING_ALL_ALLOWED) if(WARNING_ALL_ALLOWED) # MESSAGE("Compiler flag ${WARNING_ALL} allowed") set(ACTIVATE_WARNING_ALL "ON" CACHE BOOL "activate -Wall flag") else() # MESSAGE("Compiler flag ${WARNING_ALL} not allowed") endif() set(WARNING_EXTRA "-Wextra") CHECK_CXX_COMPILER_FLAG(${WARNING_EXTRA} WARNING_EXTRA_ALLOWED) if(WARNING_EXTRA_ALLOWED) # MESSAGE("Compiler flag ${WARNING_EXTRA} allowed") set(ACTIVATE_WARNING_EXTRA "ON" CACHE BOOL "activate -Wextra flag") else() # MESSAGE("Compiler flag ${WARNING_EXTRA} not allowed") endif() set(WARNING_STRICT_OVERFLOW "-Wstrict-overflow=5") CHECK_CXX_COMPILER_FLAG(${WARNING_STRICT_OVERFLOW} WARNING_STRICT_OVERFLOW_ALLOWED) if(WARNING_STRICT_OVERFLOW_ALLOWED) # MESSAGE("Compiler flag ${WARNING_STRICT_OVERFLOW} allowed") set(ACTIVATE_WARNING_STRICT_OVERFLOW "OFF" CACHE BOOL "activate -Wstrict-overflow=5 flag") else() # MESSAGE("Compiler flag ${WARNING_STRICT_OVERFLOW} not allowed") endif() set(WARNING_FLOAT_EQUAL "-Wfloat-equal") CHECK_CXX_COMPILER_FLAG(${WARNING_FLOAT_EQUAL} WARNING_FLOAT_EQUAL_ALLOWED) if(WARNING_FLOAT_EQUAL_ALLOWED) # MESSAGE("Compiler flag ${WARNING_FLOAT_EQUAL} allowed") set(ACTIVATE_WARNING_FLOAT_EQUAL "OFF" CACHE BOOL "activate -Wfloat-equal flag") else() # MESSAGE("Compiler flag ${WARNING_FLOAT_EQUAL} not allowed") endif() set(WARNING_SIGN_CONVERSION "-Wsign-conversion") CHECK_CXX_COMPILER_FLAG(${WARNING_SIGN_CONVERSION} WARNING_SIGN_CONVERSION_ALLOWED) if(WARNING_SIGN_CONVERSION_ALLOWED) # MESSAGE("Compiler flag ${WARNING_SIGN_CONVERSION} allowed") set(ACTIVATE_WARNING_SIGN_CONVERSION "OFF" CACHE BOOL "activate -Wsign-conversion flag") else() # MESSAGE("Compiler flag ${WARNING_SIGN_CONVERSION} not allowed") endif() if(ACTIVATE_WARNING_ALL) list(APPEND CMAKE_CXX_FLAGS ${WARNING_ALL}) else() string(REPLACE ${WARNING_ALL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() if(ACTIVATE_WARNING_EXTRA) list(APPEND CMAKE_CXX_FLAGS ${WARNING_EXTRA}) else() string(REPLACE ${WARNING_EXTRA} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() if(ACTIVATE_WARNING_STRICT_OVERFLOW) list(APPEND CMAKE_CXX_FLAGS ${WARNING_STRICT_OVERFLOW}) list(APPEND CMAKE_C_FLAGS ${WARNING_STRICT_OVERFLOW}) else() string(REPLACE ${WARNING_STRICT_OVERFLOW} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE ${WARNING_STRICT_OVERFLOW} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif() if(ACTIVATE_WARNING_FLOAT_EQUAL) list(APPEND CMAKE_CXX_FLAGS ${WARNING_FLOAT_EQUAL}) else() string(REPLACE ${WARNING_FLOAT_EQUAL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() if(ACTIVATE_WARNING_SIGN_CONVERSION) list(APPEND CMAKE_CXX_FLAGS ${WARNING_SIGN_CONVERSION}) else() string(REPLACE ${WARNING_SIGN_CONVERSION} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() elseif(MSVC) # Add specific compilation flags for Windows Visual set(WARNING_ALL "/Wall") CHECK_CXX_COMPILER_FLAG(${WARNING_ALL} WARNING_ALL_ALLOWED) if(WARNING_ALL_ALLOWED) #MESSAGE("Compiler flag ${WARNING_ALL} allowed") set(ACTIVATE_WARNING_ALL "OFF" CACHE BOOL "activate /Wall flag") else() #MESSAGE("Compiler flag ${WARNING_ALL} not allowed") endif() if(ACTIVATE_WARNING_ALL) list(APPEND CMAKE_CXX_FLAGS ${WARNING_ALL}) else() string(REPLACE ${WARNING_ALL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() if(MSVC80 OR MSVC90 OR MSVC10 OR MSVC11) # To avoid compiler warning (level 4) C4571, compile with /EHa if you still want # your catch(...) blocks to catch structured exceptions. list(APPEND CMAKE_CXX_FLAGS "/EHa") endif() endif() # If compiler support symbol visibility, enable it. include(CheckCCompilerFlag) check_c_compiler_flag(-fvisibility=hidden HAS_VISIBILITY) if (HAS_VISIBILITY) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") endif() # FS no more needed since it is added by default by CMake when build as shared # if(UNIX) # if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # endif() # endif() # OpenMP if(USE_OPENMP) set(VISP_OPENMP_FLAGS "${OpenMP_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") else() set(VISP_OPENMP_FLAGS "") if(OpenMP_CXX_FLAGS) string(REPLACE ${OpenMP_CXX_FLAGS} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() endif() # C++11 if(USE_CPP11) set(VISP_CPP11_FLAGS "${CPP11_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP11_CXX_FLAGS}") else() set(VISP_CPP11_FLAGS "") if(CPP11_CXX_FLAGS) string(REPLACE ${CPP11_CXX_FLAGS} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() endif() if(BUILD_COVERAGE) # Add build options for test coverage. Currently coverage is only supported # on gcc compiler # Because using -fprofile-arcs with shared lib can cause problems like: # hidden symbol `__bb_init_func', we add this option only for static # library build message(STATUS "Add -ftest-coverage -fprofile-arcs compiler options") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs") endif() # Remove duplicates compilation flags separate_arguments(CMAKE_CXX_FLAGS) list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "common C++ build flags" FORCE) separate_arguments(CMAKE_C_FLAGS) list(REMOVE_DUPLICATES CMAKE_C_FLAGS) string(REPLACE ";" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "common C build flags" FORCE) #message("CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}") endmacro(vp_add_extra_compilation_flags) visp-3.0.0/cmake/CPackConfig.cmake000066400000000000000000000101561264126442000166700ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP packaging configuration file. # # Authors: # Fabien Spindler # ############################################################################# message(STATUS "Configuring CPack") #mark_as_advanced(BUILD_PACKAGE) SET(CPACK_PACKAGE_NAME "libvisp") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Visual tracking and visual servoing library in C++ (development files)") SET(CPACK_PACKAGE_CONTACT "Fabien Spindler ") SET(CPACK_PACKAGE_VENDOR "Inria, French National Institute for Research in Computer Science and Control") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") SET(CPACK_PACKAGE_VERSION ${VISP_VERSION}) SET(CPACK_PACKAGE_VERSION_MAJOR ${VISP_VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${VISP_VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${VISP_VERSION_PATCH}) SET(CPACK_COMPONENTS_ALL libraries headers) SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers") SET(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "ViSP ${VISP_VERSION} libraries") SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "C/C++ header files for use with ViSP ${VISP_VERSION} libraries") SET(CPACK_COMPONENT_HEADERS_DEPENDS libraries) SET(CPACK_COMPONENT_LIBRARIES_GROUP "Development") SET(CPACK_COMPONENT_HEADERS_GROUP "Development") SET(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "All of the tools you'll ever need to develop software with ViSP") SET(CPACK_ALL_INSTALL_TYPES Full Developer) SET(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES Developer Full) SET(CPACK_COMPONENT_HEADERS_INSTALL_TYPES Developer Full) # The following components are regex's to match anywhere (unless anchored) # in absolute path + filename to find files or directories to be excluded # from source tarball. SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/" "/autom4te.cache/" "/build/" "/lib/" "~$" ) SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME} ${VISP_VERSION}") # In ViSP packages we only want to have the libraries and the headers (nor the demo, example, and test) # That's why we turn off the demo, example and test building SET(BUILD_DEMOS OFF CACHE BOOL "Build ViSP demos." FORCE ) SET(BUILD_EXAMPLES OFF CACHE BOOL "Build ViSP examples." FORCE) SET(BUILD_TESTING OFF CACHE BOOL "Build ViSP tests." FORCE) SET(BUILD_TUTORIAL OFF CACHE BOOL "Build ViSP tutorials." FORCE) if(UNIX) set(CMAKE_INSTALL_PREFIX "/usr" CACHE String "Package install prefix" FORCE) elseif(WIN32) set(CMAKE_INSTALL_PREFIX "C:/Program Files/ViSP ${VISP_VERSION}" CACHE String "Package install prefix" FORCE) endif() set(BUILD_SHARED_LIBS ON CACHE BOOL "Build ViSP with shared libraries." FORCE) if(WIN32 AND NOT UNIX) include(${VISP_CMAKE_MODULE_PATH}/CPackConfigNsis.cmake) elseif(APPLE) set(CPACK_GENERATOR "PackageMaker;TBZ2") elseif(UNIX) if(BUILD_PACKAGE_DEBIAN) include(${VISP_CMAKE_MODULE_PATH}/CPackConfigDeb.cmake) elseif(BUILD_PACKAGE_RPM) include(${VISP_CMAKE_MODULE_PATH}/CPackConfigRpm.cmake) endif() endif() INCLUDE(CPack) visp-3.0.0/cmake/CPackConfigDeb.cmake000066400000000000000000000153151264126442000173050ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP packaging configuration file. # # Authors: # Fabien Spindler # ############################################################################# # To install the generated debian package use the gdebi-gtk package # installer on Ubuntu: # gdebi-gtk libvisp-dev-2.6.1-1_i386.deb # $ dpkg --print-architecture FIND_PROGRAM(DPKG_CMD dpkg) MARK_AS_ADVANCED(DPKG_CMD) IF(NOT DPKG_CMD) MESSAGE(STATUS "Can not find dpkg in your path, default to i386.") SET(CPACK_SYSTEM_NAME i386) ELSE() EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture OUTPUT_VARIABLE CPACK_SYSTEM_NAME OUTPUT_STRIP_TRAILING_WHITESPACE ) ENDIF() # $ lsb_release -sr (ex: 12.04) FIND_PROGRAM(LSB_RELEASE_CMD lsb_release) MARK_AS_ADVANCED(LSB_RELEASE_CMD) IF(NOT LSB_RELEASE_CMD) MESSAGE(STATUS "Can not find lsb_release in your path.") SET(DEBIAN_DISTRO_RELEASE "") ELSE() EXECUTE_PROCESS(COMMAND "${LSB_RELEASE_CMD}" -sr OUTPUT_VARIABLE DEBIAN_DISTRO_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE ) if(DEBIAN_DISTRO_RELEASE) #message("DEBIAN_DISTRO_RELEASE 1: ${DEBIAN_DISTRO_RELEASE}") STRING(REGEX REPLACE "[.]" "" DEBIAN_DISTRO_RELEASE ${DEBIAN_DISTRO_RELEASE}) #message("DEBIAN_DISTRO_RELEASE 2: ${DEBIAN_DISTRO_RELEASE}") endif() ENDIF() list(APPEND CPACK_GENERATOR DEB) SET(CPACK_PACKAGE_VERSION ${VISP_VERSION}-${VISP_REVISION}) SET(CPACK_PACKAGE_NAME "libvisp-dev") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${VISP_VERSION}-${VISP_REVISION}_${CPACK_SYSTEM_NAME}") set(CPACK_DEBIAN_PACKAGE_DEPENDS "cmake (>=2.6)") IF(USE_X11) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libx11-dev (>=2:1.3.2)") ENDIF() IF(USE_GTK2) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libgtk2.0-dev (>=2.20.1), libglib2.0-dev (>=2.24.1), libpango1.0-dev (>=1.28.0), libatk1.0-dev (>=1.30.0), libcairo2-dev (>=1.8.10)") ENDIF() IF(USE_LAPACK) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, liblapack-dev(>=3.2)") ENDIF() IF(USE_GSL) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libgsl0-dev (>=1.13)") ENDIF() IF(USE_V4L2) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libv4l-dev (>=0.6.4)") ENDIF() IF(USE_DC1394_2) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libdc1394-22-dev (>=2.1.2)") ENDIF() IF(USE_XML2) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libxml2-dev (>=2.7.2)") ENDIF() IF(USE_LIBPNG) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libpng12-dev (>=1.2.42)") ENDIF() IF(USE_LIBJPEG) if(DEBIAN_DISTRO_RELEASE) if(DEBIAN_DISTRO_RELEASE VERSION_LESS "1204") set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-dev (>=6b-15)") else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg-dev (>=6b-15)") endif() else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg-dev (>=6b-15)") endif() ENDIF() IF(USE_FFMPEG) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libswscale-dev (>=4:0.5.1), libavutil-dev (>=4:0.5.1), libavformat-dev (>=4:0.5.1), libavcodec-dev (>=4:0.5.1), libbz2-dev (>=1.0.5-4), libbz2-1.0 (>=1.0.5-4)") ENDIF() IF(USE_COIN) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libcoin60-dev (>=3.1.2-1)") ENDIF() IF(USE_SOQT) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libsoqt4-dev (>=1.4.2~svn20090224-2)") ENDIF() IF(USE_OGRE) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libogre-dev (>=1.7.3)") # since ogre-samples-media is not available on ubuntu oneiric 11.10 for example, we need an extra test to add this dependency IF(OGRE_MEDIA_DIR) if(DEBIAN_DISTRO_RELEASE) if(DEBIAN_DISTRO_RELEASE VERSION_LESS "1204") set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, ogre-samples-media (>=1.7.3)") else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, ogre-samples (>=1.7.3)") endif() else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, ogre-samples-media (>=1.7.3)") endif() ENDIF() ENDIF() IF(USE_OIS) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libois-dev (>=1.3.0)") ENDIF() IF(USE_OPENCV) if(DEBIAN_DISTRO_RELEASE) if(DEBIAN_DISTRO_RELEASE VERSION_LESS "1204") set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libcv-dev (>=2.0), libcvaux-dev (>=2.0), libhighgui-dev (>=2.0)") else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libopencv-dev (>=2.3.1)") endif() else() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libopencv-dev (>=2.3.1)") endif() ENDIF() IF(USE_LIBFREENECT) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, freenect (>=1:0.0.1)") ENDIF() if(USE_LIBUSB_1) set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libusb-1.0-0-dev (>=2:1.0)") endif() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libc6 (>=2.4)") SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Visual Servoing Platform development files ViSP, standing for Visual Servoing Platform, is unique. This software is a complete cross-platform solution that allows prototyping and developing applications in visual tracking and visual servoing. . ViSP can be useful in robotics, computer vision, augmented reality and computer animation. . This package contains development files (headers and shared library symbolic link).") SET(CPACK_DEBIAN_PACKAGE_SECTION "libdevel") SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.irisa.fr/lagadic/visp") visp-3.0.0/cmake/CPackConfigNsis.cmake000066400000000000000000000041111264126442000175170ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP packaging configuration file. # # Authors: # Fabien Spindler # ############################################################################# set(BUILD_SHARED_LIBS CACHE FORCE "Build ViSP with shared libraries." ON) # InstallRequiredSystemLibraries: Hack for Visual Studio support Search for # system runtime libraries based on the platform. INCLUDE(InstallRequiredSystemLibraries) set(CPACK_GENERATOR NSIS) set(CPACK_NSIS_CONTACT "visp@inria.fr") SET(CPACK_NSIS_HELP_LINK "http://www.irisa.fr/lagadic/visp/visp.html") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.irisa.fr/lagadic/visp/visp.html") set(CPACK_NSIS_MODIFY_PATH "ON") set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} SDK") # set(CPACK_PACKAGE_ICON ${VISP_SOURCE_DIR}/visp.bmp) # set(CPACK_NSIS_MUI_ICON ${VISP_SOURCE_DIR}/logoViSP.ico) # set(CPACK_NSIS_MUI_UNIICON ${VISP_SOURCE_DIR}/logoViSP.ico) SET(CPACK_PACKAGE_FILE_NAME "ViSP-${VISP_VERSION}-win32") SET(CPACK_SOURCE_PACKAGE_FILE_NAME "ViSP-${VISP_VERSION}-win32-src") visp-3.0.0/cmake/CPackConfigRpm.cmake000066400000000000000000000123561264126442000173530ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP packaging configuration file. # # Authors: # Fabien Spindler # ############################################################################# # $ uname -i FIND_PROGRAM(UNAME_CMD uname) MARK_AS_ADVANCED(UNAME_CMD) IF(NOT UNAME_CMD) MESSAGE(STATUS "Can not find uname in your path, default to i386.") SET(CPACK_SYSTEM_NAME i386) ELSE() EXECUTE_PROCESS(COMMAND "${UNAME_CMD}" -m OUTPUT_VARIABLE CPACK_SYSTEM_NAME OUTPUT_STRIP_TRAILING_WHITESPACE ) ENDIF() # create a fedora short name from cat /etc/fedora-release # for example, cat .. return "Fedora release 13 (Goddard)" we build "fc13" FIND_PROGRAM(CAT_CMD cat) MARK_AS_ADVANCED(CAT_CMD) IF(NOT CAT_CMD) MESSAGE(STATUS "Can not find cat in your path, default to empty.") SET(DIST_SHORT_NAME "") ELSE() SET(DIST_SHORT_NAME "") EXECUTE_PROCESS(COMMAND "${CAT_CMD}" /etc/fedora-release OUTPUT_VARIABLE FEDORA_FULL_RELEASE_NAME OUTPUT_STRIP_TRAILING_WHITESPACE ) #message("fedora release found 1: ${FEDORA_FULL_RELEASE_NAME}") IF(FEDORA_FULL_RELEASE_NAME) # replace " " space separator by ";" separator STRING(REGEX REPLACE "[ ]" ";" FEDORA_FULL_RELEASE_NAME ${FEDORA_FULL_RELEASE_NAME}) # message("fedora release found 2: ${FEDORA_FULL_RELEASE_NAME}") LIST(GET FEDORA_FULL_RELEASE_NAME 0 ITEM1) # here ITEM1 should contain "Fedora" # message("item1: ${ITEM1}") STRING(COMPARE EQUAL ${ITEM1} "Fedora" IS_FEDORA) IF(IS_FEDORA) LIST(GET FEDORA_FULL_RELEASE_NAME 2 ITEM3) # here ITEM3 should contain the dist number # message("dist number: ${ITEM3}") IF(ITEM3) SET(DIST_SHORT_NAME "fc${ITEM3}") ENDIF() ENDIF() ENDIF() ENDIF() list(APPEND CPACK_GENERATOR RPM) SET(CPACK_PACKAGE_NAME "libvisp-devel") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${VISP_VERSION}-${VISP_REVISION}.${DIST_SHORT_NAME}.${CPACK_SYSTEM_NAME}") set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries") set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CPACK_SYSTEM_NAME}") set(CPACK_RPM_PACKAGE_LICENSE "GPL") set(CPACK_RPM_PACKAGE_RELEASE ${VISP_REVISION}) set(CPACK_RPM_PACKAGE_DEPENDS "cmake >= 2.6") IF(USE_X11) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, libX11-devel >= 1.3") ENDIF() IF(USE_GTK2) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, gtk2-devel, glib2-devel, pango-devel, atk-devel, cairo-devel") ENDIF() IF(USE_LAPACK) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, lapack-devel >= 3.2") ENDIF() IF(USE_GSL) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, gsl-devel >= 1.13") ENDIF() IF(USE_V4L2) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, libv4l-devel >= 0.6.2") ENDIF() IF(USE_DC1394_2) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, libdc1394-devel >= 2.1.2") ENDIF() IF(USE_XML2) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, libxml2-devel >= 2.7.6") ENDIF() IF(USE_LIBPNG) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, libpng-devel >= 2:1.2.44") ENDIF() IF(USE_LIBJPEG) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, libjpeg-devel >= 6b-46") ENDIF() IF(USE_COIN) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, Coin2-devel >= 2.5.0") ENDIF() IF(USE_SOQT) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, SoQt-devel >= 1.5.0") ENDIF() IF(USE_OPENCV) set(CPACK_RPM_PACKAGE_DEPENDS "${CPACK_RPM_PACKAGE_DEPENDS}, opencv-devel >= 2.0") ENDIF() #message("CPACK_RPM_PACKAGE_DEPENDS ${CPACK_RPM_PACKAGE_DEPENDS}") set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_DEPENDS}") set(CPACK_RPM_PACKAGE_DESCRIPTION "Visual Servoing Platform development files ViSP, standing for Visual Servoing Platform, is unique. This software is a complete cross-platform solution that allows prototyping and developing applications in visual tracking and visual servoing. . ViSP can be useful in robotics, computer vision, augmented reality and computer animation. . This package contains development files (headers and shared library symbolic link).") set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/share/man" "/usr/share/man/man1" "/usr/lib64/pkgconfig" "/usr/lib/pkgconfig" "/usr/lib64/cmake" "/usr/lib/cmake") visp-3.0.0/cmake/FindARIA.cmake000066400000000000000000000065471264126442000161070ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Aria libraries and headers to control Pioneer mobile robots. # Once run this will define: # # ARIA_FOUND # ARIA_INCLUDE_DIRS # ARIA_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# find_path(ARIA_INCLUDE_DIR Aria.h $ENV{ARIA_HOME}/include /usr/local/Aria/include /usr/Aria/include /usr/include /usr/include/Aria /usr/local/include /usr/local/include/Aria "C:/Program Files/MobileRobots/Aria/include" ) #MESSAGE("DBG ARIA_INCLUDE_DIR=${ARIA_INCLUDE_DIR}") if(UNIX) find_library(ARIA_LIBRARY NAMES Aria PATHS $ENV{ARIA_HOME}/lib /usr/local/Aria/lib /usr/Aria/lib /usr/lib /usr/local/lib "C:/Program Files/MobileRobots/Aria/lib" ) #MESSAGE("DBG ARIA_LIBRARY=${ARIA_LIBRARY}") else() if(MSVC11) set(ARIA_SUFFIX_NAME VC11) elseif(MSVC10) set(ARIA_SUFFIX_NAME VC10) elseif(MSVC90) set(ARIA_SUFFIX_NAME VC9) elseif(MSVC80) set(ARIA_SUFFIX_NAME VC8) elseif(MSVC71) set(ARIA_SUFFIX_NAME VC71) else() set(ARIA_SUFFIX_NAME "") endif() find_library(ARIA_LIBRARY_DEBUG NAMES AriaDebug${ARIA_SUFFIX_NAME} PATHS $ENV{ARIA_HOME}/lib /usr/local/Aria/lib /usr/Aria/lib /usr/lib /usr/local/lib "C:/Program Files/MobileRobots/Aria/lib" ) find_library(ARIA_LIBRARY_RELEASE NAMES Aria${ARIA_SUFFIX_NAME} PATHS $ENV{ARIA_HOME}/lib /usr/local/Aria/lib /usr/Aria/lib /usr/lib /usr/local/lib "C:/Program Files/MobileRobots/Aria/lib" ) endif() if(UNIX) if(ARIA_LIBRARY AND ARIA_INCLUDE_DIR) set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) set(ARIA_LIBRARIES ${ARIA_LIBRARY}) set(ARIA_FOUND TRUE) else() set(ARIA_FOUND FALSE) endif() else() set(ARIA_LIBRARIES "") if(ARIA_LIBRARY_RELEASE AND ARIA_INCLUDE_DIR) set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) list(APPEND ARIA_LIBRARIES optimized ${ARIA_LIBRARY_RELEASE}) set(ARIA_FOUND TRUE) endif() IF(ARIA_LIBRARY_DEBUG AND ARIA_INCLUDE_DIR) set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) list(APPEND ARIA_LIBRARIES debug ${ARIA_LIBRARY_DEBUG}) set(ARIA_FOUND TRUE) endif() endif() mark_as_advanced( ARIA_INCLUDE_DIR ARIA_LIBRARY ARIA_LIBRARY_DEBUG ARIA_LIBRARY_RELEASE ) visp-3.0.0/cmake/FindBICLOPS.cmake000066400000000000000000000112051264126442000164510ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libBiclops, libPMD and libUtils for Biclops head. # Once run this will define: # # BICLOPS_FOUND # BICLOPS_INCLUDE_DIRS # BICLOPS_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX AND NOT WIN32) # MESSAGE("FindBICLOPS.cmake: macro only for Unix and Windows for the moment.") SET(BICLOPS_FOUND FALSE) ELSE(NOT UNIX AND NOT WIN32) FIND_PATH(BICLOPS_INCLUDE_DIR Biclops.h $ENV{BICLOPS_HOME}/include /usr/include ) #MESSAGE("DBG BICLOPS_INCLUDE_DIR=${BICLOPS_INCLUDE_DIR}") FIND_PATH(PMD_INCLUDE_DIR PMD.h $ENV{BICLOPS_HOME}/include $ENV{BICLOPS_PMD_HOME}/include /usr/include ) FIND_PATH(UTILS_INCLUDE_DIR utility.h $ENV{BICLOPS_HOME}/include $ENV{BICLOPS_UTILS_HOME}/include /usr/include ) FIND_LIBRARY(BICLOPS_LIBRARY NAMES Biclops libBiclops libBiclopsD PATHS $ENV{BICLOPS_HOME}/lib /usr/lib ) FIND_LIBRARY(PMD_LIBRARY NAMES PMD libPMD libPMDD PATHS $ENV{BICLOPS_HOME}/lib $ENV{BICLOPS_PMD_HOME}/lib /usr/lib ) FIND_LIBRARY(UTILS_LIBRARY NAMES Utils libUtils libUtilsD PATHS $ENV{BICLOPS_HOME}/lib $ENV{BICLOPS_UTILS_HOME}/lib /usr/lib ) #MESSAGE("DBG BICLOPS_LIBRARY=${BICLOPS_LIBRARY}") ## -------------------------------- IF(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY) SET(BICLOPS_LIBRARIES ${BICLOPS_LIBRARY} ${PMD_LIBRARY} ${UTILS_LIBRARY}) ELSE(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY) # MESSAGE(SEND_ERROR "Biclops library not found. Set USE_BICLOPS option OFF") ENDIF(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY) IF(NOT BICLOPS_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Biclops include dir not found. Set USE_BICLOPS option OFF") ENDIF(NOT BICLOPS_INCLUDE_DIR) IF(NOT PMD_INCLUDE_DIR) # MESSAGE(SEND_ERROR "PMD include dir not found. Set USE_BICLOPS option OFF") ENDIF(NOT PMD_INCLUDE_DIR) IF(NOT UTILS_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Utils include dir not found. Set USE_BICLOPS option OFF ") ENDIF(NOT UTILS_INCLUDE_DIR) IF(BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR) SET(BICLOPS_INCLUDE_DIRS ${BICLOPS_INCLUDE_DIR} ${PMD_INCLUDE_DIR} ${UTILS_INCLUDE_DIR}) ENDIF(BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR) IF(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR) #message("BICLOPS_LIBRARIES: ${BICLOPS_LIBRARIES}") #message("BICLOPS_INCLUDE_DIRS: ${BICLOPS_INCLUDE_DIRS}") # Try to compile a sample code using Biclops library to see if GetHomedState() is available #SET(BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION FALSE) include(CheckCXXSourceCompiles) SET(CMAKE_REQUIRED_LIBRARIES ${BICLOPS_LIBRARIES}) SET(CMAKE_REQUIRED_INCLUDES ${BICLOPS_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES(" #include int main(){ PMDAxisControl *axis; axis->GetHomedState(); return 0; } " BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION) #MESSAGE("DBG1 BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION ${BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION}") SET(BICLOPS_FOUND TRUE) ELSE(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR) SET(BICLOPS_FOUND FALSE) ENDIF(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR) MARK_AS_ADVANCED( BICLOPS_INCLUDE_DIR BICLOPS_LIBRARIES BICLOPS_LIBRARY PMD_INCLUDE_DIR UTILS_INCLUDE_DIR PMD_LIBRARY UTILS_LIBRARY ) ENDIF(NOT UNIX AND NOT WIN32) visp-3.0.0/cmake/FindCALINUX.cmake000066400000000000000000000051351264126442000164660ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Cerebellum CA linux library material # # CALINUX_FOUND # CALINUX_INCLUDE_DIRS # CALINUX_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindCALINUX.cmake: only available for Unix.") SET(CALINUX_FOUND FALSE) ELSE(NOT UNIX) FIND_PATH(CALINUX_INCLUDE_DIR calinux.h $ENV{CALINUX_HOME}/include /local/soft/Cerebellum/CALinux/current/include /home/soft/Cerebellum/CALinux/current/include ) #MESSAGE("DBG CALINUX_INCLUDE_DIR=${CALINUX_INCLUDE_DIR}") FIND_LIBRARY(CALINUX_LIBRARY NAMES calinux PATHS $ENV{CALINUX_HOME}/lib /local/soft/Cerebellum/CALinux/current/lib /home/soft/Cerebellum/CALinux/current/lib ) #MESSAGE("DBG CALINUX_LIBRARY=${CALINUX_LIBRARY}") ## -------------------------------- IF(CALINUX_LIBRARY) SET(CALINUX_LIBRARIES ${CALINUX_LIBRARY}) ELSE(CALINUX_LIBRARY) # MESSAGE(SEND_ERROR "Calinux library not found.") ENDIF(CALINUX_LIBRARY) IF(NOT CALINUX_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Calinux include dir not found.") ENDIF(NOT CALINUX_INCLUDE_DIR) IF(CALINUX_LIBRARIES AND CALINUX_INCLUDE_DIR) SET(CALINUX_INCLUDE_DIRS ${CALINUX_INCLUDE_DIR}) SET(CALINUX_FOUND TRUE) ELSE(CALINUX_LIBRARIES AND CALINUX_INCLUDE_DIR) SET(CALINUX_FOUND FALSE) ENDIF(CALINUX_LIBRARIES AND CALINUX_INCLUDE_DIR) MARK_AS_ADVANCED( CALINUX_INCLUDE_DIR CALINUX_LIBRARIES CALINUX_LIBRARY ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindCMU1394.cmake000066400000000000000000000063041264126442000163270ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find CMU 1394 Digital Camera SDK to acquire images from firewire # cameras on Windows. # Once run this will define: # # CMU1394_FOUND # CMU1394_INCLUDE_DIRS # CMU1394_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# if(WIN32) FIND_PATH(CMU1394_INCLUDE_DIR 1394Camera.h $ENV{CMU1394_HOME}/include "C:/Program Files (x86)/CMU/1394Camera/include" "C:/Program Files/CMU/1394Camera/include" ) #MESSAGE("DBG CMU1394_INCLUDE_DIR=${CMU1394_INCLUDE_DIR}") if(CMAKE_CL_64) FIND_LIBRARY(CMU1394_LIBRARY_DEBUG NAMES 1394camerad PATHS $ENV{CMU1394_HOME}/lib64/x64 "C:/Program Files (x86)/CMU/1394Camera/lib64/x64" "C:/Program Files/CMU/1394Camera/lib64/x64" ) FIND_LIBRARY(CMU1394_LIBRARY_RELEASE NAMES 1394camera PATHS $ENV{CMU1394_HOME}/lib64/x64 "C:/Program Files (x86)/CMU/1394Camera/lib64/x64" "C:/Program Files/CMU/1394Camera/lib64/x64" ) else() FIND_LIBRARY(CMU1394_LIBRARY_DEBUG NAMES 1394camerad PATHS $ENV{CMU1394_HOME}/lib "C:/Program Files (x86)/CMU/1394Camera/lib" "C:/Program Files/CMU/1394Camera/lib" ) FIND_LIBRARY(CMU1394_LIBRARY_RELEASE NAMES 1394camera PATHS $ENV{CMU1394_HOME}/lib "C:/Program Files (x86)/CMU/1394Camera/lib" "C:/Program Files/CMU/1394Camera/lib" ) endif() #MESSAGE("DBG CMU1394_LIBRARY_DEBUG=${CMU1394_LIBRARY_DEBUG}") #MESSAGE("DBG CMU1394_LIBRARY_RELEASE=${CMU1394_LIBRARY_RELEASE}") set(CMU1394_LIBRARIES "") if(CMU1394_LIBRARY_RELEASE AND CMU1394_INCLUDE_DIR) set(CMU1394_INCLUDE_DIRS ${CMU1394_INCLUDE_DIR}) list(APPEND CMU1394_LIBRARIES optimized ${CMU1394_LIBRARY_RELEASE}) set(CMU1394_FOUND TRUE) endif() if(CMU1394_LIBRARY_DEBUG AND CMU1394_INCLUDE_DIR) set(CMU1394_INCLUDE_DIRS ${CMU1394_INCLUDE_DIR}) list(APPEND CMU1394_LIBRARIES debug ${CMU1394_LIBRARY_DEBUG}) set(CMU1394_FOUND TRUE) ENDIF() MARK_AS_ADVANCED( CMU1394_INCLUDE_DIR CMU1394_LIBRARY CMU1394_LIBRARY_DEBUG CMU1394_LIBRARY_RELEASE ) endif() visp-3.0.0/cmake/FindCPP11.cmake000066400000000000000000000041641264126442000161500ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find C++11 flags. # # CPP11_FOUND - true if C++11 support is detected # CPP11_CXX_FLAGS - flags to add to the CXX compiler for C++11 support # # Authors: # Fabien Spindler include(CheckCXXCompilerFlag) include(FindPackageHandleStandardArgs) set(CPP11_CXX_FLAG_CANDIDATES "-std=c++11" "-std=c++0x" ) # check CXX c++11 compiler flag foreach(FLAG ${CPP11_CXX_FLAG_CANDIDATES}) set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${FLAG}") unset(CPP11_FLAG_DETECTED CACHE) message(STATUS "Try C++11 flag = [${FLAG}]") CHECK_CXX_COMPILER_FLAG(${FLAG} CPP11_FLAG_DETECTED) set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") if(CPP11_FLAG_DETECTED) set(CPP11_CXX_FLAGS_INTERNAL "${FLAG}") break() endif() endforeach() set(CPP11_CXX_FLAGS "${CPP11_CXX_FLAGS_INTERNAL}" CACHE STRING "C++ compiler flags for C++11 support") # handle the standard arguments for find_package find_package_handle_standard_args(CPP11 DEFAULT_MSG CPP11_CXX_FLAGS ) mark_as_advanced( CPP11_CXX_FLAGS ) visp-3.0.0/cmake/FindDC1394.cmake000066400000000000000000000107601264126442000161720ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libDC1394 for IEEE1394 camera. First search for libdc1394-2.x # and if not found, search for libdc1394-1.x # Once run this will define: # # DC1394_FOUND # DC1394_INCLUDE_DIRS # DC1394_LIBRARIES # # The two defines below are only useful to compile with libdc1394-2.x. In # that case DC1394_VERSION=2. Since the libdc1394-2.x API is not stable, we # need to determine if dc1394_find_cameras() or dc1394_enumerate_cameras() # functions are available. dc1394_enumerate_cameras() was introduced after # libdc1394-2.0.0-rc7. DC1394_CAMERA_ENUMERATE_FOUND is TRUE when # dc1394_camera_enumerate() function is found. DC1394_FIND_CAMERAS_FOUND is # TRUE when dc1394_find_cameras() is found. # DC1394_CAMERA_ENUMERATE_FOUND # DC1394_FIND_CAMERAS_FOUND # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindDC1394.cmake: libdc1394 only available for Unix.") SET(DC1394_FOUND FALSE) ELSE(NOT UNIX) # Search for libdc1394-2.x FIND_PATH(DC1394_INCLUDE_DIR dc1394/control.h $ENV{DC1394_HOME}/include $ENV{DC1394_DIR}/include /usr/include ) #MESSAGE("DBG DC1394_INCLUDE_DIR=${DC1394_INCLUDE_DIR}") FIND_LIBRARY(DC1394_LIBRARY NAMES dc1394 PATHS $ENV{DC1394_HOME}/lib $ENV{DC1394_DIR}/lib /usr/lib ) #MESSAGE("DBG DC1394_LIBRARY=${DC1394_LIBRARY}") IF(DC1394_LIBRARY AND DC1394_INCLUDE_DIR) # Since the libdc1394-2.x API is not stable, try to compile a # sample code to determine if we have to use dc1394_find_cameras() or # dc1394_enumerate_cameras() functions. dc1394_enumerate_cameras() was # introduced after libdc1394-2.0.0-rc7 include(CheckCXXSourceCompiles) SET(CMAKE_REQUIRED_LIBRARIES ${DC1394_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${DC1394_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES(" #include #include int main(){ dc1394_t * d; dc1394camera_list_t * list; d = dc1394_new (); dc1394_camera_enumerate (d, &list); return 0; } " DC1394_CAMERA_ENUMERATE_FOUND) #MESSAGE("DC1394_CAMERA_ENUMERATE_FOUND: ${DC1394_CAMERA_ENUMERATE_FOUND}") IF(NOT DC1394_CAMERA_ENUMERATE_FOUND) # Try to test the compatibility to libdc1394-2.0.0-rc7 CHECK_CXX_SOURCE_COMPILES(" #include #include int main(){ dc1394camera_t **cameras; unsigned int num_cameras; dc1394_find_cameras(&cameras, &num_cameras); return 0; } " DC1394_FIND_CAMERAS_FOUND) #MESSAGE("DC1394_FIND_CAMERAS_FOUND: ${DC1394_FIND_CAMERAS_FOUND}") ENDIF(NOT DC1394_CAMERA_ENUMERATE_FOUND) IF(NOT DC1394_CAMERA_ENUMERATE_FOUND AND NOT DC1394_FIND_CAMERAS_FOUND) SET(DC1394_FOUND FALSE) MESSAGE("libdc1394-2.x found but not compatible with ViSP...") ELSE(NOT DC1394_CAMERA_ENUMERATE_FOUND AND NOT DC1394_FIND_CAMERAS_FOUND) SET(DC1394_FOUND TRUE) ENDIF(NOT DC1394_CAMERA_ENUMERATE_FOUND AND NOT DC1394_FIND_CAMERAS_FOUND) SET(DC1394_LIBRARIES ${DC1394_LIBRARY}) SET(DC1394_INCLUDE_DIRS ${DC1394_INCLUDE_DIR}) ENDIF(DC1394_LIBRARY AND DC1394_INCLUDE_DIR) ## -------------------------------- MARK_AS_ADVANCED( DC1394_LIBRARY DC1394_INCLUDE_DIR DC1394_INCLUDE_DIR DC1394_LIBRARIES DC1394_LIBRARY ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindDIRECT3D.cmake000066400000000000000000000107351264126442000165260ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Direct3D on Windows. This code comes originaly # from http://www.cmake.org/Wiki/CMakeUserFindDirectShow . # Once loaded this will define: # # DIRECT3D_FOUND - system has DirectShow # DIRECT3D_INCLUDE_DIRS - include directory for DirectShow # DIRECT3D_LIBRARIES - libraries you need to link to # # Authors: # Bruno Renier # ############################################################################# SET(DIRECT3D_FOUND "NO") # Direct3D is only available on Windows platforms IF(WIN32 AND NOT MINGW) # Find Direct3D Include Directory FIND_PATH(DIRECT3D_INCLUDE_DIR d3dx9.h "$ENV{DXSDK_DIR}/Include" "C:/Program Files/Microsoft DirectX SDK/Include" "C:/DXSDK/Include" NO_DEFAULT_PATH DOC "What is the path where the file d3dx9.h can be found" ) FIND_PATH(DIRECT3D_INCLUDE_DIR d3dx9.h NO_DEFAULT_PATH DOC "What is the path where the file d3dx9.h can be found" ) # if Direct3D include dir found, then find Direct3D libraries IF(DIRECT3D_INCLUDE_DIR) IF(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 "$ENV{DXSDK_DIR}/Lib" "$ENV{DXSDK_DIR}/Lib/x64" "C:/Program Files/Microsoft DirectX SDK/Lib/x64" "C:/DXSDK/Include/Lib/x64" NO_DEFAULT_PATH DOC "Where can the Direct3D d3d9 library be found" ) ELSE(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 "$ENV{DXSDK_DIR}/Lib" "$ENV{DXSDK_DIR}/Lib/x86" "C:/Program Files/Microsoft DirectX SDK/Lib/x86" "C:/DXSDK/Include/Lib/x86" NO_DEFAULT_PATH DOC "Where can the Direct3D d3d9 library be found" ) ENDIF(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 DOC "Where can the Direct3D d3d9 library be found" ) IF(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 "$ENV{DXSDK_DIR}/Lib/" "$ENV{DXSDK_DIR}/Lib/x64" "C:/Program Files/Microsoft DirectX SDK/Lib/x64" "C:/DXSDK/Include/Lib/x64" NO_DEFAULT_PATH DOC "Where can the Direct3D d3dx9 library be found" ) ELSE(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 "$ENV{DXSDK_DIR}/Lib/" "$ENV{DXSDK_DIR}/Lib/x86" "C:/Program Files/Microsoft DirectX SDK/Lib/x86" "C:/DXSDK/Include/Lib/x86" NO_DEFAULT_PATH DOC "Where can the Direct3D d3dx9 library be found" ) ENDIF(CMAKE_CL_64) FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 DOC "Where can the Direct3D d3dx9 library be found" ) # if Direct3D libraries found, then we're ok IF(DIRECT3D_d3d9_LIBRARY) IF(DIRECT3D_d3dx9_LIBRARY) # everything found SET(DIRECT3D_FOUND "YES") ENDIF(DIRECT3D_d3dx9_LIBRARY) ENDIF(DIRECT3D_d3d9_LIBRARY) ENDIF(DIRECT3D_INCLUDE_DIR) MARK_AS_ADVANCED( DIRECT3D_INCLUDE_DIR DIRECT3D_d3d9_LIBRARY DIRECT3D_d3dx9_LIBRARY ) ENDIF(WIN32 AND NOT MINGW) #--------------------------------------------------------------------- IF(DIRECT3D_FOUND) SET(DIRECT3D_INCLUDE_DIRS ${DIRECT3D_INCLUDE_DIR}) SET(DIRECT3D_LIBRARIES "${DIRECT3D_d3d9_LIBRARY}" "${DIRECT3D_d3dx9_LIBRARY}" ) ELSE(DIRECT3D_FOUND) # make FIND_PACKAGE friendly IF(NOT DIRECT3D_FIND_QUIETLY) IF(DIRECT3D_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Direct3D required, please specify it's location.") ENDIF(DIRECT3D_FIND_REQUIRED) ENDIF(NOT DIRECT3D_FIND_QUIETLY) ENDIF(DIRECT3D_FOUND) visp-3.0.0/cmake/FindDIRECTSHOW.cmake000066400000000000000000000261421264126442000170370ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Direct Show on Windows. This code comes originaly # from http://www.cmake.org/Wiki/CMakeUserFindDirectShow . # Once loaded this will define: # # DIRECTSHOW_FOUND - system has DirectShow # DIRECTSHOW_INCLUDE_DIRS - include directory for DirectShow # DIRECTSHOW_LIBRARIES - libraries you need to link to # # Authors: # Fabien Spindler # ############################################################################# SET(DIRECTSHOW_FOUND "NO") # DirectShow is only available on Windows platforms IF(WIN32 AND NOT MINGW) # find DirectX FIND_PATH(DIRECTX_INCLUDE_PATH ddraw.h "$ENV{DXSDK_DIR}/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" "C:/DXSDK/include" "C:/Program Files/Microsoft Platform SDK/Include" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" NO_DEFAULT_PATH DOC "What is the path where the file ddraw.h can be found" ) FIND_PATH(DIRECTX_INCLUDE_PATH ddraw.h DOC "What is the path where the file ddraw.h can be found" ) # find DirectShow include directory FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h "$ENV{WINSDK_HOME}/Include" "$ENV{DXSDK_DIR}/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" "C:/DXSDK/include" "C:/Program Files/Microsoft Platform SDK/Include" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" NO_DEFAULT_PATH DOC "What is the path where the file dshow.h can be found" ) FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h DOC "What is the path where the file dshow.h can be found" ) FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h "$ENV{WINSDK_HOME}/Include" "$ENV{DXSDK_DIR}/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" "C:/DXSDK/include" "C:/Program Files/Microsoft Platform SDK/Include" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" NO_DEFAULT_PATH DOC "What is the path where the file qedit.h can be found" ) FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h DOC "What is the path where the file qedit.h can be found" ) FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h DOC "What is the path where the file atlbase.h can be found" ) # Specific path search for Visual Studio .NET 2003 IF(MSVC71) IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/atlmfc/include" "$ENV{VS71COMNTOOLS}/../../Vc7/atlmfc/include" DOC "What is the path where the file atlbase.h can be found" ) ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) ENDIF(MSVC71) # Specific path search for Visual Studio 2005 IF(MSVC80) IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h "C:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/include" "$ENV{VS80COMNTOOLS}/../../VC/atlmfc/include" DOC "What is the path where the file atlbase.h can be found" ) ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) ENDIF(MSVC80) # Specific path search for Visual Studio 2008 IF(MSVC90) IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h "C:/Program Files/Microsoft Visual Studio 9.0/VC/atlmfc/include" "$ENV{VS90COMNTOOLS}/../../VC/atlmfc/include" DOC "What is the path where the file atlbase.h can be found" ) ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) ENDIF(MSVC90) # Specific path search for Visual Studio 2008 IF(MSVC10) IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h "C:/Program Files/Microsoft Visual Studio 10.0/VC/atlmfc/include" "$ENV{VS100COMNTOOLS}/../../VC/atlmfc/include" DOC "What is the path where the file atlbase.h can be found" ) ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) ENDIF(MSVC10) IF(DIRECTX_INCLUDE_PATH AND DIRECTSHOW_dshow_INCLUDE_PATH AND DIRECTSHOW_qedit_INCLUDE_PATH AND DIRECTSHOW_atlbase_INCLUDE_PATH) SET(DIRECTSHOW_INCLUDE_DIRS ${DIRECTX_INCLUDE_PATH} ${DIRECTSHOW_dshow_INCLUDE_PATH} ${DIRECTSHOW_qedit_INCLUDE_PATH} ${DIRECTSHOW_atlbase_INCLUDE_PATH}) ENDIF(DIRECTX_INCLUDE_PATH AND DIRECTSHOW_dshow_INCLUDE_PATH AND DIRECTSHOW_qedit_INCLUDE_PATH AND DIRECTSHOW_atlbase_INCLUDE_PATH) # if DirectShow include dir found, then find DirectShow libraries IF(DIRECTSHOW_INCLUDE_DIRS) IF(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY NAMES strmiids PATHS "$ENV{WINSDK_HOME}/Lib/x64" "$ENV{DXSDK_DIR}/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" "C:/DXSDK/lib/x64" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x64" "C:/Program Files/Microsoft Platform SDK/Lib/x64" NO_DEFAULT_PATH DOC "Where can the DirectShow strmiids library be found" ) ELSE(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY NAMES strmiids PATHS "$ENV{WINSDK_HOME}/Lib" "$ENV{WINSDK_HOME}/Lib/x86" "$ENV{DXSDK_DIR}/Lib" "$ENV{DXSDK_DIR}/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" "C:/DXSDK/lib" "C:/DXSDK/lib/x64" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" "C:/Program Files/Microsoft Platform SDK/Lib" NO_DEFAULT_PATH DOC "Where can the DirectShow strmiids library be found" ) ENDIF(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY NAMES strmiids DOC "Where can the DirectShow strmiids library be found" ) IF(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY NAMES quartz PATHS "$ENV{WINSDK_HOME}/Lib/x64" "$ENV{DXSDK_DIR}/Lib/x64" "C:/DXSDK/lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x64" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x64" "C:/Program Files/Microsoft Platform SDK/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" NO_DEFAULT_PATH DOC "Where can the DirectShow quartz library be found" ) ELSE(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY NAMES quartz PATHS "$ENV{WINSDK_HOME}/Lib/x86" "$ENV{DXSDK_DIR}/Lib/x86" "C:/DXSDK/lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x86" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x86" "C:/Program Files/Microsoft Platform SDK/Lib/x86" "C:/Program Files/Microsoft SDKs/Windows/v7.0A" "$ENV{WINSDK_HOME}/Lib" "$ENV{DXSDK_DIR}/Lib" "C:/DXSDK/lib" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" "C:/Program Files/Microsoft Platform SDK/Lib" NO_DEFAULT_PATH DOC "Where can the DirectShow quartz library be found" ) ENDIF(CMAKE_CL_64) FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY NAMES quartz DOC "Where can the DirectShow quartz library be found" ) # if DirectShow libraries found, then we're ok IF(DIRECTSHOW_strmiids_LIBRARY) IF(DIRECTSHOW_quartz_LIBRARY) # everything found SET(DIRECTSHOW_FOUND "YES") ENDIF(DIRECTSHOW_quartz_LIBRARY) ENDIF(DIRECTSHOW_strmiids_LIBRARY) ENDIF(DIRECTSHOW_INCLUDE_DIRS) MARK_AS_ADVANCED( DIRECTSHOW_INCLUDE_DIRS DIRECTSHOW_strmiids_LIBRARY DIRECTSHOW_quartz_LIBRARY DIRECTX_INCLUDE_PATH DIRECTSHOW_dshow_INCLUDE_PATH DIRECTSHOW_qedit_INCLUDE_PATH DIRECTSHOW_atlbase_INCLUDE_PATH ) ENDIF(WIN32 AND NOT MINGW) #--------------------------------------------------------------------- IF(DIRECTSHOW_FOUND) SET(DIRECTSHOW_LIBRARIES ${DIRECTSHOW_strmiids_LIBRARY} ${DIRECTSHOW_quartz_LIBRARY} ) ELSE(DIRECTSHOW_FOUND) # make FIND_PACKAGE friendly IF(NOT DIRECTSHOW_FIND_QUIETLY) IF(DIRECTSHOW_FIND_REQUIRED) MESSAGE(FATAL_ERROR "DirectShow required, please specify it's location.") ENDIF(DIRECTSHOW_FIND_REQUIRED) ENDIF(NOT DIRECTSHOW_FIND_QUIETLY) ENDIF(DIRECTSHOW_FOUND) visp-3.0.0/cmake/FindDL.cmake000066400000000000000000000031231264126442000156550ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find dl library. # Once run this will define: # # DL_FOUND # DL_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# FIND_LIBRARY(DL_LIBRARY NAMES dl PATHS $ENV{DL_HOME}/lib /usr/lib /usr/local/lib ) #MESSAGE("DBG DL_LIBRARY=${DL_LIBRARY}") IF(DL_LIBRARY) SET(DL_LIBRARIES ${DL_LIBRARY}) SET(DL_FOUND TRUE) ELSE() SET(DL_FOUND FALSE) ENDIF() MARK_AS_ADVANCED( DL_LIBRARY ) visp-3.0.0/cmake/FindDMTX.cmake000066400000000000000000000032541264126442000161370ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find dmtx library. # Once run this will define: # # DMTX_FOUND # DMTX_INCLUDE_DIRS # DMTX_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# find_path(DMTX_INCLUDE_DIRS dmtx.h $ENV{DMTX_DIR}/include /usr/include /usr/local/include ) find_library(DMTX_LIBRARIES NAMES dmtx PATHS $ENV{DMTX_DIR}/lib /usr/lib /usr/local/lib ) if(DMTX_INCLUDE_DIRS AND DMTX_LIBRARIES) set(DMTX_FOUND TRUE) else() set(DMTX_FOUND FALSE) endif() mark_as_advanced( DMTX_INCLUDE_DIRS DMTX_LIBRARIES ) visp-3.0.0/cmake/FindFFMPEG.cmake000066400000000000000000000166241264126442000163340ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find FFMPEG. FFMpeg depend son Zlib. # Once run this will define: # # FFMPEG_FOUND - system has FFMPEG # FFMPEG_INCLUDE_DIRS - the FFMPEG include directory # FFMPEG_LIBRARIES - Link these to use FFMPEG # # Authors: # Fabien Spindler # ############################################################################# # detection of the FFMPEG headers location if(MINGW) find_path(FFMPEG_INCLUDE_DIR_AVCODEC NAMES libavcodec/avcodec.h PATHS "$ENV{MINGW_DIR}/include" C:/mingw/include PATH_SUFFIXES ffmpeg ) find_path(FFMPEG_INCLUDE_DIR_AVFORMAT NAMES libavformat/avformat.h PATHS "$ENV{MINGW_DIR}/include" C:/mingw/include PATH_SUFFIXES ffmpeg ) find_path(FFMPEG_INCLUDE_DIR_AVUTIL NAMES libavutil/avutil.h PATHS "$ENV{MINGW_DIR}/include" C:/mingw/include PATH_SUFFIXES ffmpeg ) find_path(FFMPEG_INCLUDE_DIR_SWSCALE NAMES libswscale/swscale.h PATHS "$ENV{MINGW_DIR}/include" C:/mingw/include PATH_SUFFIXES libswscale ffmpeg ) # Detection of the FFMPEG library on Unix find_library(FFMPEG_AVUTIL_LIBRARY NAMES avutil PATHS "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) find_library(FFMPEG_AVCODEC_LIBRARY NAMES avcodec PATHS "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) find_library(FFMPEG_AVFORMAT_LIBRARY NAMES avformat PATHS "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) find_library(FFMPEG_AVCORE_LIBRARY NAMES avcore PATHS "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) find_library(FFMPEG_SWSCALE_LIBRARY NAMES swscale PATHS "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) else(MINGW) find_path(FFMPEG_INCLUDE_DIR_AVCODEC NAMES libavcodec/avcodec.h PATHS "/usr/include" "/usr/local/include" $ENV{FFMPEG_DIR}/include $ENV{FFMPEG_DIR} PATH_SUFFIXES ffmpeg ) find_path(FFMPEG_INCLUDE_DIR_AVFORMAT NAMES libavformat/avformat.h PATHS "/usr/include" "/usr/local/include" $ENV{FFMPEG_DIR}/include $ENV{FFMPEG_DIR} PATH_SUFFIXES ffmpeg ) find_path(FFMPEG_INCLUDE_DIR_AVUTIL NAMES libavutil/avutil.h PATHS "/usr/include" "/usr/local/include" $ENV{FFMPEG_DIR}/include $ENV{FFMPEG_DIR} PATH_SUFFIXES ffmpeg ) find_path(FFMPEG_INCLUDE_DIR_SWSCALE NAMES libswscale/swscale.h PATHS "/usr/include" "/usr/local/include" $ENV{FFMPEG_DIR}/include $ENV{FFMPEG_DIR} PATH_SUFFIXES libswscale ffmpeg ) # Detection of the FFMPEG library on Unix find_library(FFMPEG_AVUTIL_LIBRARY NAMES avutil PATHS /usr/lib /usr/local/lib /lib $ENV{FFMPEG_DIR}/lib $ENV{FFMPEG_DIR}/Release $ENV{FFMPEG_DIR} ) find_library(FFMPEG_AVCODEC_LIBRARY NAMES avcodec PATHS /usr/lib /usr/local/lib /lib $ENV{FFMPEG_DIR}/lib $ENV{FFMPEG_DIR}/Release $ENV{FFMPEG_DIR} ) find_library(FFMPEG_AVFORMAT_LIBRARY NAMES avformat PATHS /usr/lib /usr/local/lib /lib $ENV{FFMPEG_DIR}/lib $ENV{FFMPEG_DIR}/Release $ENV{FFMPEG_DIR} ) find_library(FFMPEG_AVCORE_LIBRARY NAMES avcore PATHS /usr/lib /usr/local/lib /lib $ENV{FFMPEG_DIR}/lib $ENV{FFMPEG_DIR}/Release $ENV{FFMPEG_DIR} ) find_library(FFMPEG_SWSCALE_LIBRARY NAMES swscale PATHS /usr/lib /usr/local/lib /lib $ENV{FFMPEG_DIR}/lib $ENV{FFMPEG_DIR}/Release $ENV{FFMPEG_DIR} ) endif(MINGW) # FFMpeg depend son Zlib FIND_PACKAGE(ZLIB) if(NOT ZLIB_FOUND) FIND_PACKAGE(MyZLIB) endif() # FFMpeg depend son BZip2 # with CMake 2.6, the CMake bzip2 package material is named FindBZip2.cmake # while with CMake 2.8, the name is FindBZIP2.cmake # that is why we need to call FIND_PACKAGE(BZip2) and FIND_PACKAGE(BZIP2) FIND_PACKAGE(BZIP2 QUIET) # MESSAGE("BZIP2_FOUND: ${BZIP2_FOUND}") if(NOT BZIP2_FOUND) FIND_PACKAGE(BZip2 QUIET) # MESSAGE("BZIP2_FOUND: ${BZIP2_FOUND}") endif() # FFMpeg may depend also on iconv since probably version 1.1.3 where if detected, # iconv usage is enabled by default find_package(ICONV QUIET) #message("ICONV_FOUND: ${ICONV_FOUND}") IF(FFMPEG_INCLUDE_DIR_AVCODEC AND FFMPEG_INCLUDE_DIR_AVFORMAT AND FFMPEG_INCLUDE_DIR_AVUTIL AND FFMPEG_INCLUDE_DIR_SWSCALE AND FFMPEG_SWSCALE_LIBRARY AND FFMPEG_AVFORMAT_LIBRARY AND FFMPEG_AVCODEC_LIBRARY AND FFMPEG_AVUTIL_LIBRARY AND ZLIB_LIBRARIES AND BZIP2_LIBRARIES) SET(FFMPEG_FOUND TRUE) SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIR_AVCODEC} ${FFMPEG_INCLUDE_DIR_AVFORMAT} ${FFMPEG_INCLUDE_DIR_AVUTIL} ${FFMPEG_INCLUDE_DIR_SWSCALE} ) SET(FFMPEG_LIBRARIES ${FFMPEG_SWSCALE_LIBRARY} ${FFMPEG_AVFORMAT_LIBRARY} ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY} ) if(FFMPEG_AVCORE_LIBRARY) LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_AVCORE_LIBRARY}) endif() list(APPEND FFMPEG_LIBRARIES ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES}) if(ICONV_FOUND) list(APPEND FFMPEG_LIBRARIES ${ICONV_LIBRARIES}) endif() elseif(MINGW AND FFMPEG_INCLUDE_DIR_AVCODEC AND FFMPEG_INCLUDE_DIR_AVFORMAT AND FFMPEG_INCLUDE_DIR_AVUTIL AND FFMPEG_INCLUDE_DIR_SWSCALE AND FFMPEG_SWSCALE_LIBRARY AND FFMPEG_AVFORMAT_LIBRARY AND FFMPEG_AVCODEC_LIBRARY AND FFMPEG_AVUTIL_LIBRARY AND ZLIB_LIBRARIES) # Bzip2 is nor requested with mingw-w64 SET(FFMPEG_FOUND TRUE) SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIR_AVCODEC} ${FFMPEG_INCLUDE_DIR_AVFORMAT} ${FFMPEG_INCLUDE_DIR_AVUTIL} ${FFMPEG_INCLUDE_DIR_SWSCALE} ) SET(FFMPEG_LIBRARIES ${FFMPEG_SWSCALE_LIBRARY} ${FFMPEG_AVFORMAT_LIBRARY} ${FFMPEG_AVCODEC_LIBRARY} ${FFMPEG_AVUTIL_LIBRARY} ) if(FFMPEG_AVCORE_LIBRARY) LIST(APPEND FFMPEG_LIBRARIES ${FFMPEG_AVCORE_LIBRARY}) endif() list(APPEND FFMPEG_LIBRARIES ${ZLIB_LIBRARIES}) if(ICONV_FOUND) list(APPEND FFMPEG_LIBRARIES ${ICONV_LIBRARIES}) endif() ELSE() SET(FFMPEG_FOUND FALSE) ENDIF () MARK_AS_ADVANCED( BZIP2_DIR FFMPEG_INCLUDE_DIR_AVCODEC FFMPEG_INCLUDE_DIR_AVFORMAT FFMPEG_INCLUDE_DIR_AVUTIL FFMPEG_INCLUDE_DIR_SWSCALE FFMPEG_AVUTIL_LIBRARY FFMPEG_AVFORMAT_LIBRARY FFMPEG_AVCODEC_LIBRARY FFMPEG_SWSCALE_LIBRARY FFMPEG_AVCORE_LIBRARY FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES ) visp-3.0.0/cmake/FindGDI.cmake000066400000000000000000000140601264126442000157630ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find GDI (Graphics Device Interface) on Windows. # Once loaded this will define: # # GDI_FOUND - system has GDI # GDI_LIBRARIES - libraries you need to link to # # Authors: # Fabien Spindler # ############################################################################# SET(GDI_FOUND "NO") # GDI (Graphics Device Interface) is only available on Windows platforms IF(WIN32) IF(MINGW) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/MinGW/lib" "C:/mingw/mingw/lib" "$ENV{MINGW_DIR}/lib" "$ENV{MINGW_DIR}/mingw/lib" DOC "Where can the GDI (Graphics Device Interface) library be found" NO_DEFAULT_PATH ) ELSE(MINGW) IF(CMAKE_CL_64) # Generic path search FIND_LIBRARY(GDI_LIBRARY gdi32 "$ENV{WINSDK_DIR}/Lib/x64" "$ENV{WINSDK_HOME}/Lib/x64" "$ENV{DXSDK_DIR}/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.0a/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v7.1/Lib/x64" "C:/Program Files/Microsoft SDKs/Windows/v7.1A/Lib/x64" "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/x64" "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/x64" "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64" "C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64" "C:/Program Files/Microsoft Platform SDK/Lib/x64" "C:/DXSDK/Include/Lib/x64" DOC "Where can the GDI (Graphics Device Interface) library be found" ) # Specific path search for Visual Studio .NET 2003 IF(MSVC71) IF(NOT GDI_LIBRARY) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" ) ENDIF(NOT GDI_LIBRARY) ENDIF(MSVC71) # Specific path search for Visual Studio 2005 IF(MSVC80) IF(NOT GDI_LIBRARY) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib/AMD64" ) ENDIF(NOT GDI_LIBRARY) ENDIF(MSVC80) # Specific path search for Visual Studio 2008 IF(MSVC90) IF(NOT GDI_LIBRARY) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib/AMD64" ) ENDIF(NOT GDI_LIBRARY) ENDIF(MSVC90) ELSE(CMAKE_CL_64) # Generic path search FIND_LIBRARY(GDI_LIBRARY gdi32 "$ENV{WINSDK_DIR}/Lib" "$ENV{WINSDK_HOME}/Lib" "$ENV{DXSDK_DIR}/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.0a/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Lib" "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib" "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86" "C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86" "C:/Program Files/Microsoft Platform SDK/Lib" "C:/DXSDK/Include/Lib" DOC "Where can the GDI (Graphics Device Interface) library be found" ) # Specific path search for Visual Studio .NET 2003 IF(MSVC71) IF(NOT GDI_LIBRARY) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" ) ENDIF(NOT GDI_LIBRARY) ENDIF(MSVC71) # Specific path search for Visual Studio 2005 IF(MSVC80) IF(NOT GDI_LIBRARY) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib" ) ENDIF(NOT GDI_LIBRARY) ENDIF(MSVC80) # Specific path search for Visual Studio 2008 IF(MSVC90) IF(NOT GDI_LIBRARY) FIND_LIBRARY(GDI_LIBRARY gdi32 "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib" ) ENDIF(NOT GDI_LIBRARY) ENDIF(MSVC90) ENDIF(CMAKE_CL_64) ENDIF(MINGW) # if GDI libraries found, then we're ok IF(GDI_LIBRARY) SET(GDI_FOUND "YES") SET(GDI_LIBRARIES ${GDI_LIBRARY}) ENDIF(GDI_LIBRARY) MARK_AS_ADVANCED(GDI_LIBRARY) ENDIF(WIN32) visp-3.0.0/cmake/FindGSL.cmake000066400000000000000000000124261264126442000160110ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find gnu scientific library GSL # (see http://www.gnu.org/software/gsl/) # Once run this will define: # # GSL_FOUND : system has GSL lib # GSL_LIBRARIES : full path to the libraries # GSL_INCLUDE_DIRS : where to find headers # # Authors: # Fabien Spindler # ############################################################################# # it seems that a macro() can't accept a list as input. That's why we have # MY_LIBRARY1 and MY_LIBRARY2 macro(CheckCompilation_gsl2 MY_INCLUDE_DIR MY_LIBRARY1 MY_LIBRARY2 MY_BUILD_SUCCEED2) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) #message("Test compilation: ${MY_INCLUDE_DIR} + ${MY_LIBRARY1} + ${MY_LIBRARY2}") set(CMAKE_REQUIRED_LIBRARIES ${MY_LIBRARY1} ${MY_LIBRARY2}) set(CMAKE_REQUIRED_INCLUDES ${MY_INCLUDE_DIR}) check_cxx_source_compiles(" #include // Contrib for GSL library #include #include int main() { gsl_matrix *A2 = gsl_matrix_alloc(6, 6) ; } " BUILD_SUCCEED2) #message("BUILD_SUCCEED: ${BUILD_SUCCEED}") set(${MY_BUILD_SUCCEED2} ${BUILD_SUCCEED2}) endmacro() macro(CheckCompilation_gsl1 MY_INCLUDE_DIR MY_LIBRARY MY_BUILD_SUCCEED) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) #message("Test compilation: ${MY_INCLUDE_DIR} + ${MY_LIBRARY}") set(CMAKE_REQUIRED_LIBRARIES ${MY_LIBRARY}) set(CMAKE_REQUIRED_INCLUDES ${MY_INCLUDE_DIR}) check_cxx_source_compiles(" #include // Contrib for GSL library #include #include int main() { gsl_matrix *A1 = gsl_matrix_alloc(6, 6) ; } " BUILD_SUCCEED) #message("BUILD_SUCCEED: ${BUILD_SUCCEED}") set(${MY_BUILD_SUCCEED} ${BUILD_SUCCEED}) endmacro() set(GSL_LIB_SEARCH_PATH "$ENV{GSL_HOME}/lib" "$ENV{GSL_DIR}/lib" /usr/lib /usr/local/lib ) set(GSL_INC_SEARCH_PATH $ENV{GSL_HOME}/include $ENV{GSL_DIR}/include /usr/include /usr/local/include ) find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h ${GSL_INC_SEARCH_PATH} ) find_library(GSL_gsl_LIBRARY NAMES gsl PATHS ${GSL_LIB_SEARCH_PATH} ) if(WIN32) find_library(GSL_cblas_LIBRARY NAMES cblas PATHS ${GSL_LIB_SEARCH_PATH} ) find_library(GSL_gsl_LIBRARY_DEBUG NAMES gsl_d PATHS ${GSL_LIB_SEARCH_PATH} ) find_library(GSL_cblas_LIBRARY_DEBUG NAMES cblas_d PATHS ${GSL_LIB_SEARCH_PATH} ) if(GSL_INCLUDE_DIR AND GSL_gsl_LIBRARY AND GSL_cblas_LIBRARY AND GSL_gsl_LIBRARY_DEBUG AND GSL_cblas_LIBRARY_DEBUG) set(GSL_LIBRARIES "optimized" ${GSL_cblas_LIBRARY} "optimized" ${GSL_gsl_LIBRARY} "debug" ${GSL_cblas_LIBRARY_DEBUG} "debug" ${GSL_gsl_LIBRARY_DEBUG}) set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR}) set(GSL_FOUND TRUE) else() set(GSL_FOUND FALSE) endif() mark_as_advanced( GSL_gsl_LIBRARY_DEBUG GSL_cblas_LIBRARY_DEBUG ) else() if(GSL_INCLUDE_DIR AND GSL_gsl_LIBRARY) # Check if gsl library is sufficient set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR}) set(GSL_LIBRARIES ${GSL_gsl_LIBRARY}) CheckCompilation_gsl1(${GSL_INCLUDE_DIRS} ${GSL_gsl_LIBRARY} BUILD_SUCCEED1) #message("BUILD_STATUS 1: ${BUILD_SUCCEED1}") if(BUILD_SUCCEED1) set(GSL_FOUND TRUE) else() # Try to add gslcblas library if requested find_library(GSL_cblas_LIBRARY NAMES gslcblas PATHS ${GSL_LIB_SEARCH_PATH} ) if(GSL_cblas_LIBRARY) list(APPEND GSL_LIBRARIES ${GSL_cblas_LIBRARY}) #message("add cblas to GSL_LIBRARIES: ${GSL_LIBRARIES}") CheckCompilation_gsl2(${GSL_INCLUDE_DIRS} ${GSL_gsl_LIBRARY} ${GSL_cblas_LIBRARY} BUILD_SUCCEED2) #message("BUILD_STATUS 2: ${BUILD_SUCCEED2}") if(BUILD_SUCCEED2) set(GSL_FOUND TRUE) else() set(GSL_FOUND FALSE) endif() else() set(GSL_FOUND FALSE) endif() endif() else() set(GSL_FOUND FALSE) endif() endif() mark_as_advanced( GSL_gsl_LIBRARY GSL_cblas_LIBRARY GSL_INCLUDE_DIR ) visp-3.0.0/cmake/FindICONV.cmake000066400000000000000000000042461264126442000162430ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find ICONV library. # Once run this will define: # # ICONV_FOUND # ICONV_INCLUDE_DIRS # ICONV_LIBRARIES # # Authors: # Anthony Saunier # ############################################################################# if(MINGW) find_path(ICONV_INCLUDE_DIR iconv.h "$ENV{MINGW_DIR}/include" C:/mingw/include ) find_library(ICONV_LIBRARY iconv "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) else() find_path(ICONV_INCLUDE_DIR iconv.h $ENV{ICONV_DIR}/include $ENV{ICONV_HOME}/include $ENV{XML2_DIR}/include $ENV{XML2_HOME}/include "c:/libxml2/include" "c:/iconv/include" ) find_library(ICONV_LIBRARY iconv $ENV{ICONV_DIR}/lib $ENV{ICONV_HOME}/lib $ENV{XML2_DIR}/lib $ENV{XML2_HOME}/lib "c:/libxml2/lib" "c:/iconv/lib" ) endif() if(ICONV_LIBRARY) SET(ICONV_LIBRARIES ${ICONV_LIBRARY}) endif() if(ICONV_LIBRARIES AND ICONV_INCLUDE_DIR) SET(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR}) SET(ICONV_FOUND TRUE) else() SET(ICONV_FOUND FALSE) endif() mark_as_advanced( ICONV_INCLUDE_DIR ICONV_LIBRARIES ICONV_LIBRARY ) visp-3.0.0/cmake/FindIRISA.cmake000066400000000000000000000050331264126442000162270ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Cerebellum Irisa library API to dial with the robot Afma6 # # IRISA_FOUND # IRISA_INCLUDE_DIRS # IRISA_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindIRISA.cmake: only available for Unix.") SET(IRISA_FOUND FALSE) ELSE(NOT UNIX) FIND_PATH(IRISA_INCLUDE_DIR irisa_Afma6.h $ENV{IRISA_HOME}/include /local/soft/Cerebellum/Irisa/current/src /home/soft/Cerebellum/Irisa/current/src ) #MESSAGE("DBG IRISA_INCLUDE_DIR=${IRISA_INCLUDE_DIR}") FIND_LIBRARY(IRISA_LIBRARY NAMES irisa PATHS $ENV{IRISA_HOME}/lib /local/soft/Cerebellum/Irisa/current/src /home/soft/Cerebellum/Irisa/current/src ) #MESSAGE("DBG IRISA_LIBRARY=${IRISA_LIBRARY}") ## -------------------------------- IF(IRISA_LIBRARY) SET(IRISA_LIBRARIES ${IRISA_LIBRARY}) ELSE(IRISA_LIBRARY) #MESSAGE(SEND_ERROR "Irisa library not found.") ENDIF(IRISA_LIBRARY) IF(NOT IRISA_INCLUDE_DIR) #MESSAGE(SEND_ERROR "Irisa include dir not found.") ENDIF(NOT IRISA_INCLUDE_DIR) IF(IRISA_LIBRARIES AND IRISA_INCLUDE_DIR) SET(IRISA_INCLUDE_DIRS ${IRISA_INCLUDE_DIR}) SET(IRISA_FOUND TRUE) ELSE(IRISA_LIBRARIES AND IRISA_INCLUDE_DIR) SET(IRISA_FOUND FALSE) ENDIF(IRISA_LIBRARIES AND IRISA_INCLUDE_DIR) MARK_AS_ADVANCED( IRISA_INCLUDE_DIR IRISA_LIBRARIES IRISA_LIBRARY ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindIsInf.cmake000066400000000000000000000036611264126442000163750ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find isnan macro, std::isnan function or _isnan function. # # Authors: # Souriya Trinh # ############################################################################# include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckCXXSourceCompiles) macro(check_math_expr _expr _var) check_cxx_source_compiles(" #include int main(int argc, char ** argv) { (void)${_expr}; return 0; } " ${_var}) endmacro() check_include_files("float.h" HAVE_FLOAT_H) check_math_expr("isinf(1.0)" HAVE_FUNC_ISINF) check_math_expr("std::isinf(1.0)" HAVE_FUNC_STD_ISINF) if(HAVE_FLOAT_H) # The version that should work with MSVC check_cxx_source_compiles(" #include int main(int argc, char ** argv) { (void)_finite(1.0); return 0; } " HAVE_FUNC__ISINF) else() set(HAVE_FUNC__FINITE FALSE) endif() visp-3.0.0/cmake/FindIsNaN.cmake000066400000000000000000000036571264126442000163420ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find isnan macro, std::isnan function or _isnan function. # # Authors: # Souriya Trinh # ############################################################################# include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckCXXSourceCompiles) macro(check_math_expr _expr _var) check_cxx_source_compiles(" #include int main(int argc, char ** argv) { (void)${_expr}; return 0; } " ${_var}) endmacro() check_include_files("float.h" HAVE_FLOAT_H) check_math_expr("isnan(1.0)" HAVE_FUNC_ISNAN) check_math_expr("std::isnan(1.0)" HAVE_FUNC_STD_ISNAN) if(HAVE_FLOAT_H) # The version that should work with MSVC check_cxx_source_compiles(" #include int main(int argc, char ** argv) { (void)_isnan(1.0); return 0; } " HAVE_FUNC__ISNAN) else() set(HAVE_FUNC__ISNAN FALSE) endif() visp-3.0.0/cmake/FindLAPACK_C.cmake000066400000000000000000000100751264126442000165570ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find lapack, the Linear Algebra PACKage. # Since the FindLAPACK.cmake provided with CMake is for Fortran language, # this file is able to detect lapack for C language. # Once run this will define: # # LAPACK_C_FOUND # LAPACK_C_LIBRARIES # # Authors: # Filip Novotny # Fabien Spindler # ############################################################################# set(LAPACK_C_FOUND FALSE) set(LAPACK_C_LIBRARIES "") if(WIN32) set(LAPACK_C_LIB_SEARCH_PATH $ENV{LAPACK_C_HOME} $ENV{LAPACK_C_DIR} $ENV{LAPACK_C_HOME}/lib $ENV{LAPACK_C_DIR}/lib $ENV{LAPACK_HOME} $ENV{LAPACK_DIR} $ENV{LAPACK_HOME}/lib $ENV{LAPACK_DIR}/lib ) find_library(LAPACK_C_LIBRARY_LAPACK_C_RELEASE NAMES lapack PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) find_library(LAPACK_C_LIBRARY_BLAS_RELEASE NAMES blas PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) find_library(LAPACK_C_LIBRARY_F2C_RELEASE NAMES libf2c PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) find_library(LAPACK_C_LIBRARY_LAPACK_C_DEBUG NAMES lapackd PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) find_library(LAPACK_C_LIBRARY_BLAS_DEBUG NAMES blasd PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) find_library(LAPACK_C_LIBRARY_F2C_DEBUG NAMES libf2cd PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) if((LAPACK_C_LIBRARY_LAPACK_C_RELEASE AND LAPACK_C_LIBRARY_BLAS_RELEASE AND LAPACK_C_LIBRARY_F2C_RELEASE)) list(APPEND LAPACK_C_LIBRARIES optimized ${LAPACK_C_LIBRARY_LAPACK_C_RELEASE}) list(APPEND LAPACK_C_LIBRARIES optimized ${LAPACK_C_LIBRARY_BLAS_RELEASE}) list(APPEND LAPACK_C_LIBRARIES optimized ${LAPACK_C_LIBRARY_F2C_RELEASE}) set(LAPACK_C_FOUND TRUE) endif() if((LAPACK_C_LIBRARY_LAPACK_C_DEBUG AND LAPACK_C_LIBRARY_BLAS_DEBUG AND LAPACK_C_LIBRARY_F2C_DEBUG)) list(APPEND LAPACK_C_LIBRARIES debug ${LAPACK_C_LIBRARY_LAPACK_C_DEBUG}) list(APPEND LAPACK_C_LIBRARIES debug ${LAPACK_C_LIBRARY_BLAS_DEBUG}) list(APPEND LAPACK_C_LIBRARIES debug ${LAPACK_C_LIBRARY_F2C_DEBUG}) set(LAPACK_C_FOUND TRUE) endif() else(WIN32) set(LAPACK_C_LIB_SEARCH_PATH $ENV{LAPACK_C_HOME} $ENV{LAPACK_C_DIR} $ENV{LAPACK_C_HOME}/lib $ENV{LAPACK_C_DIR}/lib $ENV{LAPACK_HOME} $ENV{LAPACK_DIR} $ENV{LAPACK_HOME}/lib $ENV{LAPACK_DIR}/lib /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 ) find_library(LAPACK_C_LIBRARY_LAPACK NAMES lapack PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) find_library(LAPACK_C_LIBRARY_BLAS NAMES blas PATHS ${LAPACK_C_LIB_SEARCH_PATH} ) if((LAPACK_C_LIBRARY_LAPACK AND LAPACK_C_LIBRARY_BLAS)) set(LAPACK_C_LIBRARIES ${LAPACK_C_LIBRARY_LAPACK} ${LAPACK_C_LIBRARY_BLAS}) set(LAPACK_C_FOUND TRUE) endif() endif(WIN32) mark_as_advanced( LAPACK_C_LIBRARIES LAPACK_C_LIBRARY_LAPACK LAPACK_C_LIBRARY_BLAS LAPACK_C_LIBRARY_LAPACK_C_RELEASE LAPACK_C_LIBRARY_BLAS_RELEASE LAPACK_C_LIBRARY_LAPACK_C_DEBUG LAPACK_C_LIBRARY_BLAS_DEBUG LAPACK_C_LIBRARY_F2C_DEBUG LAPACK_C_LIBRARY_F2C_RELEASE ) visp-3.0.0/cmake/FindLIBFREENECT.cmake000066400000000000000000000054471264126442000171130ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Cerebellum Irisa library API to dial with the robot Afma6 # # LIBFREENECT_FOUND # LIBFREENECT_INCLUDE_DIRS # LIBFREENECT_LIBRARIES # # Authors: # Celine Teuliere # Fabien Spindler IF(WIN32) FIND_PATH(LIBFREENECT_HPP_INCLUDE_DIR libfreenect.hpp $ENV{LIBFREENECT_HOME}/include $ENV{LIBFREENECT_HPP_INCLUDE_DIR} $ENV{LIBFREENECT_H_INCLUDE_DIR} ) FIND_PATH(LIBFREENECT_H_INCLUDE_DIR libfreenect.h $ENV{LIBFREENECT_HOME}/include $ENV{LIBFREENECT_HPP_INCLUDE_DIR} $ENV{LIBFREENECT_H_INCLUDE_DIR} ) FIND_LIBRARY(LIBFREENECT_LIBRARY freenect $ENV{LIBFREENECT_HOME}/lib $ENV{LIBFREENECT_LIBRARY_DIR} "c:/libfreenect/lib" ) ELSE() FIND_PATH(LIBFREENECT_HPP_INCLUDE_DIR libfreenect.hpp $ENV{LIBFREENECT_HOME}/include /usr/include /usr/local/include /usr/include/libfreenect /usr/local/include/libfreenect ) FIND_PATH(LIBFREENECT_H_INCLUDE_DIR libfreenect.h $ENV{LIBFREENECT_HOME}/include /usr/include /usr/local/include /usr/include/libfreenect /usr/local/include/libfreenect ) FIND_LIBRARY(LIBFREENECT_LIBRARY freenect $ENV{LIBFREENECT_HOME}/lib $ENV{LIBFREENECT_HOME}/build/lib /usr/lib /usr/local/lib ) ENDIF() ## -------------------------------- IF(LIBFREENECT_LIBRARY AND LIBFREENECT_HPP_INCLUDE_DIR AND LIBFREENECT_H_INCLUDE_DIR) SET(LIBFREENECT_INCLUDE_DIRS ${LIBFREENECT_HPP_INCLUDE_DIR} ${LIBFREENECT_H_INCLUDE_DIR}) SET(LIBFREENECT_LIBRARIES ${LIBFREENECT_LIBRARY}) SET(LIBFREENECT_FOUND TRUE) ELSE() SET(LIBFREENECT_FOUND FALSE) ENDIF() MARK_AS_ADVANCED( LIBFREENECT_INCLUDE_DIRS LIBFREENECT_HPP_INCLUDE_DIR LIBFREENECT_H_INCLUDE_DIR LIBFREENECT_LIBRARIES LIBFREENECT_LIBRARY ) visp-3.0.0/cmake/FindLIBUSB_1.cmake000066400000000000000000000042041264126442000165570ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libusb-1.0 library. Headers include dir is not searched. # # LIBUSB_1_FOUND # LIBUSB_1_LIBRARIES # LIBUSB_1_INCLUDE_DIRS # # Authors: # Celine Teuliere # Fabien Spindler IF(WIN32) FIND_LIBRARY(LIBUSB_1_LIBRARY libusb $ENV{LIBUSB_1_HOME} $ENV{LIBUSB_1_HOME}/lib "c:/libusb/lib" ) ELSE(WIN32) FIND_LIBRARY(LIBUSB_1_LIBRARY usb-1.0 $ENV{LIBUSB_1_HOME}/lib $ENV{LIBUSB_1_HOME}/build/lib /lib/ /lib64/ /usr/lib /usr/local/lib ) FIND_PATH(LIBUSB_1_INCLUDE_DIR libusb.h $ENV{LIBUSB_1_HOME}/include/libusb-1.0 $ENV{LIBUSB_1_HOME}/build/include/libusb-1.0 /usr/include/libusb-1.0 /usr/local/include/libusb-1.0 ) ENDIF(WIN32) ## -------------------------------- IF(LIBUSB_1_LIBRARY AND LIBUSB_1_INCLUDE_DIR) SET(LIBUSB_1_INCLUDE_DIRS ${LIBUSB_1_INCLUDE_DIR}) SET(LIBUSB_1_LIBRARIES ${LIBUSB_1_LIBRARY}) SET(LIBUSB_1_FOUND TRUE) ELSE() SET(LIBUSB_1_FOUND FALSE) ENDIF() MARK_AS_ADVANCED( LIBUSB_1_INCLUDE_DIRS LIBUSB_1_INCLUDE_DIR LIBUSB_1_LIBRARIES LIBUSB_1_LIBRARY ) visp-3.0.0/cmake/FindMyCoin3D.cmake000066400000000000000000000154271264126442000167550ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find Coin library. Try first to see if Coin3D-3 is available. If not, # check for Coin3D-2. # Once run this will define: # # COIN3D_FOUND # COIN3D_LIBRARIES # COIN3D_INCLUDE_DIRS # # Authors: # Fabien Spindler # ############################################################################# MACRO(TRY_COMPILE_WITH_COIN COIN3D_LIB COIN3D_INC) # Try to compile a sample code using Coin release library include(CheckCXXSourceCompiles) SET(CMAKE_REQUIRED_LIBRARIES "${COIN3D_LIB}") SET(CMAKE_REQUIRED_INCLUDES "${COIN3D_INC}") SET(CMAKE_REQUIRED_DEFINITIONS "-DCOIN_DLL") #MESSAGE("COIN3D_LIB: ${COIN3D_LIB}") #MESSAGE("COIN3D_INC: ${COIN3D_INC}") CHECK_CXX_SOURCE_COMPILES(" #include int main(){ SoSeparator *scene = new SoSeparator; return 0; } " IS_COMPILER_COMPATIBLE) #MESSAGE("DBG1 IS_COMPILER_COMPATIBLE ${IS_COMPILER_COMPATIBLE}") ENDMACRO(TRY_COMPILE_WITH_COIN) IF(UNIX OR WIN32) FIND_PATH(COIN3D_INCLUDE_DIR Inventor/nodes/SoSeparator.h $ENV{COIN_DIR}/include $ENV{COINDIR}/include $ENV{COIN_DIR} $ENV{COINDIR} $ENV{COIN3D_DIR}/include $ENV{COIN3DDIR}/include /usr/include /usr/include/Coin2 /Library/Frameworks/Inventor.framework/Headers ) #MESSAGE("DBG COIN3D_INCLUDE_DIR=${COIN3D_INCLUDE_DIR}") IF(WIN32) # Try first to find Coin3D-3 and only if not found Coin3D-2 FIND_LIBRARY(COIN3D_LIBRARY_RELEASE NAMES coin3 coin4 #only shared libraries under windows PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{COIN3DDIR}/lib" "$ENV{COIN3D_DIR}/lib" ) FIND_LIBRARY(COIN3D_LIBRARY_DEBUG NAMES coin3d coin4d #only shared libraries under windows PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{COIN3DDIR}/lib" "$ENV{COIN3D_DIR}/lib" ) #MESSAGE("DBG COIN3D_LIBRARY_RELEASE=${COIN3D_LIBRARY_RELEASE}") #MESSAGE("DBG COIN3D_LIBRARY_DEBUG=${COIN3D_LIBRARY_DEBUG}") ELSE(WIN32) FIND_LIBRARY(COIN3D_LIBRARY NAMES Coin PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{COIN3DDIR}/lib" "$ENV{COIN3D_DIR}/lib" /Library/Frameworks/Inventor.framework/Libraries ) #MESSAGE("DBG COIN3D_LIBRARY=${COIN3D_LIBRARY}") ENDIF(WIN32) MARK_AS_ADVANCED( COIN3D_INCLUDE_DIR COIN3D_LIBRARY_RELEASE COIN3D_LIBRARY_DEBUG COIN3D_LIBRARY ) ## -------------------------------- IF(COIN3D_LIBRARY OR COIN3D_LIBRARY_RELEASE OR COIN3D_LIBRARY_DEBUG AND COIN3D_INCLUDE_DIR) IF(WIN32) IF(COIN3D_LIBRARY_RELEASE) TRY_COMPILE_WITH_COIN(${COIN3D_LIBRARY_RELEASE} ${COIN3D_INCLUDE_DIR}) IF(NOT IS_COMPILER_COMPATIBLE) SET(COIN3D_LIBRARY_RELEASE FALSE) ENDIF(NOT IS_COMPILER_COMPATIBLE) ENDIF(COIN3D_LIBRARY_RELEASE) # Try to found COIN3D-2 IF(NOT COIN3D_LIBRARY_RELEASE) FIND_LIBRARY(COIN3D_LIBRARY_RELEASE NAMES coin2 #only shared libraries under windows PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{COIN3DDIR}/lib" "$ENV{COIN3D_DIR}/lib" ) TRY_COMPILE_WITH_COIN(${COIN3D_LIBRARY_RELEASE} ${COIN3D_INCLUDE_DIR}) IF(NOT IS_COMPILER_COMPATIBLE) SET(COIN3D_LIBRARY_RELEASE FALSE) ENDIF(NOT IS_COMPILER_COMPATIBLE) ENDIF(NOT COIN3D_LIBRARY_RELEASE) IF(COIN3D_LIBRARY_DEBUG) TRY_COMPILE_WITH_COIN(${COIN3D_LIBRARY_DEBUG} ${COIN3D_INCLUDE_DIR}) IF(NOT IS_COMPILER_COMPATIBLE) SET(COIN3D_LIBRARY_DEBUG FALSE) ENDIF(NOT IS_COMPILER_COMPATIBLE) ENDIF(COIN3D_LIBRARY_DEBUG) # Try to found COIN3D-2 IF(NOT COIN3D_LIBRARY_DEBUG) FIND_LIBRARY(COIN3D_LIBRARY_DEBUG NAMES coin2d #only shared libraries under windows PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{COIN3DDIR}/lib" "$ENV{COIN3D_DIR}/lib" ) TRY_COMPILE_WITH_COIN(${COIN3D_LIBRARY_DEBUG} ${COIN3D_INCLUDE_DIR}) IF(NOT IS_COMPILER_COMPATIBLE) SET(COIN3D_LIBRARY_DEBUG FALSE) ENDIF(NOT IS_COMPILER_COMPATIBLE) ENDIF(NOT COIN3D_LIBRARY_DEBUG) IF(NOT COIN3D_LIBRARY_RELEASE AND NOT COIN3D_LIBRARY_DEBUG) SET(COIN3D_FOUND FALSE) ENDIF(NOT COIN3D_LIBRARY_RELEASE AND NOT COIN3D_LIBRARY_DEBUG) ELSE(WIN32) TRY_COMPILE_WITH_COIN(${COIN3D_LIBRARY} ${COIN3D_INCLUDE_DIR}) IF(IS_COMPILER_COMPATIBLE) SET(COIN3D_LIBRARIES ${COIN3D_LIBRARY}) SET(COIN3D_FOUND TRUE) MARK_AS_ADVANCED( COIN3D_LIBRARIES COIN3D_LIBRARY ) ELSE(IS_COMPILER_COMPATIBLE) SET(COIN3D_FOUND FALSE) ENDIF(IS_COMPILER_COMPATIBLE) ENDIF(WIN32) SET(COIN3D_INCLUDE_DIRS ${COIN3D_INCLUDE_DIR}) SET(COIN3D_FOUND TRUE) ELSE(COIN3D_LIBRARY OR COIN3D_LIBRARY_RELEASE OR COIN3D_LIBRARY_DEBUG AND COIN3D_INCLUDE_DIR) SET(COIN3D_FOUND FALSE) #MESSAGE("Coin library not found.") ENDIF(COIN3D_LIBRARY OR COIN3D_LIBRARY_RELEASE OR COIN3D_LIBRARY_DEBUG AND COIN3D_INCLUDE_DIR) #MESSAGE(STATUS "COIN3D_FOUND : ${COIN3D_FOUND}") IF (COIN3D_FOUND) IF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE) SET(COIN3D_LIBRARIES optimized ${COIN3D_LIBRARY_RELEASE} debug ${COIN3D_LIBRARY_DEBUG}) ELSE (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE) IF (COIN3D_LIBRARY_DEBUG) SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_DEBUG}) ENDIF (COIN3D_LIBRARY_DEBUG) IF (COIN3D_LIBRARY_RELEASE) SET (COIN3D_LIBRARIES ${COIN3D_LIBRARY_RELEASE}) ENDIF (COIN3D_LIBRARY_RELEASE) ENDIF (COIN3D_LIBRARY_DEBUG AND COIN3D_LIBRARY_RELEASE) ENDIF(COIN3D_FOUND) ELSE(UNIX OR WIN32) SET(COIN3D_FOUND FALSE) ENDIF(UNIX OR WIN32) visp-3.0.0/cmake/FindMyGTK2.cmake000066400000000000000000000204041264126442000163740ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find GTK (and glib). # Once run this will define: # # GTK2_INCLUDE_DIRS - Directories to include to use GTK # GTK2_LIBRARIES - Files to link against to use GTK # GTK2_FOUND - If false, don't try to use GTK # GTK2_GL_FOUND - If false, don't try to use GTK's GL features # # Authors: # Fabien Spindler # ############################################################################# IF(UNIX OR WIN32) FIND_PATH( GTK2_gtk_INCLUDE_PATH gtk/gtk.h $ENV{GTK2_DIR}/include/gtk-2.0 $ENV{GTK2_HOME}/include/gtk-2.0 /usr/include/gtk-2.0 /usr/local/include/gtk-2.0 /opt/gnome/include/gtk-2.0 "C:/GTK/include/gtk-2.0" /sw/include/gtk-2.0 ) # Some Linux distributions (e.g. Red Hat) have glibconfig.h # and glib.h in different directories, so we need to look # for both. # - Atanas Georgiev FIND_PATH( GTK2_glibconfig_INCLUDE_PATH glibconfig.h $ENV{GTK2_DIR}/lib/glib-2.0/include $ENV{GTK2_HOME}/lib/glib-2.0/include /usr/lib/glib-2.0/include /usr/lib64/glib-2.0/include /usr/lib/i386-linux-gnu/glib-2.0/include /usr/lib/x86_64-linux-gnu/glib-2.0/include /opt/gnome/lib/glib-2.0/include C:/GTK/lib/glib-2.0/include /sw/lib/glib-2.0/include ) FIND_PATH( GTK2_glib_INCLUDE_PATH glib.h $ENV{GTK2_DIR}/include/glib-2.0 $ENV{GTK2_HOME}/include/glib-2.0 /usr/include/glib-2.0 /opt/gnome/include/glib-2.0 C:/GTK/include/glib-2.0 /sw/include/glib-2.0 ) FIND_PATH( GTK2_pango_INCLUDE_PATH pango/pango.h $ENV{GTK2_DIR}/include/pango-1.0 $ENV{GTK2_HOME}/include/pango-1.0 /usr/include/pango-1.0 /opt/gnome/include/pango-1.0 C:/GTK/include/pango-1.0 /sw/include/pango-1.0 ) FIND_PATH( GTK2_cairo_INCLUDE_PATH cairo.h $ENV{GTK2_DIR}/include/cairo $ENV{GTK2_HOME}/include/cairo /usr/include/cairo /opt/gnome/include/cairo C:/GTK/include/cairo /sw/include/cairo ) FIND_PATH( GTK2_gdkconfig_INCLUDE_PATH gdkconfig.h $ENV{GTK2_DIR}/lib/gtk-2.0/include $ENV{GTK2_HOME}/lib/gtk-2.0/include /usr/lib/gtk-2.0/include /usr/lib64/gtk-2.0/include /opt/gnome/lib/gtk-2.0/include C:/GTK/lib/gtk-2.0/include /sw/lib/gtk-2.0/include /usr/lib/i386-linux-gnu/gtk-2.0/include /usr/lib/x86_64-linux-gnu/gtk-2.0/include ) FIND_PATH( GTK2_gdkpixbuf_INCLUDE_PATH gdk-pixbuf/gdk-pixbuf.h $ENV{GTK2_DIR}/gdk-pixbuf-2.0 $ENV{GTK2_HOME}/gdk-pixbuf-2.0 /usr/include/gdk-pixbuf-2.0 /usr/include/gtk-2.0 C:/GTK/include/gtk-2.0 /sw/include/gtk-2.0 ) #MESSAGE("GTK2_gdkpixbuf_INCLUDE_PATH: ${GTK2_gdkpixbuf_INCLUDE_PATH}") FIND_PATH( GTK2_atk_INCLUDE_PATH atk/atk.h $ENV{GTK2_DIR}/include/atk-1.0 $ENV{GTK2_HOME}/include/atk-1.0 /usr/include/atk-1.0 /opt/gnome/include/atk-1.0 C:/GTK/include/atk-1.0 /sw/include/atk-1.0 ) FIND_LIBRARY( GTK2_gtk_LIBRARY NAMES gtk-x11-2.0 gtk-win32-2.0 PATHS $ENV{GTK2_DIR}/lib PATHS $ENV{GTK2_HOME}/lib /usr/lib /usr/local/lib /usr/openwin/lib /usr/X11R6/lib /opt/gnome/lib C:/GTK/lib /sw/lib ) FIND_LIBRARY( GTK2_gdk_LIBRARY NAMES gdk-x11-2.0 gdk-win32-2.0 PATHS $ENV{GTK2_DIR}/lib PATHS $ENV{GTK2_HOME}/lib /usr/lib /usr/local/lib /usr/openwin/lib /usr/X11R6/lib /opt/gnome/lib C:/GTK/lib /sw/lib ) FIND_LIBRARY( GTK2_gmodule_LIBRARY NAMES gmodule-2.0 PATHS $ENV{GTK2_DIR}/lib PATHS $ENV{GTK2_HOME}/lib /usr/lib /usr/local/lib /usr/openwin/lib /usr/X11R6/lib /opt/gnome/lib C:/GTK/lib /sw/lib ) FIND_LIBRARY( GTK2_glib_LIBRARY NAMES glib-2.0 PATHS $ENV{GTK2_DIR}/lib PATHS $ENV{GTK2_HOME}/lib /usr/lib /usr/local/lib /usr/openwin/lib /usr/X11R6/lib /opt/gnome/lib C:/GTK/lib /sw/lib ) FIND_LIBRARY( GTK2_gthread_LIBRARY NAMES gthread-2.0 PATHS $ENV{GTK2_DIR}/lib PATHS $ENV{GTK2_HOME}/lib /usr/lib /usr/local/lib /usr/openwin/lib /usr/X11R6/lib /opt/gnome/lib C:/GTK/lib /sw/lib ) FIND_LIBRARY( GTK2_gobject_LIBRARY NAMES gobject-2.0 PATHS $ENV{GTK2_DIR}/lib PATHS $ENV{GTK2_HOME}/lib /usr/lib /opt/gnome/lib C:/GTK/lib /sw/lib ) IF(GTK2_gtk_INCLUDE_PATH) IF(GTK2_glib_INCLUDE_PATH) IF(GTK2_glibconfig_INCLUDE_PATH) IF(GTK2_gtk_LIBRARY) IF(GTK2_glib_LIBRARY) IF(GTK2_pango_INCLUDE_PATH) IF(GTK2_gdkconfig_INCLUDE_PATH) IF(GTK2_atk_INCLUDE_PATH) # Assume that if gtk and glib were found, the other # supporting libraries have also been found. SET( GTK2_FOUND "YES" ) SET( GTK2_INCLUDE_DIRS ${GTK2_gtk_INCLUDE_PATH} ${GTK2_glib_INCLUDE_PATH} ${GTK2_glibconfig_INCLUDE_PATH} ${GTK2_pango_INCLUDE_PATH} ${GTK2_atk_INCLUDE_PATH} ${GTK2_gdkconfig_INCLUDE_PATH}) IF(GTK2_cairo_INCLUDE_PATH) LIST(APPEND GTK2_INCLUDE_DIRS ${GTK2_cairo_INCLUDE_PATH} ) ENDIF(GTK2_cairo_INCLUDE_PATH) IF(GTK2_gdkpixbuf_INCLUDE_PATH) LIST(APPEND GTK2_INCLUDE_DIRS ${GTK2_gdkpixbuf_INCLUDE_PATH} ) ENDIF() IF(GTK2_gdkconfig_INCLUDE_PATH) LIST(APPEND GTK2_INCLUDE_DIRS ${GTK2_gdkconfig_INCLUDE_PATH} ) ENDIF(GTK2_gdkconfig_INCLUDE_PATH) SET( GTK2_LIBRARIES ${GTK2_gtk_LIBRARY} ${GTK2_gdk_LIBRARY} ${GTK2_glib_LIBRARY} ${GTK2_gobject_LIBRARY}) IF(GTK2_gmodule_LIBRARY) LIST(APPEND GTK2_LIBRARIES ${GTK2_gmodule_LIBRARY}) ENDIF(GTK2_gmodule_LIBRARY) IF(GTK2_gthread_LIBRARY) LIST(APPEND GTK2_LIBRARIES ${GTK2_gthread_LIBRARY}) ENDIF(GTK2_gthread_LIBRARY) ELSE(GTK2_atk_INCLUDE_PATH) MESSAGE("Can not find atk") ENDIF(GTK2_atk_INCLUDE_PATH) ELSE(GTK2_gdkconfig_INCLUDE_PATH) #MESSAGE("Can not find gdkconfig include") ENDIF(GTK2_gdkconfig_INCLUDE_PATH) ELSE(GTK2_pango_INCLUDE_PATH) #MESSAGE("Can not find pango includes") ENDIF(GTK2_pango_INCLUDE_PATH) ELSE(GTK2_glib_LIBRARY) #MESSAGE("Can not find glib lib") ENDIF(GTK2_glib_LIBRARY) ELSE(GTK2_gtk_LIBRARY) #MESSAGE("Can not find gtk lib") ENDIF(GTK2_gtk_LIBRARY) ELSE(GTK2_glibconfig_INCLUDE_PATH) #MESSAGE("Can not find glibconfig includes") ENDIF(GTK2_glibconfig_INCLUDE_PATH) ELSE(GTK2_glib_INCLUDE_PATH) #MESSAGE("Can not find glib includes") ENDIF(GTK2_glib_INCLUDE_PATH) ELSE(GTK2_gtk_INCLUDE_PATH) #MESSAGE("Can not find gtk includes") ENDIF(GTK2_gtk_INCLUDE_PATH) MARK_AS_ADVANCED( GTK2_gdk_LIBRARY GTK2_glib_INCLUDE_PATH GTK2_glib_LIBRARY GTK2_glibconfig_INCLUDE_PATH GTK2_gmodule_LIBRARY GTK2_gthread_LIBRARY GTK2_gtk_INCLUDE_PATH GTK2_gtk_LIBRARY GTK2_atk_INCLUDE_PATH GTK2_gdkconfig_INCLUDE_PATH GTK2_gobject_LIBRARY GTK2_pango_INCLUDE_PATH GTK2_cairo_INCLUDE_PATH GTK2_gdkpixbuf_INCLUDE_PATH ) ELSE(UNIX OR WIN32) MESSAGE("FindGTK2 is working on UNIX/LINUX and Windows, only!") ENDIF(UNIX OR WIN32) visp-3.0.0/cmake/FindMyJPEG.cmake000066400000000000000000000065171264126442000164230ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libjpeg library. # Once run this will define: # # JPEG_FOUND # JPEG_INCLUDE_DIRS # JPEG_LIBRARIES # # Authors: # Nicolas Melchior # ############################################################################# # detection of the Libjpeg headers location if(MINGW) find_path(JPEG_INCLUDE_DIR NAMES jpeglib.h PATHS "$ENV{MINGW_DIR}/include" C:/mingw/include ) # Detection of the Libjpeg library on Unix find_library(JPEG_LIBRARY NAMES jpeg libjpeg PATHS "$ENV{MINGW_DIR}/lib" "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) else() find_path(JPEG_INCLUDE_DIR NAMES jpeglib.h PATHS "/usr/include" "/usr/local/include" $ENV{LIBJPEG_DIR}/include $ENV{LIBJPEG_DIR} "C:/Program Files/GnuWin32/include" ) # Detection of the Libjpeg library on Unix find_library(JPEG_LIBRARY NAMES jpeg libjpeg PATHS /usr/lib /usr/local/lib /lib $ENV{LIBJPEG_DIR}/lib $ENV{LIBJPEG_DIR}/Release $ENV{LIBJPEG_DIR} "C:/Program Files/GnuWin32/lib" ) endif() #MESSAGE("JPEG_INCLUDE_DIR=${JPEG_INCLUDE_DIR}") #MESSAGE("JPEG_LIBRARY=${JPEG_LIBRARY}") MARK_AS_ADVANCED( JPEG_LIBRARY JPEG_INCLUDE_DIR ) ## -------------------------------- IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) SET(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES(" #include #include // Contrib for jpeg image io #include int main() { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; cinfo.err = jpeg_std_error(&jerr); } " JPEG_BUILD_TEST) #MESSAGE("JPEG_BUILD_TEST: ${JPEG_BUILD_TEST}") IF(JPEG_BUILD_TEST) SET(JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR}) SET(JPEG_LIBRARIES ${JPEG_LIBRARY}) SET(JPEG_FOUND TRUE) ELSE() SET(JPEG_FOUND FALSE) #MESSAGE("libjpeg library found but not compatible with architecture.") ENDIF() ELSE(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) SET(JPEG_FOUND FALSE) ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR) visp-3.0.0/cmake/FindMyPNG.cmake000066400000000000000000000116531264126442000163170ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libpng library. # To use the libpng library, the zlib library is required. # Once run this will define: # # PNG_FOUND # PNG_INCLUDE_DIR # PNG_LIBRARIES # # Authors: # Nicolas Melchior # ############################################################################# # detection of the Libpng headers location if(MINGW) find_path(PNG_INCLUDE_DIR NAMES png.h PATHS "C:/mingw/include/libpng14" "$ENV{MINGW_DIR}/include/libpng14" ) else() find_path(PNG_INCLUDE_DIR NAMES png.h PATHS "$ENV{LIBPNG_DIR}/include" "$ENV{LIBPNG_DIR}" "$ENV{LIBPNG_INCLUDE_DIR}" "/usr/include" "/usr/local/include" "C:/Program Files/libpng/include" ) endif() #MESSAGE("PNG_INCLUDE_DIR=${PNG_INCLUDE_DIR}") if(UNIX) # Detection of the Libpng library on Unix find_library(PNG_LIBRARY NAMES png15 libpng15 libpng14 png12 libpng12 png libpng PATHS "$ENV{LIBPNG_DIR}/lib" "$ENV{LIBPNG_DIR}/Release" "$ENV{LIBPNG_DIR}" "$ENV{LIBPNG_LIBRARY_DIR}" /usr/lib /usr/local/lib /lib "C:/Program Files/libpng/lib" ) elseif(MINGW) # Detection of the Libpng library on mingw find_library(PNG_LIBRARY NAMES png15 libpng15 libpng14 png12 libpng12 png libpng PATHS "C:/mingw/lib64" "$ENV{MINGW_DIR}/lib64" ) #MESSAGE("PNG_LIBRARY=${PNG_LIBRARY}") else() FIND_LIBRARY(PNG_LIBRARY_RELEASE NAMES png15 libpng15 png12 libpng12 png libpng PATHS $ENV{LIBPNG_DIR}/lib $ENV{LIBPNG_DIR}/Release $ENV{LIBPNG_DIR} $ENV{LIBPNG_LIBRARY_RELEASE_DIR} /usr/lib /usr/local/lib /lib "C:/Program Files/libpng/lib" ) FIND_LIBRARY(PNG_LIBRARY_DEBUG NAMES png15d libpng15d png12d libpng12d pngd libpngd PATHS $ENV{LIBPNG_DIR}/lib $ENV{LIBPNG_DIR}/Debug $ENV{LIBPNG_DIR} $ENV{LIBPNG_LIBRARY_DEBUG_DIR} /usr/lib /usr/local/lib /lib "C:/Program Files/libpng/lib" ) #MESSAGE("PNG_LIBRARY_RELEASE=${PNG_LIBRARY_RELEASE}") #MESSAGE("PNG_LIBRARY_DEBUG=${PNG_LIBRARY_DEBUG}") ENDIF(UNIX) ## -------------------------------- SET(PNG_FOUND FALSE) FIND_PACKAGE(ZLIB) if(NOT ZLIB_FOUND) FIND_PACKAGE(MyZLIB) endif() IF(UNIX) IF(PNG_LIBRARY AND PNG_INCLUDE_DIR) SET(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIR}) SET(PNG_LIBRARIES ${PNG_LIBRARY}) SET(PNG_FOUND TRUE) ENDIF() ELSE(UNIX) SET(PNG_LIBRARIES "") IF(PNG_LIBRARY_RELEASE AND PNG_INCLUDE_DIR) SET(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIR}) LIST(APPEND PNG_LIBRARIES optimized ${PNG_LIBRARY_RELEASE}) SET(PNG_FOUND TRUE) ENDIF() IF(PNG_LIBRARY_DEBUG AND PNG_INCLUDE_DIR) SET(PNG_INCLUDE_DIRS ${PNG_INCLUDE_DIR}) LIST(APPEND PNG_LIBRARIES debug ${PNG_LIBRARY_DEBUG}) SET(PNG_FOUND TRUE) ENDIF() ENDIF(UNIX) IF(ZLIB_FOUND) IF(PNG_FOUND) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) #MESSAGE(PNG_LIBRARIES: ${PNG_LIBRARIES}) #MESSAGE(ZLIB_LIBRARIES: ${ZLIB_LIBRARIES}) SET(CMAKE_REQUIRED_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) SET(CMAKE_REQUIRED_INCLUDES ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}) CHECK_CXX_SOURCE_COMPILES(" #include // Contrib for png image io int main() { /* create a png read struct */ png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); } " PNG_BUILD_TEST) #MESSAGE("PNG_BUILD_TEST: ${PNG_BUILD_TEST}") IF(PNG_BUILD_TEST) SET(PNG_FOUND TRUE) ELSE() SET(PNG_FOUND FALSE) MESSAGE("libpng library found but not compatible with architecture.") ENDIF() ELSEIF(PNG_FOUND) MESSAGE("To use libpng library, you should also install zlib library") ENDIF() ENDIF() MARK_AS_ADVANCED( PNG_LIBRARY PNG_LIBRARY_DEBUG PNG_LIBRARY_RELEASE PNG_INCLUDE_DIR ) visp-3.0.0/cmake/FindMyZLIB.cmake000066400000000000000000000063411264126442000164310ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find zlib library. # This file should be used only if FindZLIB.cmake provided with CMake # is not able to detect zlib. # The detection can be eased by setting ZLIB_HOME environment variable # especially under windows. # # ZLIB_FOUND # ZLIB_INCLUDE_DIRS # ZLIB_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# if(MINGW) find_path(ZLIB_INCLUDE_DIR zlib.h "$ENV{MINGW_DIR}/include" C:/mingw/include ) else() find_path(ZLIB_INCLUDE_DIR zlib.h $ENV{ZLIB_DIR}/include $ENV{ZLIB_INCLUDE_DIR} /usr/include /usr/local/include "C:/Program Files/zlib/include" ) endif() if(UNIX) find_library(ZLIB_LIBRARY z zlib $ENV{ZLIB_DIR}/lib $ENV{ZLIB_LIBRARY_DIR} /lib /usr/lib /usr/local/lib "C:/Program Files/zlib/lib" ) elseif(MINGW) find_library(ZLIB_LIBRARY z zlib "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) else() find_library(ZLIB_LIBRARY_RELEASE z zlib $ENV{ZLIB_DIR}/lib $ENV{ZLIB_LIBRARY_RELEASE_DIR} /lib /usr/lib /usr/local/lib "C:/Program Files/zlib/lib" "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) FIND_LIBRARY(ZLIB_LIBRARY_DEBUG zlibd $ENV{ZLIB_DIR}/lib $ENV{ZLIB_LIBRARY_DEBUG_DIR} /lib /usr/lib /usr/local/lib "C:/Program Files/zlib/lib" ) endif() if(UNIX OR MINGW) if(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) set(ZLIB_FOUND TRUE) else() set(ZLIB_FOUND FALSE) endif() else() set(ZLIB_LIBRARIES "") if(ZLIB_LIBRARY_RELEASE AND ZLIB_INCLUDE_DIR) set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) list(APPEND ZLIB_LIBRARIES optimized) list(APPEND ZLIB_LIBRARIES ${ZLIB_LIBRARY_RELEASE}) set(ZLIB_FOUND TRUE) endif() if(ZLIB_LIBRARY_DEBUG AND ZLIB_INCLUDE_DIR) set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) list(APPEND ZLIB_LIBRARIES debug) list(APPEND ZLIB_LIBRARIES ${ZLIB_LIBRARY_DEBUG}) set(ZLIB_FOUND TRUE) endif() endif() mark_as_advanced( ZLIB_INCLUDE_DIR ZLIB_LIBRARY ZLIB_LIBRARY_RELEASE ZLIB_LIBRARY_DEBUG ) visp-3.0.0/cmake/FindNAS.cmake000066400000000000000000000033521264126442000160030ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to determine if Inria's NAS server hosting /udd/ is available # # NAS_FOUND # # Authors: # Fabien Spindler # ############################################################################# FIND_FILE(AFMA6_CONSTANT_FILE_ON_NAS NAMES const_Afma6.cnf PATHS /udd/fspindle/robot/Afma6/current/include Z:/robot/Afma6/current/include ) #MESSAGE("DBG AFMA6_CONSTANT_FILE_ON_NAS=${AFMA6_CONSTANT_FILE_ON_NAS}") ## -------------------------------- IF(AFMA6_CONSTANT_FILE_ON_NAS) SET(NAS_FOUND TRUE) ELSE(AFMA6_CONSTANT_FILE_ON_NAS) SET(NAS_FOUND FALSE) ENDIF(AFMA6_CONSTANT_FILE_ON_NAS) MARK_AS_ADVANCED( AFMA6_CONSTANT_FILE_ON_NAS ) visp-3.0.0/cmake/FindOpenCV2.cmake000066400000000000000000000200341264126442000165720ustar00rootroot00000000000000# - Try to find OpenCV library installation # See http://sourceforge.net/projects/opencvlibrary/ # # The following variables are optionally searched for defaults # OpenCV_ROOT_DIR: Base directory of OpenCv tree to use. # OpenCV_FIND_REQUIRED_COMPONENTS : FIND_PACKAGE(OpenCV COMPONENTS ..) # compatible interface. typically CV CXCORE CVAUX HIGHGUI CVCAM .. etc. # # The following are set after configuration is done: # OpenCV_FOUND # OpenCV_INCLUDE_DIRS # OpenCV_LIBS # OpenCV_LIB_DIR # OpenCV_VERSION_MAJOR # OpenCV_VERSION_MINOR # OpenCV_VERSION_PATCH # # deprecated: # OPENCV_* uppercase replaced by case sensitive OpenCV_* # OPENCV_EXE_LINKER_FLAGS # OPENCV_INCLUDE_DIR : replaced by plural *_DIRS # # 2004/05 Jan Woetzel, Friso, Daniel Grest # 2006/01 complete rewrite by Jan Woetzel # 2006/09 2nd rewrite introducing ROOT_DIR and PATH_SUFFIXES # to handle multiple installed versions gracefully by Jan Woetzel # 2009/04 Fabien Spindler, specific detection of cvcam under Windows # # tested with: # -OpenCV 0.97 (beta5a): MSVS 7.1, gcc 3.3, gcc 4.1 # -OpenCV 0.99 (1.0rc1): MSVS 7.1 # -OpenCV 1.0 # -OpenCV 1.1 # # www.mip.informatik.uni-kiel.de/~jw # -------------------------------- MACRO(DBG_MSG _MSG) #MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}):\n${_MSG}") ENDMACRO(DBG_MSG) # required cv components with header and library if COMPONENTS unspecified IF (NOT OpenCV_FIND_COMPONENTS) # default SET(OpenCV_FIND_REQUIRED_COMPONENTS CV CXCORE CVAUX HIGHGUI ) # IF (WIN32) # LIST(APPEND OpenCV_FIND_REQUIRED_COMPONENTS CVCAM ) # WIN32 only actually # ENDIF(WIN32) ENDIF (NOT OpenCV_FIND_COMPONENTS) # typical root dirs of installations, exactly one of them is used SET (OpenCV_POSSIBLE_ROOT_DIRS "${OpenCV_ROOT_DIR}" "$ENV{OpenCV_ROOT_DIR}" "$ENV{OPENCV_DIR}" # only for backward compatibility deprecated by ROOT_DIR "$ENV{OPENCV_HOME}" # only for backward compatibility "$ENV{ProgramFiles}/OpenCV" /usr/local /usr ) # # select exactly ONE OpenCV base directory/tree # to avoid mixing different version headers and libs # FIND_PATH(OpenCV_ROOT_DIR NAMES cv/include/cv.h # windows include/opencv/cv.h # linux /opt/net include/cv/cv.h include/cv.h PATHS ${OpenCV_POSSIBLE_ROOT_DIRS}) DBG_MSG("OpenCV_ROOT_DIR=${OpenCV_ROOT_DIR}") # header include dir suffixes appended to OpenCV_ROOT_DIR SET(OpenCV_INCDIR_SUFFIXES include include/cv include/opencv cv/include cxcore/include cvaux/include otherlibs/cvcam/include otherlibs/highgui otherlibs/highgui/include otherlibs/_graphics/include ) # library linkdir suffixes appended to OpenCV_ROOT_DIR SET(OpenCV_LIBDIR_SUFFIXES lib OpenCV/lib otherlibs/_graphics/lib ) #DBG_MSG("OpenCV_LIBDIR_SUFFIXES=${OpenCV_LIBDIR_SUFFIXES}") # # find incdir for each lib # FIND_PATH(OpenCV_CV_INCLUDE_DIR NAMES cv.h PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} ) FIND_PATH(OpenCV_CXCORE_INCLUDE_DIR NAMES cxcore.h PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} ) FIND_PATH(OpenCV_CVAUX_INCLUDE_DIR NAMES cvaux.h PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} ) FIND_PATH(OpenCV_HIGHGUI_INCLUDE_DIR NAMES highgui.h PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} ) FIND_PATH(OpenCV_CVCAM_INCLUDE_DIR NAMES cvcam.h PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_INCDIR_SUFFIXES} ) # # find sbsolute path to all libraries # some are optionally, some may not exist on Linux # FIND_LIBRARY(OpenCV_CV_LIBRARY NAMES cv opencv PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_CVAUX_LIBRARY NAMES cvaux PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_CVCAM_LIBRARY NAMES cvcam PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_CVHAARTRAINING_LIBRARY NAMES cvhaartraining PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_CXCORE_LIBRARY NAMES cxcore PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_CXTS_LIBRARY NAMES cxts PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_HIGHGUI_LIBRARY NAMES highgui PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_ML_LIBRARY NAMES ml PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) FIND_LIBRARY(OpenCV_TRS_LIBRARY NAMES trs PATHS ${OpenCV_ROOT_DIR} PATH_SUFFIXES ${OpenCV_LIBDIR_SUFFIXES} ) # # Logic selecting required libs and headers # SET(OpenCV_FOUND ON) DBG_MSG("OpenCV_FIND_REQUIRED_COMPONENTS=${OpenCV_FIND_REQUIRED_COMPONENTS}") FOREACH(NAME ${OpenCV_FIND_REQUIRED_COMPONENTS} ) # only good if header and library both found IF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY) LIST(APPEND OpenCV_INCLUDE_DIRS ${OpenCV_${NAME}_INCLUDE_DIR} ) LIST(APPEND OpenCV_LIBS ${OpenCV_${NAME}_LIBRARY} ) #DBG_MSG("appending for NAME=${NAME} ${OpenCV_${NAME}_INCLUDE_DIR} and ${OpenCV_${NAME}_LIBRARY}" ) ELSE (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY) DBG_MSG("OpenCV component NAME=${NAME} not found! " "\nOpenCV_${NAME}_INCLUDE_DIR=${OpenCV_${NAME}_INCLUDE_DIR} " "\nOpenCV_${NAME}_LIBRARY=${OpenCV_${NAME}_LIBRARY} ") SET(OpenCV_FOUND OFF) ENDIF (OpenCV_${NAME}_INCLUDE_DIR AND OpenCV_${NAME}_LIBRARY) ENDFOREACH(NAME) DBG_MSG("OpenCV_INCLUDE_DIRS=${OpenCV_INCLUDE_DIRS}") DBG_MSG("OpenCV_LIBS=${OpenCV_LIBS}") # get the link directory for rpath to be used with LINK_DIRECTORIES: IF (OpenCV_CV_LIBRARY) GET_FILENAME_COMPONENT(OpenCV_LIB_DIR ${OpenCV_CV_LIBRARY} PATH) ENDIF (OpenCV_CV_LIBRARY) # Now we try to get the OpenCV version if not set previously if(NOT OpenCV_VERSION_MAJOR AND NOT OpenCV_VERSION_MINOR AND NOT OpenCV_VERSION_PATCH) # default init if not found SET(OpenCV_VERSION_MAJOR "1") SET(OpenCV_VERSION_MINOR "0") SET(OpenCV_VERSION_PATCH "0") # Under UNIX try to use "pkg-config --modversion opencv --silence-errors" # to get OpenCV version FIND_PROGRAM(PKG_CONFIG_CMD pkg-config) MARK_AS_ADVANCED(PKG_CONFIG_CMD) #message("PKG_CONFIG_CMD ${PKG_CONFIG_CMD}") IF(NOT PKG_CONFIG_CMD) MESSAGE(STATUS "Can not find pkg-config in your path") ELSE() EXECUTE_PROCESS(COMMAND "${PKG_CONFIG_CMD}" --modversion opencv --silence-errors OUTPUT_VARIABLE PKG_OPENCV_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) ENDIF() if(PKG_OPENCV_VERSION) #message("PKG_OPENCV_VERSION ${PKG_OPENCV_VERSION}") string(SUBSTRING ${PKG_OPENCV_VERSION} 0 1 OpenCV_VERSION_MAJOR) string(SUBSTRING ${PKG_OPENCV_VERSION} 2 1 OpenCV_VERSION_MINOR) string(SUBSTRING ${PKG_OPENCV_VERSION} 4 1 OpenCV_VERSION_PATCH) #message("OpenCV_VERSION_MAJOR ${OpenCV_VERSION_MAJOR}") #message("OpenCV_VERSION_MINOR ${OpenCV_VERSION_MINOR}") #message("OpenCV_VERSION_PATCH ${OpenCV_VERSION_PATCH}") endif() endif() MARK_AS_ADVANCED( OpenCV_ROOT_DIR OpenCV_INCLUDE_DIRS OpenCV_CV_INCLUDE_DIR OpenCV_CXCORE_INCLUDE_DIR OpenCV_CVAUX_INCLUDE_DIR OpenCV_CVCAM_INCLUDE_DIR OpenCV_HIGHGUI_INCLUDE_DIR OpenCV_LIBRARIES OpenCV_LIBS OpenCV_CV_LIBRARY OpenCV_CXCORE_LIBRARY OpenCV_CVAUX_LIBRARY OpenCV_CVCAM_LIBRARY OpenCV_CVHAARTRAINING_LIBRARY OpenCV_CXTS_LIBRARY OpenCV_HIGHGUI_LIBRARY OpenCV_ML_LIBRARY OpenCV_TRS_LIBRARY ) # be backward compatible: SET(OPENCV_LIBRARIES ${OpenCV_LIBS} ) SET(OPENCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS} ) SET(OPENCV_FOUND ${OpenCV_FOUND}) # display help message IF(NOT OpenCV_FOUND) # make FIND_PACKAGE friendly IF(NOT OpenCV_FIND_QUIETLY) IF(OpenCV_FIND_REQUIRED) MESSAGE(FATAL_ERROR "OpenCV required but some headers or libs not found. Please specify it's location with OpenCV_ROOT_DIR env. variable.") ELSE(OpenCV_FIND_REQUIRED) MESSAGE(STATUS "OpenCV not found.") ENDIF(OpenCV_FIND_REQUIRED) ENDIF(NOT OpenCV_FIND_QUIETLY) ENDIF(NOT OpenCV_FOUND) visp-3.0.0/cmake/FindPARPORT.cmake000066400000000000000000000030641264126442000165110ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find linux/parport.h.h for parallel port usage. # Once run this will define: # # PARPORT_FOUND # PARPORT_INCLUDE_DIRS # # Authors: # Fabien Spindler # ############################################################################# find_path(PARPORT_INCLUDE_DIRS linux/parport.h /usr/include /usr/src/linux/include ) mark_as_advanced( PARPORT_INCLUDE_DIRS ) if(PARPORT_INCLUDE_DIRS) set(PARPORT_FOUND TRUE) else() set(PARPORT_FOUND FALSE) endif() visp-3.0.0/cmake/FindPTHREAD.cmake000066400000000000000000000060161264126442000164510ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find pthread library. # Once run this will define: # # PTHREAD_FOUND # PTHREAD_INCLUDE_DIRS # PTHREAD_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# if(MINGW) find_path(PTHREAD_INCLUDE_DIR pthread.h "$ENV{MINGW_DIR}/include" "$ENV{MINGW_DIR}/mingw/include" C:/mingw/mingw/include ) # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web find_library(PTHREAD_LIBRARY NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 PATHS "$ENV{MINGW_DIR}/lib" "$ENV{MINGW_DIR}/mingw/lib" C:/mingw/mingw/lib ) else() find_path(PTHREAD_INCLUDE_DIR pthread.h "$ENV{PTHREAD_HOME}/include" "$ENV{PTHREAD_DIR}/include" /usr/include ) # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web find_library(PTHREAD_LIBRARY NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 PATHS "$ENV{PTHREAD_HOME}/lib" "$ENV{PTHREAD_DIR}/lib" /usr/lib /usr/local/lib /lib ) endif() #MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}") #MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}") ## -------------------------------- IF(PTHREAD_LIBRARY) SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) ELSE(PTHREAD_LIBRARY) #MESSAGE(SEND_ERROR "pthread library not found.") ENDIF(PTHREAD_LIBRARY) IF(NOT PTHREAD_INCLUDE_DIR) #MESSAGE(SEND_ERROR "pthread include dir not found.") ENDIF(NOT PTHREAD_INCLUDE_DIR) IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) SET(PTHREAD_FOUND TRUE) ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) SET(PTHREAD_FOUND FALSE) ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) MARK_AS_ADVANCED( PTHREAD_INCLUDE_DIR PTHREAD_LIBRARY ) #MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}") visp-3.0.0/cmake/FindPTU46.cmake000066400000000000000000000073111264126442000162030ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libraries for Irisa's Ptu-46 pan-tilt head. # Once run this will define: # # PTU46_FOUND # PTU46_INCLUDE_DIRS # PTU46_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindPTU46.cmake: Ptu-46 only available for Unix.") SET(PTU46_FOUND FALSE) ELSE(NOT UNIX) FIND_PATH(PTU46_INCLUDE_DIR ptu.h $ENV{PTU46_HOME}/include /udd/fspindle/robot/Ptu-Evi/current/include /local/soft/Ptu-Evi/current/include ) #MESSAGE("DBG PTU46_INCLUDE_DIR=${PTU46_INCLUDE_DIR}") FIND_LIBRARY(PTUPTU46_LIBRARY NAMES ptu PATHS $ENV{PTU46_HOME}/lib /udd/fspindle/robot/Ptu-Evi/current/lib /local/soft/Ptu-Evi/current/lib ) FIND_LIBRARY(EVIPTU46_LIBRARY NAMES evi PATHS $ENV{PTU46_HOME}/lib /udd/fspindle/robot/Ptu-Evi/current/lib /local/soft/Ptu-Evi/current/lib ) FIND_LIBRARY(SERIALPTU46_LIBRARY NAMES serial PATHS $ENV{PTU46_HOME}/lib /udd/fspindle/robot/Ptu-Evi/current/lib /local/soft/Ptu-Evi/current/lib ) #MESSAGE("DBG PTU46_LIBRARY=${PTU46_LIBRARY}") ## -------------------------------- IF(PTUPTU46_LIBRARY AND EVIPTU46_LIBRARY AND SERIALPTU46_LIBRARY) # The material is found. Check if it works on the requested architecture include(CheckCXXSourceCompiles) SET(CMAKE_REQUIRED_LIBRARIES ${PTUPTU46_LIBRARY} ${SERIALPTU46_LIBRARY}) SET(CMAKE_REQUIRED_INCLUDES ${PTU46_INCLUDE_DIR}) CHECK_CXX_SOURCE_COMPILES(" #include // Contrib for Ptu-46 robot int main() { Ptu ptu; return 0; } " PTU46_BUILD_TEST) #MESSAGE("PTU46_BUILD_TEST: ${PTU46_BUILD_TEST}") IF(PTU46_BUILD_TEST) SET(PTU46_LIBRARIES ${PTUPTU46_LIBRARY} ${EVIPTU46_LIBRARY} ${SERIALPTU46_LIBRARY}) # ELSE() # MESSAGE("Ptu-46 library found but not compatible with architecture.") ENDIF() ELSE(PTUPTU46_LIBRARY AND EVIPTU46_LIBRARY AND SERIALPTU46_LIBRARY) # MESSAGE(SEND_ERROR "Ptu-46 library not found.") ENDIF(PTUPTU46_LIBRARY AND EVIPTU46_LIBRARY AND SERIALPTU46_LIBRARY) IF(NOT PTU46_INCLUDE_DIR) # MESSAGE(SEND_ERROR "Ptu-46 include dir not found.") ENDIF(NOT PTU46_INCLUDE_DIR) IF(PTU46_LIBRARIES AND PTU46_INCLUDE_DIR) SET(PTU46_INCLUDE_DIRS ${PTU46_INCLUDE_DIR}) SET(PTU46_FOUND TRUE) ELSE(PTU46_LIBRARIES AND PTU46_INCLUDE_DIR) SET(PTU46_FOUND FALSE) ENDIF(PTU46_LIBRARIES AND PTU46_INCLUDE_DIR) MARK_AS_ADVANCED( PTU46_INCLUDE_DIR PTU46_LIBRARIES PTUPTU46_LIBRARY EVIPTU46_LIBRARY SERIALPTU46_LIBRARY ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindRAW1394.cmake000066400000000000000000000047341264126442000163410ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find libraw1394 for IEEE1394 camera under Linux. # Once run this will define: # # RAW1394_FOUND # RAW1394_INCLUDE_DIRS # RAW1394_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindRAW1394.cmake: libraw1394 only available for Unix.") SET(RAW1394_FOUND FALSE) ELSE(NOT UNIX) FIND_PATH(RAW1394_INCLUDE_DIR libraw1394/raw1394.h $ENV{RAW1394_HOME}/include /usr/include ) #MESSAGE("DBG RAW1394_INCLUDE_DIR=${RAW1394_INCLUDE_DIR}") FIND_LIBRARY(RAW1394_LIBRARY NAMES raw1394 PATHS $ENV{RAW1394_HOME}/lib /usr/lib ) #MESSAGE("DBG RAW1394_LIBRARY=${RAW1394_LIBRARY}") ## -------------------------------- IF(RAW1394_LIBRARY) SET(RAW1394_LIBRARIES ${RAW1394_LIBRARY}) ELSE(RAW1394_LIBRARY) #MESSAGE("libraw1394 library not found.") ENDIF(RAW1394_LIBRARY) IF(NOT RAW1394_INCLUDE_DIR) #MESSAGE("libraw1394 include dir not found.") ENDIF(NOT RAW1394_INCLUDE_DIR) IF(RAW1394_LIBRARIES AND RAW1394_INCLUDE_DIR) SET(RAW1394_INCLUDE_DIRS ${RAW1394_INCLUDE_DIR}) SET(RAW1394_FOUND TRUE) ELSE(RAW1394_LIBRARIES AND RAW1394_INCLUDE_DIR) SET(RAW1394_FOUND FALSE) ENDIF(RAW1394_LIBRARIES AND RAW1394_INCLUDE_DIR) MARK_AS_ADVANCED( RAW1394_INCLUDE_DIR RAW1394_LIBRARIES RAW1394_LIBRARY ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindRT.cmake000066400000000000000000000035021264126442000157040ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find RT library material # # RT_FOUND # RT_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindRT.cmake: only available for Unix.") SET(RT_FOUND FALSE) ELSE(NOT UNIX) FIND_LIBRARY(RT_LIBRARY NAMES rt PATHS $ENV{RT_HOME}/lib /usr/lib /usr/local/lib ) #MESSAGE("DBG RT_LIBRARY=${RT_LIBRARY}") ## -------------------------------- IF(RT_LIBRARY) SET(RT_LIBRARIES ${RT_LIBRARY}) SET(RT_FOUND TRUE) ELSE(RT_LIBRARY) SET(RT_FOUND FALSE) #MESSAGE(SEND_ERROR "rt library not found.") ENDIF(RT_LIBRARY) MARK_AS_ADVANCED( RT_LIBRARIES RT_LIBRARY ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindRound.cmake000066400000000000000000000034161264126442000164520ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find round function. # # Authors: # Souriya Trinh # ############################################################################# include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckCXXSourceCompiles) macro(check_math_expr1 _expr _var) check_cxx_source_compiles(" #include int main(int argc, char ** argv) { (void)${_expr}; return 0; } " ${_var}) endmacro() macro(check_math_expr2 _expr _var) check_cxx_source_compiles(" #include int main(int argc, char ** argv) { (void)${_expr}; return 0; } " ${_var}) endmacro() check_math_expr1("round(5.5)" HAVE_FUNC_ROUND) check_math_expr2("std::round(5.5)" HAVE_FUNC_STD_ROUND) visp-3.0.0/cmake/FindSOQT.cmake000066400000000000000000000064121264126442000161500ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find SoQt library. # Once run this will define: # # SOQT_FOUND # SOQT_INCLUDE_DIRS # SOQT_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# set(SOQT_FOUND FALSE) # detection of the SoQt headers location FIND_PATH(SOQT_INCLUDE_DIR Inventor/Qt/SoQt.h "$ENV{COIN_DIR}/include" "$ENV{SOQT_DIR}/include" "$ENV{COIN_DIR}" "$ENV{SOQT_DIR}" "$ENV{COINDIR}/include" "$ENV{SOQTDIR}/include" /usr/include/Coin2 /Library/Frameworks/SoQt.framework/Headers ) #MESSAGE("DBG SOQT_INCLUDE_DIR=${SOQT_INCLUDE_DIR}") IF(WIN32) # Detection of the SoQt library on Windows FIND_LIBRARY(SOQT_LIBRARY_RELEASE NAMES soqt1 #only shared libraries under windows PATHS "$ENV{COIN_DIR}/lib" "$ENV{SOQT_DIR}/lib" "$ENV{COINDIR}/lib" "$ENV{SOQTDIR}/lib" ) FIND_LIBRARY(SOQT_LIBRARY_DEBUG NAMES soqt1d #only shared libraries under windows PATHS "$ENV{COIN_DIR}/lib" "$ENV{SOQT_DIR}/lib" "$ENV{COINDIR}/lib" "$ENV{SOQTDIR}/lib" ) if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY_RELEASE) set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) list(APPEND SOQT_LIBRARIES optimized ${SOQT_LIBRARY_RELEASE}) set(SOQT_FOUND TRUE) endif() if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY_DEBUG) set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) list(APPEND SOQT_LIBRARIES debug ${SOQT_LIBRARY_DEBUG}) set(SOQT_FOUND TRUE) endif() MARK_AS_ADVANCED( SOQT_LIBRARIES SOQT_LIBRARY_DEBUG SOQT_LIBRARY_RELEASE SOQT_INCLUDE_DIR ) ELSE(WIN32) # Detection of the SoQt library on Unix FIND_LIBRARY(SOQT_LIBRARY NAMES SoQt PATHS "$ENV{COIN_DIR}/lib" "$ENV{SOQT_DIR}/lib" "$ENV{COINDIR}/lib" "$ENV{SOQTDIR}/lib" /usr/lib /usr/local/lib /lib /Library/Frameworks/SoQt.framework/Libraries ) if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY) set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) set(SOQT_LIBRARIES ${SOQT_LIBRARY}) set(SOQT_FOUND TRUE) endif() MARK_AS_ADVANCED( SOQT_LIBRARIES SOQT_LIBRARY SOQT_INCLUDE_DIR ) #MESSAGE(STATUS "DBG SOQT_LIBRARY=${SOQT_LIBRARY}") ENDIF(WIN32) #MESSAGE(STATUS "SOQT_FOUND : ${SOQT_FOUND}") visp-3.0.0/cmake/FindSOWIN.cmake000066400000000000000000000046611264126442000162650ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find SoQt library. # Once run this will define: # # SOWIN_FOUND # SOWIN_INCLUDE_DIRS # SOWIN_LIBRARIES # SOWIN_LIBRARY_RELEASE # SOWIN_LIBRARY_DEBUG # # Authors: # Fabien Spindler # Anthony Saunier # ############################################################################# set(SOWIN_FOUND FALSE) if(WIN32) FIND_LIBRARY(SOWIN_LIBRARY_RELEASE NAMES sowin1 #only shared libraries under windows PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{SOWIN_DIR}/lib" ) FIND_LIBRARY(SOWIN_LIBRARY_DEBUG NAMES sowin1d #only shared libraries under windows PATHS "$ENV{COINDIR}/lib" "$ENV{COIN_DIR}/lib" "$ENV{SOWIN_DIR}/lib" ) FIND_PATH(SOWIN_INCLUDE_DIR Inventor/Win/SoWin.h "$ENV{COINDIR}/include" "$ENV{COIN_DIR}/include" "$ENV{SOWIN_DIR}/include" ) ## -------------------------------- set(SOWIN_LIBRARIES "") if(SOWIN_LIBRARY_DEBUG) list(APPEND SOWIN_LIBRARIES debug ${SOWIN_LIBRARY_DEBUG}) endif() if(SOWIN_LIBRARY_RELEASE) list(APPEND SOWIN_LIBRARIES optimized ${SOWIN_LIBRARY_RELEASE}) endif() IF(SOWIN_LIBRARIES AND SOWIN_INCLUDE_DIR) set(SOWIN_INCLUDE_DIRS ${SOWIN_INCLUDE_DIR}) set(SOWIN_FOUND TRUE) else() set(SOWIN_FOUND FALSE) endif() endif(WIN32) MARK_AS_ADVANCED( SOWIN_LIBRARY_DEBUG SOWIN_LIBRARY_RELEASE SOWIN_INCLUDE_DIR ) visp-3.0.0/cmake/FindSOXT.cmake000066400000000000000000000036331264126442000161610ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find SoXt library. # Once run this will define: # # SOXT_FOUND # SOXT_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(UNIX) FIND_LIBRARY(SOXT_LIBRARY NAMES SoXt PATHS /usr/lib /usr/local/lib /lib "$ENV{COIN_DIR}/lib" "$ENV{COINDIR}/lib" ) MARK_AS_ADVANCED( SOXT_LIBRARY ) #MESSAGE(STATUS "DBG SOXT_LIBRARY=${SOXT_LIBRARY}") ## -------------------------------- IF(SOXT_LIBRARY) SET(SOXT_LIBRARIES ${SOXT_LIBRARY}) SET(SOXT_FOUND TRUE) MARK_AS_ADVANCED( SOXT_LIBRARIES ) ELSE(SOXT_LIBRARY) SET(SOXT_FOUND FALSE) #MESSAGE("SoXt library not found.") ENDIF(SOXT_LIBRARY) #MESSAGE(STATUS "SOXT_FOUND : ${SOXT_FOUND}") ELSE(UNIX) SET(SOXT_FOUND FALSE) ENDIF(UNIX) visp-3.0.0/cmake/FindV4L2.cmake000066400000000000000000000054201264126442000160470ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find linux/videodev.h for Video For Linux Two framegrabbing # capabilities. # Once run this will define: # # V4L2_FOUND # V4L2_INCLUDE_DIRS # V4L2_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# IF(NOT UNIX) # MESSAGE("FindV4L2.cmake: only available for Unix.") SET(V4L2_FOUND FALSE) ELSE(NOT UNIX) FIND_PATH(V4L2_INCLUDE_VIDEODEV2 linux/videodev2.h $ENV{V4L2_HOME}/include $ENV{V4L2_DIR}/include /usr/include /usr/local/include /usr/src/linux/include ) #MESSAGE("DBG V4L2_INCLUDE_VIDEODEV2=${V4L2_INCLUDE_VIDEODEV2}") FIND_PATH(V4L2_INCLUDE_LIBV4L2 libv4l2.h $ENV{V4L2_HOME}/include $ENV{V4L2_DIR}/include /usr/include /usr/local/include ) #MESSAGE("DBG V4L2_INCLUDE_LIBV4L2=${V4L2_INCLUDE_LIBV4L2}") FIND_LIBRARY(V4L2_LIBRARY_LIBV4L2 NAMES v4l2 PATHS $ENV{V4L2_HOME}/lib $ENV{V4L2_DIR}/lib /usr/lib /usr/local/lib ) FIND_LIBRARY(V4L2_LIBRARY_LIBV4LCONVERT NAMES v4lconvert PATHS $ENV{V4L2_HOME}/lib $ENV{V4L2_DIR}/lib /usr/lib /usr/local/lib ) ## -------------------------------- IF(V4L2_INCLUDE_VIDEODEV2 AND V4L2_INCLUDE_LIBV4L2 AND V4L2_LIBRARY_LIBV4L2 AND V4L2_LIBRARY_LIBV4LCONVERT) SET(V4L2_INCLUDE_DIRS ${V4L2_INCLUDE_VIDEODEV2} ${V4L2_INCLUDE_LIBV4L2}) SET(V4L2_LIBRARIES ${V4L2_LIBRARY_LIBV4L2} ${V4L2_LIBRARY_LIBV4LCONVERT}) SET(V4L2_FOUND TRUE) ELSE() SET(V4L2_FOUND FALSE) ENDIF() MARK_AS_ADVANCED( V4L2_INCLUDE_DIRS V4L2_INCLUDE_VIDEODEV2 V4L2_INCLUDE_LIBV4L2 V4L2_LIBRARY_LIBV4L2 V4L2_LIBRARY_LIBV4LCONVERT ) ENDIF(NOT UNIX) visp-3.0.0/cmake/FindXML2.cmake000066400000000000000000000062601264126442000161050ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find XML library. # Once run this will define: # # XML2_FOUND # XML2_INCLUDE_DIRS # XML2_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# if(WIN32) find_package(ICONV) if(MINGW) find_path(XML2_INCLUDE_DIR libxml/xmlmemory.h "$ENV{MINGW_DIR}/include/libxml2" C:/mingw/include/libxml2 ) find_library(XML2_LIBRARY libxml2 "$ENV{MINGW_DIR}/lib" "$ENV{MINGW_DIR}/lib64" C:/mingw/lib64 ) else() find_path(XML2_INCLUDE_DIR libxml/xmlmemory.h "$ENV{XML2_DIR}/include" "$ENV{XML2_DIR}/include/libxml2" "$ENV{XML2_HOME}/include" "$ENV{XML2_HOME}/include/libxml2" ) find_library(XML2_LIBRARY libxml2 "$ENV{XML2_DIR}/lib" "$ENV{XML2_HOME}/lib" /usr/lib /usr/local/lib "c:/libxml2/lib" ) endif() else(WIN32) find_path(XML2_INCLUDE_DIR libxml/xmlmemory.h "$ENV{XML2_DIR}/include/libxml2" "$ENV{XML2_HOME}/include/libxml2" /usr/include/libxml2 /usr/local/include/libxml2 /usr/local/opt/libxml2/include/libxml2 ) find_library(XML2_LIBRARY xml2 "$ENV{XML2_DIR}/lib" "$ENV{XML2_HOME}/lib" /usr/lib /usr/local/lib /usr/local/opt/libxml2/lib ) endif(WIN32) #MESSAGE("DBG XML2_INCLUDE_DIR=${XML2_INCLUDE_DIR}") #MESSAGE("DBG XML2_LIBRARY=${XML2_LIBRARY}") ## -------------------------------- IF(NOT XML2_INCLUDE_DIR) #MESSAGE(SEND_ERROR "xml include dir not found.") ENDIF(NOT XML2_INCLUDE_DIR) IF(XML2_LIBRARY) SET(XML2_LIBRARIES ${XML2_LIBRARY}) ELSE(XML2_LIBRARY) #MESSAGE(SEND_ERROR "xml library not found.") ENDIF(XML2_LIBRARY) IF(XML2_LIBRARIES AND XML2_INCLUDE_DIR) SET(XML2_INCLUDE_DIRS ${XML2_INCLUDE_DIR}) SET(XML2_FOUND TRUE) IF(WIN32 AND ICONV_FOUND) LIST(APPEND XML2_INCLUDE_DIRS ${ICONV_INCLUDE_DIRS}) SET(XML2_LIBRARIES ${XML2_LIBRARIES} ${ICONV_LIBRARIES}) ENDIF() ELSE(XML2_LIBRARIES AND XML2_INCLUDE_DIR) SET(XML2_FOUND FALSE) ENDIF(XML2_LIBRARIES AND XML2_INCLUDE_DIR) MARK_AS_ADVANCED( XML2_INCLUDE_DIR XML2_LIBRARIES XML2_LIBRARY ) visp-3.0.0/cmake/FindZBAR.cmake000066400000000000000000000032551264126442000161220ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Try to find zbar library. # Once run this will define: # # ZBAR_FOUND # ZBAR_INCLUDE_DIRS # ZBAR_LIBRARIES # # Authors: # Fabien Spindler # ############################################################################# find_path(ZBAR_INCLUDE_DIRS zbar.h $ENV{ZBAR_DIR}/include /usr/include /usr/local/include ) find_library(ZBAR_LIBRARIES NAMES zbar PATHS $ENV{ZBAR_DIR}/lib /usr/lib /usr/local/lib ) if(ZBAR_INCLUDE_DIRS AND ZBAR_LIBRARIES) set(ZBAR_FOUND TRUE) else() set(ZBAR_FOUND FALSE) endif() mark_as_advanced( ZBAR_INCLUDE_DIRS ZBAR_LIBRARIES ) visp-3.0.0/cmake/GNUInstallDirs.cmake000066400000000000000000000155571264126442000173750ustar00rootroot00000000000000# - Define GNU standard installation directories # Provides install directory variables as defined for GNU software: # http://www.gnu.org/prep/standards/html_node/Directory-Variables.html # Inclusion of this module defines the following variables: # CMAKE_INSTALL_ - destination for files of a given type # CMAKE_INSTALL_FULL_ - corresponding absolute path # where is one of: # BINDIR - user executables (bin) # SBINDIR - system admin executables (sbin) # LIBEXECDIR - program executables (libexec) # SYSCONFDIR - read-only single-machine data (etc) # SHAREDSTATEDIR - modifiable architecture-independent data (com) # LOCALSTATEDIR - modifiable single-machine data (var) # LIBDIR - object code libraries (lib or lib64) # INCLUDEDIR - C header files (include) # OLDINCLUDEDIR - C header files for non-gcc (/usr/include) # DATAROOTDIR - read-only architecture-independent data root (share) # DATADIR - read-only architecture-independent data (DATAROOTDIR) # INFODIR - info documentation (DATAROOTDIR/info) # LOCALEDIR - locale-dependent data (DATAROOTDIR/locale) # MANDIR - man documentation (DATAROOTDIR/man) # DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME) # Each CMAKE_INSTALL_ value may be passed to the DESTINATION options of # install() commands for the corresponding file type. If the includer does # not define a value the above-shown default will be used and the value will # appear in the cache for editing by the user. # Each CMAKE_INSTALL_FULL_ value contains an absolute path constructed # from the corresponding destination by prepending (if necessary) the value # of CMAKE_INSTALL_PREFIX. #============================================================================= # Copyright 2011 Nikita Krupen'ko # Copyright 2011 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. # # This software is distributed WITHOUT ANY WARRANTY; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the License for more information. #============================================================================= # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) # Installation directories # if(NOT DEFINED CMAKE_INSTALL_BINDIR) set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)") endif() if(NOT DEFINED CMAKE_INSTALL_SBINDIR) set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)") endif() if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR) set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)") endif() if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR) set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)") endif() if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR) set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)") endif() if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR) set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)") endif() if(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(_LIBDIR_DEFAULT "lib") # Override this default 'lib' with 'lib64' iff: # - we are on Linux system but NOT cross-compiling # - we are NOT on debian # - we are on a 64 bits system # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf # Note that the future of multi-arch handling may be even # more complicated than that: http://wiki.debian.org/Multiarch if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version") if(NOT DEFINED CMAKE_SIZEOF_VOID_P) message(AUTHOR_WARNING "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. " "Please enable at least one language before including GNUInstallDirs.") else() if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") set(_LIBDIR_DEFAULT "lib64") endif() endif() endif() set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})") endif() if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR) set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)") endif() if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR) set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)") endif() if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR) set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)") endif() #----------------------------------------------------------------------------- # Values whose defaults are relative to DATAROOTDIR. Store empty values in # the cache and store the defaults in local variables if the cache values are # not set explicitly. This auto-updates the defaults as DATAROOTDIR changes. if(NOT CMAKE_INSTALL_DATADIR) set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)") set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}") endif() if(NOT CMAKE_INSTALL_INFODIR) set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)") set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info") endif() if(NOT CMAKE_INSTALL_LOCALEDIR) set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)") set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale") endif() if(NOT CMAKE_INSTALL_MANDIR) set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)") set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man") endif() if(NOT CMAKE_INSTALL_DOCDIR) set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)") set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}") endif() #----------------------------------------------------------------------------- mark_as_advanced( CMAKE_INSTALL_BINDIR CMAKE_INSTALL_SBINDIR CMAKE_INSTALL_LIBEXECDIR CMAKE_INSTALL_SYSCONFDIR CMAKE_INSTALL_SHAREDSTATEDIR CMAKE_INSTALL_LOCALSTATEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_OLDINCLUDEDIR CMAKE_INSTALL_DATAROOTDIR CMAKE_INSTALL_DATADIR CMAKE_INSTALL_INFODIR CMAKE_INSTALL_LOCALEDIR CMAKE_INSTALL_MANDIR CMAKE_INSTALL_DOCDIR ) # Result directories # foreach(dir BINDIR SBINDIR LIBEXECDIR SYSCONFDIR SHAREDSTATEDIR LOCALSTATEDIR LIBDIR INCLUDEDIR OLDINCLUDEDIR DATAROOTDIR DATADIR INFODIR LOCALEDIR MANDIR DOCDIR ) if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}}) set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}") else() set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}") endif() endforeach() visp-3.0.0/cmake/OgreTools.cmake000066400000000000000000000356751264126442000165130ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP overall configuration file. Some useful tools for Ogre3D. # # Authors: # Fabien Spindler # ############################################################################# ######################################################### # Find Ogre plugins # # This is a modified version of the macro provided with Ogre # except that it should be used only in a desperate way when the original # one doesn't detect anything ######################################################### macro(vp_ogre_find_plugin_lib_visp PLUGIN) # On Unix, the plugins might have no prefix if (CMAKE_FIND_LIBRARY_PREFIXES) set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES}) set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") endif() # strip RenderSystem_ or Plugin_ prefix from plugin name string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN}) string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP}) set(OGRE_PLUGIN_PATH_SUFFIXES PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN} RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN}) # find link libraries for plugins set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}") get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES) find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIRS} ${OGRE_LIBRARY_DIRS}/OGRE ${OGRE_LIBRARY_DIRS}/OGRE-${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH} PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIRS} ${OGRE_LIBRARY_DIRS}/OGRE ${OGRE_LIBRARY_DIRS}/OGRE-${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH} PATH_SUFFIXES "" OGRE opt debug debug/opt) make_library_set(OGRE_${PLUGIN}_LIBRARY) if (OGRE_${PLUGIN}_LIBRARY) set(OGRE_${PLUGIN}_FOUND TRUE) endif () mark_as_advanced(OGRE_${PLUGIN}_LIBRARY_REL OGRE_${PLUGIN}_LIBRARY_DBG OGRE_${PLUGIN}_LIBRARY_FWK) endmacro() macro(vp_create_ogre_plugin_config_file) set(VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_BINARY_DIR}/data/ogre-simulator" CACHE INTERNAL "Ogre plugins location") # If OGRE_PLUGIN_DIR_REL and OGRE_PLUGIN_DIR_DBG are not defined we # try to find them manually if(NOT OGRE_PLUGIN_DIR_REL AND NOT OGRE_PLUGIN_DIR_DBG) vp_ogre_find_plugin_lib_visp(RenderSystem_Direct3D9) vp_ogre_find_plugin_lib_visp(RenderSystem_Direct3D10) vp_ogre_find_plugin_lib_visp(RenderSystem_Direct3D11) vp_ogre_find_plugin_lib_visp(RenderSystem_GL) vp_ogre_find_plugin_lib_visp(RenderSystem_GLES) vp_ogre_find_plugin_lib_visp(Plugin_ParticleFX) vp_ogre_find_plugin_lib_visp(Plugin_BSPSceneManager) vp_ogre_find_plugin_lib_visp(Plugin_CgProgramManager) vp_ogre_find_plugin_lib_visp(Plugin_PCZSceneManager) vp_ogre_find_plugin_lib_visp(Plugin_OctreeSceneManager) vp_ogre_find_plugin_lib_visp(Plugin_OctreeZone) if(OGRE_RenderSystem_GL_LIBRARY_REL) get_filename_component(OGRE_PLUGIN_DIR_REL ${OGRE_RenderSystem_GL_LIBRARY_REL} PATH) #message("set manually OGRE_PLUGIN_DIR_REL to ${OGRE_PLUGIN_DIR_REL}") elseif(OGRE_RenderSystem_GL_LIBRARY_DBG) get_filename_component(OGRE_PLUGIN_DIR_DBG ${OGRE_RenderSystem_GL_LIBRARY_DBG} PATH) #message("set manually OGRE_PLUGIN_DIR_DBG to ${OGRE_PLUGIN_DIR_DBG}") endif() endif() if(OGRE_PLUGIN_DIR_REL) list(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D9_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D10_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D11_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_RenderSystem_GL_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_RenderSystem_GLES_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_Plugin_ParticleFX_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_Plugin_BSPSceneManager_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_Plugin_CgProgramManager_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_Plugin_PCZSceneManager_LIBRARY_REL}) list(APPEND PLUGIN_REL ${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL}) if(NOT APPLE) # Since the plugin Plugin_Octree causes problems on OSX, we take # it only into account on non Apple platforms list(APPEND PLUGIN_REL ${OGRE_Plugin_OctreeZone_LIBRARY_REL}) endif() set(PLUGINS_CONTENT_REL "# Defines plugins to load\n\n") list(APPEND PLUGINS_CONTENT_REL "# Define plugin folder\n") list(APPEND PLUGINS_CONTENT_REL "PluginFolder=${OGRE_PLUGIN_DIR_REL}/\n\n") list(APPEND PLUGINS_CONTENT_REL "# Define plugins\n") foreach(PLUGIN ${PLUGIN_REL}) if(PLUGIN) get_filename_component(PLUGIN_NAME ${PLUGIN} NAME_WE) list(APPEND PLUGINS_CONTENT_REL " Plugin=${PLUGIN_NAME}\n") endif() endforeach() #MESSAGE("PLUGINS_CONTENT_REL: ${PLUGINS_CONTENT_REL}") file(WRITE "${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg" ${PLUGINS_CONTENT_REL}) endif() if(OGRE_PLUGIN_DIR_DBG) list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D9_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D10_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D11_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_GL_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_GLES_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_Plugin_ParticleFX_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_Plugin_BSPSceneManager_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_Plugin_CgProgramManager_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_Plugin_PCZSceneManager_LIBRARY_DBG}) list(APPEND PLUGIN_DBG ${OGRE_Plugin_OctreeSceneManager_LIBRARY_DBG}) if(NOT APPLE) # Since the plugin Plugin_Octree causes problems on OSX, we take # it only into account on non Apple platforms list(APPEND PLUGIN_DBG ${OGRE_Plugin_OctreeZone_LIBRARY_DBG}) endif() set(PLUGINS_CONTENT_DBG "# Defines plugins to load\n\n") list(APPEND PLUGINS_CONTENT_DBG "# Define plugin folder\n") list(APPEND PLUGINS_CONTENT_DBG "PluginFolder=${OGRE_PLUGIN_DIR_DBG}/\n\n") list(APPEND PLUGINS_CONTENT_DBG "# Define plugins\n") foreach(PLUGIN ${PLUGIN_DBG}) if(PLUGIN) get_filename_component(PLUGIN_NAME ${PLUGIN} NAME_WE) list(APPEND PLUGINS_CONTENT_DBG " Plugin=${PLUGIN_NAME}\n") endif() endforeach() #MESSAGE("PLUGINS_CONTENT_DBG: ${PLUGINS_CONTENT_DBG}") file(WRITE "${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg" ${PLUGINS_CONTENT_DBG}) endif() endmacro() function(vp_set_ogre_media) # if OGRE_MEDIA_DIR is empty, try to find the path by searching for plugins.cfg # Introduced since Ubuntu 12.04 if(NOT OGRE_MEDIA_DIR) find_path(OGRE_MEDIA_DIR ../plugins.cfg $ENV{OGRE_MEDIA_DIR} /usr/share/OGRE-1.7.4/media /usr/share/OGRE-1.8.0/media /usr/share/OGRE-1.8.1/media /usr/share/OGRE-1.9.0/media ) endif() # If Ogre media are not available we provide the minimal material to run the examples: # - resources.cfg # - plugins.cfg # - media/materials/... # - media/models/... # # We need to introduce OGRE_MEDIA_NOT_AVAILABLE to memorize when OGRE_MEDIA_DIR is not set. # Because in that case, OGRE_MEDIA_DIR should be set first to VISP_HAVE_OGRE_RESOURCES_PATH # (for the "make all" case) then to VISP_INSTALL_DIR_OGRE_RESOURCES (for the "make install" case) if(NOT OGRE_MEDIA_DIR) set(OGRE_MEDIA_NOT_AVAILABLE "TRUE") endif() # Try to search for an existing plugins.cfg file # Here we cannot use OGRE_PLUGIN_DIR_REL or OGRE_PLUGIN_DIR_DBG where # we may find an existing plugins.cfg file, since under Windows in these # files the PluginFolder is set to a relative path. We need an absolute # path to avoid recopy of the plugins in ViSP. # Under Linux or OSX, we may find plugins.cfg with a PluginFolder set # to an absolute path in OGRE_MEDIA_DIR/.. find_path(ogre_plugings_cfg_exists NAMES plugins.cfg PATHS ${OGRE_MEDIA_DIR}/.. NO_SYSTEM_ENVIRONMENT_PATH ) mark_as_advanced(ogre_plugings_cfg_exists) #message("OGRE_PLUGIN_DIR_REL: ${OGRE_PLUGIN_DIR_REL}") #message("OGRE_PLUGIN_DIR_DBG: ${OGRE_PLUGIN_DIR_DBG}") if(ogre_plugings_cfg_exists) set(VISP_HAVE_OGRE_PLUGINS_PATH "${ogre_plugings_cfg_exists}" CACHE INTERNAL "Ogre plugins location") else(NOT ogre_plugings_cfg_exists) # If no plugins.cfg file is found, we create one with absolute path # case 1: normal case #-------------- vp_create_ogre_plugin_config_file() # case 2: install or packaging case #-------------- # install rule for plugins.cfg: if(UNIX) if(OGRE_PLUGIN_DIR_REL) install(FILES ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg DESTINATION ${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() if(OGRE_PLUGIN_DIR_DBG) install(FILES ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg DESTINATION ${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() else() if(OGRE_PLUGIN_DIR_REL) install(FILES ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg DESTINATION data/ogre-simulator PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() if(OGRE_PLUGIN_DIR_DBG) install(FILES ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg DESTINATION data/ogre-simulator PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() endif() endif() # Try to search for an existing resources.cfg file find_path(ogre_resources_cfg_exists NAMES resources.cfg PATHS ${OGRE_MEDIA_DIR}/.. NO_SYSTEM_ENVIRONMENT_PATH ) mark_as_advanced(ogre_resources_cfg_exists) # Here we copy all the minimal media files # - media/materials/... # - media/models/... if(OGRE_MEDIA_NOT_AVAILABLE) file(COPY modules/ar/data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator) endif() if(ogre_resources_cfg_exists) set(VISP_HAVE_OGRE_RESOURCES_PATH "${ogre_resources_cfg_exists}" CACHE INTERNAL "Ogre resources location") else() # Here we create a resources.cfg if it was not found # we create a resources.cfg file for vpAROgre.cpp # case 1: normal case # If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use # the minimal requested media to run the examples #-------------- set(VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_BINARY_DIR}/data/ogre-simulator" CACHE INTERNAL "Ogre resources location") if(OGRE_MEDIA_NOT_AVAILABLE) set(OGRE_MEDIA_DIR ${VISP_HAVE_OGRE_RESOURCES_PATH}/media) endif() # Here we add all the subdirs in @OGRE_MEDIA_DIR@/* as resource location. vp_get_relative_subdirs(media_subdirs ${OGRE_MEDIA_DIR}) set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_MEDIA_DIR}\n") foreach(m ${media_subdirs}) set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_MEDIA_DIR}/${m}\n") endforeach() configure_file( ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in ${VISP_HAVE_OGRE_RESOURCES_PATH}/resources.cfg IMMEDIATE @ONLY ) # case 2: install or packaging case # If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use # the minimal requested media to run the examples #-------------- if(UNIX) set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator") else() set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/data/ogre-simulator") endif() # make the var global set(VISP_INSTALL_DIR_OGRE_RESOURCES ${VISP_INSTALL_DIR_OGRE_RESOURCES} CACHE INTERNAL "Ogre media install dir") if(OGRE_MEDIA_NOT_AVAILABLE) set(OGRE_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media) endif() # Here we add all the subdirs in @OGRE_MEDIA_DIR@/* as resource location. set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_MEDIA_DIR}\n") foreach(m ${media_subdirs}) set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_MEDIA_DIR}/${m}\n") endforeach() # install rule for resources.cfg and Ogre media if they are not available: if(UNIX) configure_file( ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in ${VISP_BINARY_DIR}/unix-install/resources.cfg IMMEDIATE @ONLY ) install(FILES ${VISP_BINARY_DIR}/unix-install/resources.cfg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) if(OGRE_MEDIA_NOT_AVAILABLE) install(DIRECTORY ${VISP_BINARY_DIR}/data/ogre-simulator/media DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() else() configure_file( ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in ${VISP_BINARY_DIR}/win-install/resources.cfg IMMEDIATE @ONLY ) install(FILES ${VISP_BINARY_DIR}/win-install/resources.cfg DESTINATION data/ogre-simulator PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) if(OGRE_MEDIA_NOT_AVAILABLE) install(DIRECTORY ${VISP_BINARY_DIR}/data/ogre-simulator/media DESTINATION data/ogre-simulator FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() endif() endif() endfunction() visp-3.0.0/cmake/VISPCRTLinkage.cmake000066400000000000000000000035531264126442000172110ustar00rootroot00000000000000if(NOT MSVC) message(FATAL_ERROR "CRT options are available only for MSVC") endif() if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT) foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) if(${flag_var} MATCHES "/MD") string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") endif() if(${flag_var} MATCHES "/MDd") string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") endif() endforeach(flag_var) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib") else() foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) if(${flag_var} MATCHES "/MT") string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") endif() if(${flag_var} MATCHES "/MTd") string(REGEX REPLACE "/MTd" "/MDd" ${flag_var} "${${flag_var}}") endif() endforeach(flag_var) endif() if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8 AND NOT ${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 8.6) include(ProcessorCount) ProcessorCount(N) if(NOT N EQUAL 0) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${N} ") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N} ") endif() endif() visp-3.0.0/cmake/VISPConfig.cmake000066400000000000000000000125271264126442000164740ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # CMake package config file for ViSP. # # ** File generated automatically, do not modify ** # # This file will define the following CMake variables: # - VISP_INCLUDE_DIRS : ViSP and third-party include directories # - VISP_LIBRARIES : ViSP library to link against. Third-party libraries are # linked automatically thanks to cmake export file VISPTargets.cmake # - VISP_VERSION_STRING : Full ViSP version that is build. Example: "2.10.0" # - VISP_VERSION_MAJOR : Major version part of VISP_VERSION. Example: "2" # - VISP_VERSION_MINOR : Minor version part of VISP_VERSION. Example: "10" # - VISP_VERSION_PATCH : Patch version part of VISP_VERSION. Example: "0" # # Advanced variables: # - VISP_SHARED : Use ViSP as shared library # - VISP_CONFIG_PATH : Path to this VISPConfig.cmake # - VISP_FIND_QUIETLY : If set to TRUE turn off messages during configuration # - VISP_USE_FILE : File to include to use ViSP without specific cmake code # # Windows specific variables: # - VISP_STATIC : If set to TRUE uses ViSP static library (.lib) rather then dynamic (.dll) # # Typical usage in user project: # # find_package(VISP) # include_directories(${VISP_INCLUDE_DIRS}) # target_link_libraries(MY_TARGET_NAME ${VISP_LIBRARIES}) # # It is also possible to build your project using VISP_USE_FILE. # # find_package(VISP) # if(VISP_FOUND) # include(${VISP_USE_FILE}) # endif() # # Authors: # Fabien Spindler # ############################################################################# # similar code exist in VISPDetectPlatform.cmake if(MSVC) if(CMAKE_CL_64) set(VISP_ARCH x64) else() set(VISP_ARCH x86) endif() if(MSVC_VERSION EQUAL 1400) set(VISP_RUNTIME vc8) elseif(MSVC_VERSION EQUAL 1500) set(VISP_RUNTIME vc9) elseif(MSVC_VERSION EQUAL 1600) set(VISP_RUNTIME vc10) elseif(MSVC_VERSION EQUAL 1700) set(VISP_RUNTIME vc11) elseif(MSVC_VERSION EQUAL 1800) set(VISP_RUNTIME vc12) endif() elseif(MINGW) set(VISP_RUNTIME mingw) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) if(VISP_GCC_TARGET_MACHINE MATCHES "64") set(MINGW64 1) set(VISP_ARCH x64) else() set(VISP_ARCH x86) endif() endif() if(CMAKE_VERSION VERSION_GREATER 2.6.2) unset(VISP_CONFIG_PATH CACHE) endif() if(NOT VISP_FIND_QUIETLY) message(STATUS "ViSP ARCH: ${VISP_ARCH}") message(STATUS "ViSP RUNTIME: ${VISP_RUNTIME}") endif() get_filename_component(VISP_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE) if(VISP_RUNTIME AND VISP_ARCH) if(NOT DEFINED VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib/VISPConfig.cmake") set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib") elseif(NOT DEFINED VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib/VISPConfig.cmake") set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib") elseif(VISP_STATIC AND EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib/VISPConfig.cmake") set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/staticlib") elseif(VISP_STATIC EXISTS "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib/VISPConfig.cmake") set(VISP_LIB_PATH "${VISP_CONFIG_PATH}/${VISP_ARCH}/${VISP_RUNTIME}/lib") endif() endif() if(VISP_LIB_PATH AND EXISTS "${VISP_LIB_PATH}/VISPConfig.cmake") include("${VISP_LIB_PATH}/VISPConfig.cmake") set(VISP_FOUND TRUE CACHE BOOL "" FORCE) if(NOT VISP_FIND_QUIETLY) message(STATUS "Found VISP ${VISP_VERSION} in ${VISP_LIB_PATH}") if(NOT VISP_LIB_PATH MATCHES "/staticlib") get_filename_component(_VISP_LIB_PATH "${VISP_LIB_PATH}/../bin" ABSOLUTE) file(TO_NATIVE_PATH "${_VISP_LIB_PATH}" _VISP_LIB_PATH) message(STATUS "You might need to add ${_VISP_LIB_PATH} to your PATH to be able to run your applications.") endif() endif() else() if(NOT VISP_FIND_QUIETLY) message(WARNING "Found ViSP for Windows but it has no binaries compatible with your configuration. You should manually point CMake variable VISP_DIR to your build of ViSP library." ) endif() set(VISP_FOUND FALSE CACHE BOOL "" FORCE) endif() visp-3.0.0/cmake/VISPDetectPlatform.cmake000066400000000000000000000045451264126442000202050ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Authors: # Fabien Spindler # ############################################################################# # ---------------------------------------------------------------------------- # Similar code exist in VISPConfig.cmake # ---------------------------------------------------------------------------- if(NOT DEFINED VISP_STATIC) # look for global setting if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) set(VISP_STATIC OFF) else() set(VISP_STATIC ON) endif() endif() if(MSVC) if(CMAKE_CL_64) set(VISP_ARCH x64) else() set(VISP_ARCH x86) endif() if(MSVC_VERSION EQUAL 1400) set(VISP_RUNTIME vc8) elseif(MSVC_VERSION EQUAL 1500) set(VISP_RUNTIME vc9) elseif(MSVC_VERSION EQUAL 1600) set(VISP_RUNTIME vc10) elseif(MSVC_VERSION EQUAL 1700) set(VISP_RUNTIME vc11) elseif(MSVC_VERSION EQUAL 1800) set(VISP_RUNTIME vc12) elseif(MSVC_VERSION EQUAL 1900) set(VISP_RUNTIME vc14) endif() elseif(MINGW) set(VISP_RUNTIME mingw) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE OUTPUT_STRIP_TRAILING_WHITESPACE) if(VISP_GCC_TARGET_MACHINE MATCHES "64") set(MINGW64 1) set(VISP_ARCH x64) else() set(VISP_ARCH x86) endif() endif() visp-3.0.0/cmake/VISPExtraTargets.cmake000066400000000000000000000101501264126442000176720ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Authors: # Fabien Spindler # ############################################################################# # ---------------------------------------------------------------------------- # Uninstall target, for "make uninstall" # ---------------------------------------------------------------------------- configure_file( cmake/templates/cmake_uninstall.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") if(ENABLE_SOLUTION_FOLDERS) set_target_properties(uninstall PROPERTIES FOLDER "CMakeTargets") endif() # ---------------------------------------------------------------------------- # Doxygen documentation target, for "make visp_doc" and "make html-doc" (to keep compat with previous versions) # ---------------------------------------------------------------------------- if(DOXYGEN_FOUND) add_custom_target(html-doc ${DOXYGEN_EXECUTABLE} ${VISP_DOC_DIR}/config-doxygen) # for compat with previous versions add_custom_target(visp_doc ${DOXYGEN_EXECUTABLE} ${VISP_DOC_DIR}/config-doxygen) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_doc PROPERTIES FOLDER "extra") set_target_properties(html-doc PROPERTIES FOLDER "extra") endif() endif() # ---------------------------------------------------------------------------- # Tests target, for make visp_tests # ---------------------------------------------------------------------------- if(BUILD_TESTS) add_custom_target(visp_tests) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_tests PROPERTIES FOLDER "extra") endif() endif() # ---------------------------------------------------------------------------- # Tests target, for make visp_examples # ---------------------------------------------------------------------------- if(BUILD_EXAMPLES) add_custom_target(visp_examples) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_examples PROPERTIES FOLDER "extra") endif() endif() # ---------------------------------------------------------------------------- # Tests target, for make visp_demos # ---------------------------------------------------------------------------- if(BUILD_DEMOS) add_custom_target(visp_demos) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_demos PROPERTIES FOLDER "extra") endif() endif() # ---------------------------------------------------------------------------- # Tests target, for make visp_tutorials # ---------------------------------------------------------------------------- if(BUILD_TUTORIALS) add_custom_target(visp_tutorials) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_tutorials PROPERTIES FOLDER "extra") endif() endif() # ---------------------------------------------------------------------------- # Target building all ViSP modules # ---------------------------------------------------------------------------- add_custom_target(visp_modules) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(visp_modules PROPERTIES FOLDER "extra") endif() visp-3.0.0/cmake/VISPGenerateConfig.cmake000066400000000000000000000165711264126442000201520ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # This file generates the ViSPConfig.cmake file: # Part 1/3: ${BIN_DIR}/VISPConfig.cmake -> For use *without* "make install" # Part 2/3: ${BIN_DIR}/unix-install/VISPConfig.cmake -> For use with "make install" # Part 3/3: ${BIN_DIR}/win-install/VISPConfig.cmake -> For use within binary installers/packages # # Authors: # Fabien Spindler # ############################################################################# # Macro that returns the relative path to go from a child folder to the parent folder # input: path_to_child # output: path_to_parent, the relative path to go from path_to_child to parent # example: if input =lib/x86_64-linux-gnu, then output=../.. macro(get_path_to_parent path_to_child path_to_parent) set(${path_to_parent} "") set(input_ "${path_to_child}") while(input_) if(input_) set(${path_to_parent} "${${path_to_parent}}../") endif() get_filename_component(input_ "${input_}" PATH) endwhile(input_) endmacro() # Here we determine the relative path from ./${CMAKE_INSTALL_LIBDIR} to its parent folder # if CMAKE_INSTALL_LIBDIR=lib, then VISP_INSTALL_LIBDIR_TO_PARENT=../ # if CMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu, then VISP_INSTALL_LIBDIR_TO_PARENT=../.. get_path_to_parent(${CMAKE_INSTALL_LIBDIR} VISP_INSTALL_LIBDIR_TO_PARENT) #build list of modules available for the ViSP user set(VISP_LIB_COMPONENTS "") foreach(m ${VISP_MODULES_PUBLIC}) list(INSERT VISP_LIB_COMPONENTS 0 ${${m}_MODULE_DEPS_OPT} ${m}) endforeach() vp_list_unique(VISP_LIB_COMPONENTS) #message("VISP_LIB_COMPONENTS: ${VISP_LIB_COMPONENTS}") set(VISP_MODULES_CONFIGCMAKE ${VISP_LIB_COMPONENTS}) vp_list_filterout(VISP_LIB_COMPONENTS "^visp_") if(VISP_LIB_COMPONENTS) list(REMOVE_ITEM VISP_MODULES_CONFIGCMAKE ${VISP_LIB_COMPONENTS}) endif() # ------------------------------------------------------------------------------------------- # Part 1/3: ${BIN_DIR}/VISPConfig.cmake -> For use *without* "make install" # ------------------------------------------------------------------------------------------- # Export the library export(TARGETS ${VISPModules_TARGETS} FILE "${PROJECT_BINARY_DIR}/VISPModules.cmake") ## Update include dirs set(VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") foreach(m ${VISP_MODULES_BUILD}) if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include") list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_MODULE_${m}_LOCATION}/include") endif() list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) configure_file( cmake/templates/VISPConfig.cmake.in ${VISP_BINARY_DIR}/VISPConfig.cmake IMMEDIATE @ONLY ) configure_file( cmake/templates/VISPConfigVersion.cmake.in ${VISP_BINARY_DIR}/VISPConfigVersion.cmake IMMEDIATE @ONLY ) configure_file( cmake/VISPUse.cmake.in ${VISP_BINARY_DIR}/VISPUse.cmake IMMEDIATE @ONLY ) # -------------------------------------------------------------------------------------------- # Part 2/3: ${BIN_DIR}/unix-install/VISPConfig.cmake -> For use *with* "make install" # ------------------------------------------------------------------------------------------- if(UNIX) set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_INSTALL_PATH}/${CMAKE_INSTALL_INCLUDEDIR}") foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) configure_file( cmake/templates/VISPConfig.cmake.in ${VISP_BINARY_DIR}/unix-install/VISPConfig.cmake IMMEDIATE @ONLY ) configure_file( cmake/templates/VISPConfigVersion.cmake.in ${VISP_BINARY_DIR}/unix-install/VISPConfigVersion.cmake IMMEDIATE @ONLY ) configure_file( cmake/VISPUse.cmake.in ${VISP_BINARY_DIR}/unix-install/VISPUse.cmake IMMEDIATE @ONLY ) install(FILES ${VISP_BINARY_DIR}/unix-install/VISPConfig.cmake ${VISP_BINARY_DIR}/unix-install/VISPConfigVersion.cmake ${VISP_BINARY_DIR}/unix-install/VISPUse.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/visp" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) # Install the export set for use with the install-tree install(EXPORT VISPModules FILE VISPModules.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/visp" COMPONENT dev ) endif() # -------------------------------------------------------------------------------------------- # Part 3/3: ${BIN_DIR}/win-install/VISPConfig.cmake -> For use within binary installers/packages # -------------------------------------------------------------------------------------------- if(WIN32) set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_CONFIG_PATH}/${CMAKE_INSTALL_INCLUDEDIR}") foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) endforeach() vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) configure_file( cmake/templates/VISPConfig.cmake.in ${VISP_BINARY_DIR}/win-install/VISPConfig.cmake IMMEDIATE @ONLY ) configure_file( cmake/templates/VISPConfigVersion.cmake.in ${VISP_BINARY_DIR}/win-install/VISPConfigVersion.cmake IMMEDIATE @ONLY ) configure_file( cmake/VISPUse.cmake.in ${VISP_BINARY_DIR}/win-install/VISPUse.cmake IMMEDIATE @ONLY ) if(BUILD_SHARED_LIBS) install(FILES "${CMAKE_BINARY_DIR}/win-install/ViSPConfig.cmake" "${CMAKE_BINARY_DIR}/win-install/ViSPUse.cmake" DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}" COMPONENT dev) install(EXPORT VISPModules DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}" FILE VISPModules.cmake COMPONENT dev) else() install(FILES "${CMAKE_BINARY_DIR}/win-install/ViSPConfig.cmake" "${CMAKE_BINARY_DIR}/win-install/ViSPUse.cmake" DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}" COMPONENT dev) install(EXPORT VISPModules DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}" FILE VISPModules.cmake COMPONENT dev) endif() install(FILES "cmake/VISPConfig.cmake" "${VISP_BINARY_DIR}/win-install/VISPConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) endif() visp-3.0.0/cmake/VISPGenerateHeaders.cmake000066400000000000000000000057551264126442000203220ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Authors: # Fabien Spindler # ############################################################################# # platform-specific config file configure_file("${VISP_SOURCE_DIR}/cmake/templates/vpConfig.h.in" "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h") install(FILES "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp3/core COMPONENT dev ) #---------------------------------------------------------------------- # information file #---------------------------------------------------------------------- configure_file(${VISP_SOURCE_DIR}/cmake/templates/ViSP-third-party.txt.in "${VISP_BINARY_DIR}/ViSP-third-party.txt") # ---------------------------------------------------------------------------- # visp_modules.h based on actual modules list # ---------------------------------------------------------------------------- set(VISP_MODULE_DEFINITIONS_CONFIGMAKE "#ifndef __visp_modules_h__\n#define __visp_modules_h__\n\n") set(VISP_MOD_LIST ${VISP_MODULES_PUBLIC}) vp_list_sort(VISP_MOD_LIST) foreach(m ${VISP_MOD_LIST}) if(m MATCHES "^visp_") string(REGEX REPLACE "^visp_" "" m "${m}") endif() string(TOUPPER "${m}" m) set(VISP_MODULE_DEFINITIONS_CONFIGMAKE "${VISP_MODULE_DEFINITIONS_CONFIGMAKE}#define VISP_HAVE_MODULE_${m}\n") endforeach() set(VISP_MODULE_DEFINITIONS_CONFIGMAKE "${VISP_MODULE_DEFINITIONS_CONFIGMAKE}\n#endif\n") configure_file("${VISP_SOURCE_DIR}/cmake/templates/visp_modules.h.in" "${VISP_INCLUDE_DIR}/visp3/visp_modules.h") install(FILES "${VISP_INCLUDE_DIR}/visp3/visp_modules.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp3 COMPONENT dev ) # ---------------------------------------------------------------------------- # install old headers # ---------------------------------------------------------------------------- file(GLOB old_hdrs "${VISP_INCLUDE_DIR}/visp/*.h") install(FILES ${old_hdrs} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp COMPONENT dev ) visp-3.0.0/cmake/VISPGeneratePkgConfigScript.cmake000066400000000000000000000273431264126442000220000ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # This file generates the ViSP library config shell scripts: # - visp-config in /bin from visp-config.in # - visp-config in /install from visp-config.install.in # When make install, this file is copied in /bin # - visp.pc in /install from visp.pc.in # When make install, this file is copied in /lib/pkgconfig # # Authors: # Fabien Spindler # ############################################################################# if (UNIX) ####################################################################### # # for Unix platforms: Linux, OSX # ####################################################################### set(FILE_VISP_CONFIG_SCRIPT_IN "cmake/templates/visp-config.in") set(FILE_VISP_CONFIG_SCRIPT "${BINARY_OUTPUT_PATH}/visp-config") set(FILE_VISP_CONFIG_SCRIPT_INSTALL_IN "cmake/templates/visp-config.install.in") set(FILE_VISP_CONFIG_SCRIPT_INSTALL "${VISP_BINARY_DIR}/unix-install/visp-config") set(FILE_VISP_CONFIG_PC_INSTALL_IN "cmake/templates/visp.pc.in") set(FILE_VISP_CONFIG_PC_INSTALL "${VISP_BINARY_DIR}/unix-install/visp.pc") #--------------------------------------------------------------------- # Updates VISP_CONFIG_SCRIPT_PREFIX #---------------------------------------------------------------------- set(VISP_CONFIG_SCRIPT_PREFIX "${CMAKE_INSTALL_PREFIX}") #--------------------------------------------------------------------- # Updates VISP_CONFIG_CFLAGS #---------------------------------------------------------------------- foreach(m ${VISP_MODULES_BUILD}) foreach(inc ${VISP_MODULE_${m}_INC_DEPS}) list(APPEND VISP_CONFIG_CFLAGS "-I${inc}") endforeach() endforeach() vp_list_unique(VISP_CONFIG_CFLAGS) # Format the string to suppress CMake separators ";" vp_list_remove_separator(VISP_CONFIG_CFLAGS) if(BUILD_TEST_COVERAGE) # Add build options for test coverage. Currently coverage is only supported # on gcc compiler # Because using -fprofile-arcs with shared lib can cause problems like: # hidden symbol `__bb_init_func', we add this option only for static # library build set(VISP_CONFIG_CFLAGS "${VISP_CONFIG_CFLAGS} -ftest-coverage -fprofile-arcs") endif() #--------------------------------------------------------------------- # Updates the /bin/visp-config shell script # Updates VISP_CONFIG_LIBS_SCRIPT (for visp-config) # Updates VISP_CONFIG_CFLAGS_SCRIPT (for visp-config) #---------------------------------------------------------------------- # prepend with ViSP own include dir set(VISP_CONFIG_CFLAGS_SCRIPT "-I$PREFIX/${CMAKE_INSTALL_INCLUDEDIR} ${VISP_CONFIG_CFLAGS}") # prepend with ViSP own modules first set(VISP_CONFIG_LIBS_SCRIPT "") foreach(m ${VISP_MODULES_BUILD}) # need to be improved if(POLICY CMP0026) cmake_policy(PUSH) cmake_policy(SET CMP0026 OLD) get_target_property(m_libpath ${m} LOCATION_Release) cmake_policy(POP) else() get_target_property(m_libpath ${m} LOCATION_Release) endif() get_filename_component(m_libname "${m_libpath}" NAME) list(APPEND VISP_CONFIG_LIBS_SCRIPT "$PREFIX/${CMAKE_INSTALL_LIBDIR}/${m_libname}") endforeach() # append deps foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_CONFIG_LIBS_SCRIPT ${VISP_MODULE_${m}_LINK_DEPS}) endforeach() vp_list_unique(VISP_CONFIG_LIBS_SCRIPT) # message("VISP_CONFIG_LIBS_SCRIPT: ${VISP_CONFIG_LIBS_SCRIPT}") set(VISP_ECHO_NO_NEWLINE_CHARACTER "") set(VISP_ECHO_NO_NEWLINE_OPTION "") if(APPLE) set(VISP_ECHO_NO_NEWLINE_CHARACTER "\\c") else() set(VISP_ECHO_NO_NEWLINE_OPTION "-n") endif() configure_file(${FILE_VISP_CONFIG_SCRIPT_IN} ${FILE_VISP_CONFIG_SCRIPT}) #--------------------------------------------------------------------- # Updates the /install/visp-config shell script #---------------------------------------------------------------------- configure_file(${FILE_VISP_CONFIG_SCRIPT_INSTALL_IN} ${FILE_VISP_CONFIG_SCRIPT_INSTALL}) #--------------------------------------------------------------------- # Updates the /install/visp.pc pkg-config file # Updates VISP_CONFIG_CFLAGS_PC (for libvisp.pc used by pkg-config) # Updates VISP_CONFIG_LIBS_PC (for libvisp.pc used by pkg-config) #---------------------------------------------------------------------- set(exec_prefix "\${prefix}") set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") # prepend with ViSP own include dir set(VISP_CONFIG_CFLAGS_PC "-I\${includedir} ${VISP_CONFIG_CFLAGS}") # prepend with ViSP own modules first set(VISP_CONFIG_LIBS_PC "") foreach(m ${VISP_MODULES_BUILD}) # need to be improved if(POLICY CMP0026) cmake_policy(PUSH) cmake_policy(SET CMP0026 OLD) get_target_property(m_libpath ${m} LOCATION_Release) cmake_policy(POP) else() get_target_property(m_libpath ${m} LOCATION_Release) endif() get_filename_component(m_libname "${m_libpath}" NAME) list(APPEND VISP_CONFIG_LIBS_PC "\${libdir}/${m_libname}") endforeach() # append deps foreach(m ${VISP_MODULES_BUILD}) list(APPEND VISP_CONFIG_LIBS_PC ${VISP_MODULE_${m}_LINK_DEPS}) endforeach() vp_list_remove_separator(VISP_CONFIG_LIBS_PC) configure_file(${FILE_VISP_CONFIG_PC_INSTALL_IN} ${FILE_VISP_CONFIG_PC_INSTALL}) else(UNIX) ####################################################################### # # for windows platforms # ####################################################################### set(FILE_VISP_CONFIG_SCRIPT_IN "cmake/templates/visp-config.bat.in") set(FILE_VISP_CONFIG_SCRIPT "${BINARY_OUTPUT_PATH}/visp-config.bat") set(FILE_VISP_CONFIG_SCRIPT_INSTALL_IN "cmake/templates/visp-config.bat.in") set(FILE_VISP_CONFIG_SCRIPT_INSTALL "${VISP_BINARY_DIR}/win-install/visp-config-${VISP_ARCH}-${VISP_RUNTIME}.bat") #--------------------------------------------------------------------- # Updates VISP_CONFIG_SCRIPT_PREFIX #---------------------------------------------------------------------- set(VISP_CONFIG_SCRIPT_PREFIX "${CMAKE_INSTALL_PREFIX}") #--------------------------------------------------------------------- # Updates VISP_CONFIG_SCRIPT_DEF #---------------------------------------------------------------------- set(VISP_CONFIG_SCRIPT_DEFS "") set(VISP_OPENMP_SUPPORT "no") if(NOT ${VISP_OPENMP_FLAGS} STREQUAL "") set(VISP_CONFIG_SCRIPT_DEFS "${VISP_OPENMP_FLAGS}") set(VISP_OPENMP_SUPPORT "yes") endif() if(NOT ${VISP_CPP11_FLAGS} STREQUAL "") set(VISP_CONFIG_SCRIPT_DEFS "${VISP_CPP11_FLAGS}, ${VISP_CONFIG_SCRIPT_DEFS}") endif() #--------------------------------------------------------------------- # Updates VISP_CONFIG_SCRIPT_INCL #---------------------------------------------------------------------- set(VISP_CONFIG_SCRIPT_INC "%PREFIX%/${CMAKE_INSTALL_INCLUDEDIR}") foreach(m ${VISP_MODULES_BUILD}) foreach(inc ${VISP_MODULE_${m}_INC_DEPS}) list(APPEND VISP_CONFIG_SCRIPT_INC "${inc}") endforeach() endforeach() vp_list_unique(VISP_CONFIG_SCRIPT_INC) #message(VISP_CONFIG_SCRIPT_INC ${VISP_CONFIG_SCRIPT_INC}) #--------------------------------------------------------------------- # Updates VISP_CONFIG_SCRIPT_LIBDIR # 1/ For usage with the build tree # 2/ For usage with the install tree # # and updates VISP_CONFIG_SCRIPT_LIBS_${config} #---------------------------------------------------------------------- set(TMP_SCRIPT_LIBS_DEBUG "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}${VISP_DEBUG_POSTFIX}.lib") set(TMP_SCRIPT_LIBS_OPTIMIZED "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}.lib") #MESSAGE(VISP_EXTERN_LIBRARIES: ${VISP_EXTERN_LIBRARIES}) set(TMP_IS_DEBUG FALSE) set(TMP_IS_OPTIMIZED FALSE) foreach(lib ${VISP_EXTERN_LIBRARIES}) if("${lib}" MATCHES "[d][e][b][u][g]") set(TMP_IS_DEBUG TRUE) elseif("${lib}" MATCHES "[o][p][t][i][m][i][z][e][d]") set(TMP_IS_OPTIMIZED TRUE) else() # Get the library name get_filename_component(libname ${lib} NAME) if("${libname}" MATCHES ".+[.][l][i][b]" OR "${libname}" MATCHES ".+[.][L][i][b]") #MESSAGE("${libname} matches .lib or .Lib") else() # We need to add .lib suffix #MESSAGE("For ${libname} we add .lib suffix") set(libname "${libname}.lib") endif() # Get the library path get_filename_component(libpath ${lib} PATH) list(APPEND VISP_CONFIG_SCRIPT_LIBDIR_ "${libpath}") if(TMP_IS_DEBUG) set(TMP_IS_DEBUG FALSE) list(APPEND TMP_SCRIPT_LIBS_DEBUG ${libname}) elseif(TMP_IS_OPTIMIZED) set(TMP_IS_OPTIMIZED FALSE) list(APPEND TMP_SCRIPT_LIBS_OPTIMIZED ${libname}) else() list(APPEND TMP_SCRIPT_LIBS_DEBUG ${libname}) list(APPEND TMP_SCRIPT_LIBS_OPTIMIZED ${libname}) endif() endif() endforeach(lib) # Format the string set(VISP_CONFIG_SCRIPT_LIBS_DEBUG "${TMP_SCRIPT_LIBS_DEBUG}") set(VISP_CONFIG_SCRIPT_LIBS_OPTIMIZED "${TMP_SCRIPT_LIBS_OPTIMIZED}") # Format the string string(REGEX REPLACE "lib/Release" "lib/$(ConfigurationName)" VISP_CONFIG_SCRIPT_LIBDIR_ "${VISP_CONFIG_SCRIPT_LIBDIR_}") string(REGEX REPLACE "lib/Debug" "lib/$(ConfigurationName)" VISP_CONFIG_SCRIPT_LIBDIR_ "${VISP_CONFIG_SCRIPT_LIBDIR_}") # 1/ For usage with the build tree set(VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/lib") list(APPEND VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/lib/$(ConfigurationName)") list(APPEND VISP_CONFIG_SCRIPT_LIBDIR ${VISP_CONFIG_SCRIPT_LIBDIR_}) list(REMOVE_DUPLICATES VISP_CONFIG_SCRIPT_LIBDIR) configure_file(${FILE_VISP_CONFIG_SCRIPT_IN} ${FILE_VISP_CONFIG_SCRIPT}) # 2/ For usage with the install tree set(VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/${VISP_ARCH}/${VISP_RUNTIME}/lib") list(APPEND VISP_CONFIG_SCRIPT_LIBDIR ${VISP_CONFIG_SCRIPT_LIBDIR_}) list(REMOVE_DUPLICATES VISP_CONFIG_SCRIPT_LIBDIR) configure_file(${FILE_VISP_CONFIG_SCRIPT_INSTALL_IN} ${FILE_VISP_CONFIG_SCRIPT_INSTALL}) endif(UNIX) #---------------------------------------------------------------------- # customize install target #---------------------------------------------------------------------- # install rule for visp-config shell script install(FILES ${FILE_VISP_CONFIG_SCRIPT_INSTALL} DESTINATION ${CMAKE_INSTALL_BINDIR} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE OWNER_WRITE COMPONENT dev ) # install rule for visp.pc pkg-config file if(UNIX) install(FILES ${FILE_VISP_CONFIG_PC_INSTALL} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) else() # not implemented yet endif() visp-3.0.0/cmake/VISPModule.cmake000066400000000000000000001120111264126442000165010ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Authors: # Fabien Spindler # ############################################################################# # Local variables (set for each module): # # name - short name in lower case i.e. core # the_module - full name in lower case i.e. visp_core # Global variables: # # VISP_MODULE_${the_module}_LOCATION # VISP_MODULE_${the_module}_BINARY_DIR # VISP_MODULE_${the_module}_DESCRIPTION # VISP_MODULE_${the_module}_CLASS - PUBLIC|INTERNAL|BINDINGS # VISP_MODULE_${the_module}_HEADERS # VISP_MODULE_${the_module}_SOURCES # VISP_MODULE_${the_module}_DEPS - final flattened set of module dependencies # VISP_MODULE_${the_module}_DEPS_TO_LINK - differs from above for world build only # VISP_MODULE_${the_module}_DEPS_EXT - non-module dependencies # VISP_MODULE_${the_module}_REQ_DEPS # VISP_MODULE_${the_module}_OPT_DEPS # VISP_MODULE_${the_module}_PRIVATE_REQ_DEPS # VISP_MODULE_${the_module}_PRIVATE_OPT_DEPS # VISP_MODULE_${the_module}_CHILDREN - list of submodules for compound modules (cmake >= 2.8.8) # HAVE_${the_module} - for fast check of module availability # To control the setup of the module you could also set: # the_description - text to be used as current module description # VISP_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module # BUILD_${the_module}_INIT - ON|OFF (default ON) - initial value for BUILD_${the_module} # VISP_MODULE_CHILDREN - list of submodules # The verbose template for ViSP module: # # vp_add_module(modname ) # vp_glob_module_sources(() # or glob them manually and vp_set_module_sources(...) # vp_module_include_directories() # vp_create_module() # # If module have no "extra" then you can define it in one line: # # vp_define_module(modname ) # clean flags for modules enabled on previous cmake run # this is necessary to correctly handle modules removal foreach(mod ${VISP_MODULES_BUILD} ${VISP_MODULES_DISABLED_USER} ${VISP_MODULES_DISABLED_AUTO} ${VISP_MODULES_DISABLED_FORCE}) if(HAVE_${mod}) unset(HAVE_${mod} CACHE) endif() unset(VISP_MODULE_${mod}_REQ_DEPS CACHE) unset(VISP_MODULE_${mod}_OPT_DEPS CACHE) unset(VISP_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE) unset(VISP_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE) unset(VISP_MODULE_${mod}_LINK_DEPS CACHE) unset(VISP_MODULE_${mod}_INC_DEPS CACHE) endforeach() # clean modules info which needs to be recalculated set(VISP_MODULES_PUBLIC "" CACHE INTERNAL "List of ViSP modules marked for export") set(VISP_MODULES_BUILD "" CACHE INTERNAL "List of ViSP modules included into the build") set(VISP_MODULES_DISABLED_USER "" CACHE INTERNAL "List of ViSP modules explicitly disabled by user") set(VISP_MODULES_DISABLED_AUTO "" CACHE INTERNAL "List of ViSP modules implicitly disabled due to dependencies") set(VISP_MODULES_DISABLED_FORCE "" CACHE INTERNAL "List of ViSP modules which can not be build in current configuration") # adds dependencies to ViSP module # Usage: # add_dependencies(visp_ [REQUIRED] [] [OPTIONAL ]) # Notes: # * - can include full names of modules or full pathes to shared/static libraries or cmake targets macro(vp_add_dependencies full_modname) vp_debug_message("vp_add_dependencies(" ${full_modname} ${ARGN} ")") #we don't clean the dependencies here to allow this macro several times for every module foreach(d "REQUIRED" ${ARGN}) if(d STREQUAL "REQUIRED") set(__depsvar VISP_MODULE_${full_modname}_REQ_DEPS) elseif(d STREQUAL "OPTIONAL") set(__depsvar VISP_MODULE_${full_modname}_OPT_DEPS) elseif(d STREQUAL "PRIVATE_REQUIRED") set(__depsvar VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS) elseif(d STREQUAL "PRIVATE_OPTIONAL") set(__depsvar VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS) else() list(APPEND ${__depsvar} "${d}") endif() endforeach() unset(__depsvar) vp_list_unique(VISP_MODULE_${full_modname}_REQ_DEPS) vp_list_unique(VISP_MODULE_${full_modname}_OPT_DEPS) vp_list_unique(VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS) vp_list_unique(VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS) set(VISP_MODULE_${full_modname}_REQ_DEPS ${VISP_MODULE_${full_modname}_REQ_DEPS} CACHE INTERNAL "Required dependencies of ${full_modname} module") set(VISP_MODULE_${full_modname}_OPT_DEPS ${VISP_MODULE_${full_modname}_OPT_DEPS} CACHE INTERNAL "Optional dependencies of ${full_modname} module") set(VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS ${VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS} CACHE INTERNAL "Required private dependencies of ${full_modname} module") set(VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS ${VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS} CACHE INTERNAL "Optional private dependencies of ${full_modname} module") endmacro() # declare new ViSP module in current folder # Usage: # vp_add_module( [INTERNAL|BINDINGS] [REQUIRED] [] [OPTIONAL ]) # Example: # vp_add_module(mymodule INTERNAL visp_core OPTIONAL visp_ar) macro(vp_add_module _name) vp_debug_message("vp_add_module(" ${_name} ${ARGN} ")") string(TOLOWER "${_name}" name) set(the_module visp_${name}) #message("Found module: ${the_module}") # the first pass - collect modules info, the second pass - create targets if(VISP_INITIAL_PASS) #guard agains redefinition if(";${VISP_MODULES_BUILD};${VISP_MODULES_DISABLED_USER};" MATCHES ";${the_module};") message(FATAL_ERROR "Redefinition of the ${the_module} module. at: ${CMAKE_CURRENT_SOURCE_DIR} previously defined at: ${VISP_MODULE_${the_module}_LOCATION} ") endif() if(NOT DEFINED the_description) set(the_description "The ViSP ${name} module") endif() if(NOT DEFINED BUILD_${the_module}_INIT) set(BUILD_${the_module}_INIT ON) endif() # create option to enable/disable this module option(BUILD_MODULE_${the_module} "Include ${the_module} module into ViSP build" ${BUILD_${the_module}_INIT}) # remember the module details set(VISP_MODULE_${the_module}_DESCRIPTION "${the_description}" CACHE INTERNAL "Brief description of ${the_module} module") set(VISP_MODULE_${the_module}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${the_module} module sources") set(VISP_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "") set(VISP_MODULE_${the_module}_INC_DEPS "" CACHE INTERNAL "") # parse list of dependencies if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS") set(VISP_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module") set(__vp_argn__ ${ARGN}) list(REMOVE_AT __vp_argn__ 0) vp_add_dependencies(${the_module} ${__vp_argn__}) unset(__vp_argn__) else() set(VISP_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The category of the module") vp_add_dependencies(${the_module} ${ARGN}) if(BUILD_MODULE_${the_module}) set(VISP_MODULES_PUBLIC ${VISP_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of ViSP modules marked for export") endif() endif() if(BUILD_MODULE_${the_module}) set(VISP_MODULES_BUILD ${VISP_MODULES_BUILD} "${the_module}" CACHE INTERNAL "List of ViSP modules included into the build") else() set(VISP_MODULES_DISABLED_USER ${VISP_MODULES_DISABLED_USER} "${the_module}" CACHE INTERNAL "List of ViSP modules explicitly disabled by user") endif() # add submodules if any set(VISP_MODULE_${the_module}_CHILDREN "${VISP_MODULE_CHILDREN}" CACHE INTERNAL "List of ${the_module} submodules") # stop processing of current file return() else() set(VISP_MODULE_${the_module}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") if(NOT BUILD_MODULE_${the_module}) return() # extra protection from redefinition endif() endif() endmacro() # remove visp_ prefix from name macro(vp_short_module_name name) if(${name} MATCHES "^visp_") string(REGEX REPLACE "^visp_" "" ${name} "${${name}}") endif() endmacro() # collect modules from specified directories # NB: must be called only once! macro(vp_glob_modules) if(DEFINED VISP_INITIAL_PASS) message(FATAL_ERROR "ViSP has already loaded its modules. Calling vp_glob_modules second time is not allowed.") endif() set(__directories_observed "") # collect modules set(VISP_INITIAL_PASS ON) set(VISP_PROCESSING_EXTRA_MODULES 0) foreach(__path ${ARGN}) if("${__path}" STREQUAL "EXTRA") set(VISP_PROCESSING_EXTRA_MODULES 1) endif() get_filename_component(__path "${__path}" ABSOLUTE) list(FIND __directories_observed "${__path}" __pathIdx) if(__pathIdx GREATER -1) message(FATAL_ERROR "The directory ${__path} is observed for ViSP modules second time.") endif() list(APPEND __directories_observed "${__path}") file(GLOB __vpmodules RELATIVE "${__path}" "${__path}/*") if(__vpmodules) list(SORT __vpmodules) foreach(mod ${__vpmodules}) get_filename_component(__modpath "${__path}/${mod}" ABSOLUTE) if(EXISTS "${__modpath}/CMakeLists.txt") list(FIND __directories_observed "${__modpath}" __pathIdx) if(__pathIdx GREATER -1) message(FATAL_ERROR "The module from ${__modpath} is already loaded.") endif() list(APPEND __directories_observed "${__modpath}") add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}") else() # modules in tracker get_filename_component(__subpath "${__path}/${mod}" ABSOLUTE) file(GLOB __vpsubmodules RELATIVE "${__subpath}" "${__subpath}/*") if(__vpsubmodules) list(SORT __vpsubmodules) foreach(submod ${__vpsubmodules}) get_filename_component(__submodpath "${__subpath}/${submod}" ABSOLUTE) if(EXISTS "${__submodpath}/CMakeLists.txt") list(FIND __directories_observed "${__submodpath}" __pathIdx) if(__pathIdx GREATER -1) message(FATAL_ERROR "The module from ${__submodpath} is already loaded.") endif() list(APPEND __directories_observed "${__submodpath}") add_subdirectory("${__submodpath}" "${CMAKE_CURRENT_BINARY_DIR}/${submod}/.${submod}") endif() endforeach() endif() endif() endforeach() endif() endforeach() vp_clear_vars(__vpmodules __directories_observed __path __modpath __pathIdx __vpsubmodules __subpath __submodpath) # resolve dependencies __vp_resolve_dependencies() # create modules set(VISP_INITIAL_PASS OFF PARENT_SCOPE) set(VISP_INITIAL_PASS OFF) foreach(m ${VISP_MODULES_BUILD}) if(m MATCHES "^visp_") string(REGEX REPLACE "^visp_" "" __shortname "${m}") add_subdirectory("${VISP_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}") else() message(WARNING "Check module name: ${m}") add_subdirectory("${VISP_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}") endif() endforeach() unset(__shortname) endmacro() # disables ViSP module with missing dependencies function(__vp_module_turn_off the_module) list(REMOVE_ITEM VISP_MODULES_DISABLED_AUTO "${the_module}") list(APPEND VISP_MODULES_DISABLED_AUTO "${the_module}") list(REMOVE_ITEM VISP_MODULES_BUILD "${the_module}") list(REMOVE_ITEM VISP_MODULES_PUBLIC "${the_module}") set(HAVE_${the_module} OFF CACHE INTERNAL "Module ${the_module} can not be built in current configuration") set(VISP_MODULES_DISABLED_AUTO "${VISP_MODULES_DISABLED_AUTO}" CACHE INTERNAL "") set(VISP_MODULES_BUILD "${VISP_MODULES_BUILD}" CACHE INTERNAL "") set(VISP_MODULES_PUBLIC "${VISP_MODULES_PUBLIC}" CACHE INTERNAL "") endfunction() # sort modules by dependencies function(__vp_sort_modules_by_deps __lst) vp_list_sort(${__lst}) set(input ${${__lst}}) set(result "") while(input) list(LENGTH input length_before) foreach (m ${input}) # check if module is in the result already if (NOT ";${result};" MATCHES ";${m};") # scan through module dependencies... set(unresolved_deps_found FALSE) foreach (d ${VISP_MODULE_${m}_CHILDREN} ${VISP_MODULE_${m}_DEPS}) # ... which are not already in the result and are enabled if ((NOT ";${result};" MATCHES ";${d};") AND HAVE_${d}) set(unresolved_deps_found TRUE) break() endif() endforeach() # chek if all dependencies for this module has been resolved if (NOT unresolved_deps_found) list(APPEND result ${m}) list(REMOVE_ITEM input ${m}) endif() endif() endforeach() list(LENGTH input length_after) # check for infinite loop or unresolved dependencies if (NOT length_after LESS length_before) message(WARNING "Unresolved dependencies or loop in dependency graph (${length_after})\n" "Processed ${__lst}: ${${__lst}}\n" "Good modules: ${result}\n" "Bad modules: ${input}" ) list(APPEND result ${input}) break() endif() endwhile() set(${__lst} "${result}" PARENT_SCOPE) endfunction() # resolve dependensies function(__vp_resolve_dependencies) foreach(m ${VISP_MODULES_DISABLED_USER}) set(HAVE_${m} OFF CACHE INTERNAL "Module ${m} will not be built in current configuration") endforeach() foreach(m ${VISP_MODULES_BUILD}) set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration") endforeach() # disable MODULES with unresolved dependencies set(has_changes ON) while(has_changes) set(has_changes OFF) foreach(m ${VISP_MODULES_BUILD}) set(__deps ${VISP_MODULE_${m}_REQ_DEPS} ${VISP_MODULE_${m}_PRIVATE_REQ_DEPS}) while(__deps) vp_list_pop_front(__deps d) string(TOLOWER "${d}" upper_d) if(NOT (HAVE_${d} OR HAVE_${upper_d} OR TARGET ${d} OR EXISTS ${d})) if(d MATCHES "^visp_") # TODO Remove this condition in the future and use HAVE_ variables only message(STATUS "Module ${m} disabled because ${d} dependency can't be resolved!") __vp_module_turn_off(${m}) set(has_changes ON) break() else() message(STATUS "Assume that non-module dependency is available: ${d} (for module ${m})") endif() endif() endwhile() endforeach() endwhile() # message(STATUS "List of active modules: ${VISP_MODULES_BUILD}") foreach(m ${VISP_MODULES_BUILD}) set(deps_${m} ${VISP_MODULE_${m}_REQ_DEPS}) foreach(d ${VISP_MODULE_${m}_OPT_DEPS}) if(NOT (";${deps_${m}};" MATCHES ";${d};")) if(HAVE_${d} OR TARGET ${d}) list(APPEND deps_${m} ${d}) endif() endif() endforeach() # message(STATUS "Initial deps of ${m} (w/o private deps): ${deps_${m}}") endforeach() # propagate dependencies set(has_changes ON) while(has_changes) set(has_changes OFF) foreach(m2 ${VISP_MODULES_BUILD}) # transfer deps of m2 to m foreach(m ${VISP_MODULES_BUILD}) if((NOT m STREQUAL m2) AND ";${deps_${m}};" MATCHES ";${m2};") foreach(d ${deps_${m2}}) if(NOT (";${deps_${m}};" MATCHES ";${d};")) # message(STATUS " Transfer dependency ${d} from ${m2} to ${m}") list(APPEND deps_${m} ${d}) set(has_changes ON) endif() endforeach() endif() endforeach() endforeach() endwhile() # process private deps foreach(m ${VISP_MODULES_BUILD}) foreach(d ${VISP_MODULE_${m}_PRIVATE_REQ_DEPS}) if(NOT (";${deps_${m}};" MATCHES ";${d};")) list(APPEND deps_${m} ${d}) endif() endforeach() foreach(d ${VISP_MODULE_${m}_PRIVATE_OPT_DEPS}) if(NOT (";${deps_${m}};" MATCHES ";${d};")) if(HAVE_${d} OR TARGET ${d}) list(APPEND deps_${m} ${d}) endif() endif() endforeach() endforeach() vp_list_sort(VISP_MODULES_BUILD) foreach(m ${VISP_MODULES_BUILD}) #message(STATUS "FULL deps of ${m}: ${deps_${m}}") set(VISP_MODULE_${m}_DEPS ${deps_${m}}) set(VISP_MODULE_${m}_DEPS_EXT ${deps_${m}}) vp_list_filterout(VISP_MODULE_${m}_DEPS_EXT "^visp_[^ ]+$") if(VISP_MODULE_${m}_DEPS_EXT AND VISP_MODULE_${m}_DEPS) list(REMOVE_ITEM VISP_MODULE_${m}_DEPS ${VISP_MODULE_${m}_DEPS_EXT}) endif() endforeach() # reorder dependencies foreach(m ${VISP_MODULES_BUILD}) __vp_sort_modules_by_deps(VISP_MODULE_${m}_DEPS) vp_list_sort(VISP_MODULE_${m}_DEPS_EXT) set(LINK_DEPS ${VISP_MODULE_${m}_DEPS}) set(VISP_MODULE_${m}_DEPS ${VISP_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module") set(VISP_MODULE_${m}_DEPS_EXT ${VISP_MODULE_${m}_DEPS_EXT} CACHE INTERNAL "Extra dependencies of ${m} module") set(VISP_MODULE_${m}_DEPS_TO_LINK ${LINK_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module (for linker)") # message(STATUS " module deps of ${m}: ${VISP_MODULE_${m}_DEPS}") # message(STATUS " module link deps of ${m}: ${VISP_MODULE_${m}_DEPS_TO_LINK}") # message(STATUS " extra deps of ${m}: ${VISP_MODULE_${m}_DEPS_EXT}") # message(STATUS "") endforeach() __vp_sort_modules_by_deps(VISP_MODULES_BUILD) set(VISP_MODULES_PUBLIC ${VISP_MODULES_PUBLIC} CACHE INTERNAL "List of ViSP modules marked for export") set(VISP_MODULES_BUILD ${VISP_MODULES_BUILD} CACHE INTERNAL "List of ViSP modules included into the build") set(VISP_MODULES_DISABLED_AUTO ${VISP_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of ViSP modules implicitly disabled due to dependencies") endfunction() # setup include paths for the list of passed modules macro(vp_target_include_modules target) foreach(d ${ARGN}) if(d MATCHES "^visp_" AND HAVE_${d}) if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") vp_target_include_directories(${target} "${VISP_MODULE_${d}_LOCATION}/include") # Work arround to be able to build the modules without INTERFACE_INCLUDE_DIRECTORIES # that was only introduces since CMake 2.8.12 if (CMAKE_VERSION VERSION_LESS 2.8.12) vp_target_include_directories(${target} "${VISP_MODULE_${d}_INC_DEPS}") endif() endif() elseif(EXISTS "${d}") # FS keep external deps inc set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") vp_target_include_directories(${target} "${d}") endif() endforeach() vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS) endmacro() # setup include path for ViSP headers for specified module # vp_module_include_directories() macro(vp_module_include_directories) vp_target_include_directories(${the_module} "${VISP_MODULE_${the_module}_LOCATION}/include" "${VISP_MODULE_${the_module}_LOCATION}/src" ) vp_target_include_modules(${the_module} ${VISP_MODULE_${the_module}_DEPS} ${ARGN}) endmacro() # sets header and source files for the current module # NB: all files specified as headers will be installed # Usage: # ocv_set_module_sources([HEADERS] [SOURCES] ) macro(vp_set_module_sources) vp_debug_message("vp_set_module_sources(" ${ARGN} ")") set(VISP_MODULE_${the_module}_HEADERS "") set(VISP_MODULE_${the_module}_SOURCES "") foreach(f "HEADERS" ${ARGN}) if(f STREQUAL "HEADERS" OR f STREQUAL "SOURCES") set(__filesvar "VISP_MODULE_${the_module}_${f}") else() list(APPEND ${__filesvar} "${f}") endif() endforeach() # use full paths for module to be independent from the module location vp_convert_to_full_paths(VISP_MODULE_${the_module}_HEADERS) if(${the_module} MATCHES visp_core) list(APPEND VISP_MODULE_${the_module}_HEADERS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h") list(APPEND VISP_MODULE_${the_module}_HEADERS "${VISP_INCLUDE_DIR}/visp3/visp_modules.h") endif() set(VISP_MODULE_${the_module}_HEADERS ${VISP_MODULE_${the_module}_HEADERS} CACHE INTERNAL "List of header files for ${the_module}") set(VISP_MODULE_${the_module}_SOURCES ${VISP_MODULE_${the_module}_SOURCES} CACHE INTERNAL "List of source files for ${the_module}") endmacro() # finds and sets headers and sources for the standard ViSP module # Usage: # vp_glob_module_sources() macro(vp_glob_module_sources) vp_debug_message("vp_glob_module_sources(" ${ARGN} ")") set(_argn ${ARGN}) file(GLOB_RECURSE lib_srcs "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp" ) file(GLOB_RECURSE lib_int_hdrs "${CMAKE_CURRENT_LIST_DIR}/src/*.hpp" "${CMAKE_CURRENT_LIST_DIR}/src/*.h" ) file(GLOB lib_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/visp3/*.h" "${CMAKE_CURRENT_LIST_DIR}/include/visp3/${name}/*.h" ) vp_source_group("Src" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/src" FILES ${lib_srcs} ${lib_int_hdrs}) vp_source_group("Include" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/include" FILES ${lib_hdrs}) vp_set_module_sources(${_argn} HEADERS ${lib_hdrs} SOURCES ${lib_srcs} ${lib_int_hdrs}) endmacro() # finds and copy data from a source to a destination # Usage: # vp_glob_module_data( ) macro(vp_glob_module_copy_data src dst) set(__data "") file(GLOB_RECURSE __data "${CMAKE_CURRENT_LIST_DIR}/${src}" ) foreach(__d ${__data}) file(COPY ${__d} DESTINATION "${VISP_BINARY_DIR}/${dst}" FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE ) # install if(UNIX) set(__install_dst "${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/${dst}") else() set(__install_dst "${dst}") endif() install(FILES ${__d} DESTINATION "${__install_dst}" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE ) endforeach() endmacro() # creates old headers for compat with previous releases in include/visp # Usage: # vp_create_compat_headers() macro(vp_create_compat_headers) vp_debug_message("vp_create_compat_headers(" ${ARGN} ")") set(VISP_HEADER_CONTENT_CONFIGMAKE "") foreach(h ${ARGN}) get_filename_component(__h_name_we ${h} NAME_WE) get_filename_component(__h_name ${h} NAME) set(VISP_HEADER_CONTENT_CONFIGMAKE "#ifndef __${__h_name_we}_h_\n#define __${__h_name_we}_h_\n\n#include \n\n#endif\n") set(__compat_header_dst "${VISP_INCLUDE_DIR}/visp/${__h_name_we}.h") configure_file("${VISP_SOURCE_DIR}/cmake/templates/vpHeader.h.in" ${__compat_header_dst}) endforeach() unset(__h_name_we) unset(__h_name) unset(__compat_header_dst) endmacro() # creates headers for modules include/visp3//vp.h # Usage: # vp_create_global_module_header() macro(vp_create_global_module_header module) vp_debug_message("vp_create_global_module_header(" ${module} ")") set(__name ${module}) vp_short_module_name(__name) set(__module_header_dst "${VISP_INCLUDE_DIR}/visp3/${__name}/${module}.h") set(VISP_HEADER_CONTENT_CONFIGMAKE "#ifndef __${module}_h_\n#define __${module}_h_\n") # when core, include also vpConfig.h if(__name MATCHES "core") set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n#include ") endif() # include the modules we depend on if(VISP_MODULE_${module}_REQ_DEPS) foreach(dep ${VISP_MODULE_${module}_REQ_DEPS}) vp_short_module_name(dep) set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n#include ") endforeach() endif() foreach(h ${VISP_MODULE_${module}_HEADERS}) get_filename_component(__h_name_we ${h} NAME_WE) get_filename_component(__h_name ${h} NAME) set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n#include ") endforeach() set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n\n#endif\n") configure_file("${VISP_SOURCE_DIR}/cmake/templates/vpHeader.h.in" ${__module_header_dst}) unset(__h_name_we) unset(__h_name) unset(__module_header_dst) endmacro() # creates ViSP module in current folder # creates new target, configures standard dependencies, compilers flags, install rules # Usage: # vp_create_module() # vp_create_module() macro(vp_create_module) vp_debug_message("vp_create_module(" ${ARGN} ")") set(VISP_MODULE_${the_module}_LINK_DEPS "${VISP_MODULE_${the_module}_LINK_DEPS};${ARGN}" CACHE INTERNAL "") _vp_create_module(${ARGN}) set(the_module_target ${the_module}) endmacro() macro(_vp_create_module) vp_create_compat_headers(${VISP_MODULE_${the_module}_HEADERS}) vp_create_global_module_header(${the_module}) vp_add_library(${the_module} ${VISP_MODULE_TYPE} ${VISP_MODULE_${the_module}_HEADERS} ${VISP_MODULE_${the_module}_SOURCES}) vp_target_link_libraries(${the_module} ${VISP_MODULE_${the_module}_DEPS_TO_LINK}) #vp_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${VISP_MODULE_${the_module}_DEPS_TO_LINK}) vp_target_link_libraries(${the_module} ${VISP_MODULE_${the_module}_DEPS_EXT} ${VISP_LINKER_LIBS} ${ARGN}) add_dependencies(visp_modules ${the_module}) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(${the_module} PROPERTIES FOLDER "modules") endif() set_target_properties(${the_module} PROPERTIES OUTPUT_NAME "${the_module}${VISP_DLLVERSION}" DEBUG_POSTFIX "${VISP_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} RUNTIME_OUTPUT_DIRECTORY ${BINARY_OUTPUT_PATH} ) set_property(TARGET ${the_module} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} ) # For dynamic link numbering convenions if(NOT ANDROID) # Android SDK build scripts can include only .so files into final .apk # As result we should not set version properties for Android set_target_properties(${the_module} PROPERTIES VERSION ${VISP_VERSION} SOVERSION ${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR} ) endif() if((NOT DEFINED VISP_MODULE_TYPE AND BUILD_SHARED_LIBS) OR (DEFINED VISP_MODULE_TYPE AND VISP_MODULE_TYPE STREQUAL SHARED)) set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS visp_EXPORTS) set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL visp_EXPORTS) endif() if(MSVC) if(CMAKE_CROSSCOMPILING) set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:secchk") endif() set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG") endif() vp_install_target(${the_module} EXPORT VISPModules OPTIONAL RUNTIME DESTINATION ${VISP_BIN_INSTALL_PATH} COMPONENT libs LIBRARY DESTINATION ${VISP_LIB_INSTALL_PATH} COMPONENT libs ARCHIVE DESTINATION ${VISP_LIB_INSTALL_PATH} COMPONENT dev ) foreach(m ${VISP_MODULE_${the_module}_CHILDREN} ${the_module}) # only "public" headers need to be installed if(VISP_MODULE_${m}_HEADERS AND ";${VISP_MODULES_PUBLIC};" MATCHES ";${m};") foreach(hdr ${VISP_MODULE_${m}_HEADERS}) string(REGEX REPLACE "^.*visp3/" "visp3/" hdr2 "${hdr}") if(NOT hdr2 MATCHES "visp3/${m}/private.*" AND hdr2 MATCHES "^(visp3/?.*)/[^/]+.h(..)?$" ) install(FILES ${hdr} OPTIONAL DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_MATCH_1}" COMPONENT dev) endif() endforeach() endif() endforeach() endmacro() # short command for adding simple ViSP module # see vp_add_module for argument details # Usage: # vp_define_module(module_name [INTERNAL] [REQUIRED] [] [OPTIONAL ]) macro(vp_define_module module_name) vp_debug_message("vp_define_module(" ${module_name} ${ARGN} ")") set(_argn ${ARGN}) vp_add_module(${module_name} ${_argn}) vp_glob_module_sources() vp_module_include_directories() vp_create_module() endmacro() # ensures that all passed modules are available # sets VP_DEPENDENCIES_FOUND variable to TRUE/FALSE macro(vp_check_dependencies) set(VP_DEPENDENCIES_FOUND TRUE) foreach(d ${ARGN}) if(d MATCHES "^visp_[^ ]+$" AND NOT HAVE_${d}) set(VP_DEPENDENCIES_FOUND FALSE) break() endif() endforeach() endmacro() # auxiliary macro to parse arguments of vp_add_tests commands macro(__vp_parse_test_sources tests_type) set(VISP_${tests_type}_${the_module}_SOURCES "") set(VISP_${tests_type}_${the_module}_SOURCES_EXCLUDE "") set(VISP_${tests_type}_${the_module}_DEPS "") set(VISP_${tests_type}_${the_module}_CTEST_EXCLUDE_FOLDER "") set(__file_group_name "") set(__file_group_sources "") foreach(arg "DEPENDS_ON" ${ARGN} "FILES") if(arg STREQUAL "FILES") set(__currentvar "__file_group_sources") if(__file_group_name AND __file_group_sources) source_group("${__file_group_name}" FILES ${__file_group_sources}) list(APPEND VISP_${tests_type}_${the_module}_SOURCES ${__file_group_sources}) endif() set(__file_group_name "") set(__file_group_sources "") elseif(arg STREQUAL "DEPENDS_ON") set(__currentvar "VISP_${tests_type}_${the_module}_DEPS") elseif(" ${__currentvar}" STREQUAL " __file_group_sources" AND NOT __file_group_name) # spaces to avoid CMP0054 set(__file_group_name "${arg}") elseif(arg STREQUAL "CTEST_EXCLUDE_PATH") set(__currentvar "VISP_${tests_type}_${the_module}_CTEST_EXCLUDE_FOLDER") elseif(arg STREQUAL "SOURCES_EXCLUDE") set(__currentvar "VISP_${tests_type}_${the_module}_SOURCES_EXCLUDE") else() list(APPEND ${__currentvar} "${arg}") endif() endforeach() unset(__file_group_name) unset(__file_group_sources) unset(__currentvar) endmacro() # this is a command for adding ViSP tests to the module # vp_add_tests([FILES ] # [FILES_EXCLUDE ] # [DEPENDS_ON] # [CTEST_EXCLUDE_FOLDER] ) macro(vp_add_tests) vp_debug_message("vp_add_tests(" ${ARGN} ")") set(test_path "${CMAKE_CURRENT_LIST_DIR}/test") if(BUILD_TESTS AND EXISTS "${test_path}") __vp_parse_test_sources(TEST ${ARGN}) set(__exclude_ctest "") foreach(__folder ${VISP_TEST_${the_module}_CTEST_EXCLUDE_FOLDER} ) file(GLOB_RECURSE __files "${CMAKE_CURRENT_LIST_DIR}/test/${__folder}/*.cpp") list(APPEND __exclude_ctest ${__files}) endforeach() set(__exclude_sources "") foreach(__source ${VISP_TEST_${the_module}_SOURCES_EXCLUDE} ) file(GLOB __files "${CMAKE_CURRENT_LIST_DIR}/test/${__source}") list(APPEND __exclude_sources ${__files}) endforeach() set(test_deps ${the_module} ${VISP_MODULE_${the_module}_DEPS}) foreach(d ${VISP_TEST_${the_module}_DEPS}) list(APPEND test_deps ${d}) list(APPEND test_deps ${VISP_MODULE_${d}_DEPS}) # Work arround to be able to build the modules without INTERFACE_INCLUDE_DIRECTORIES # that was only introduces since CMake 2.8.12 if(CMAKE_VERSION VERSION_LESS 2.8.12) list(APPEND test_deps "${VISP_MODULE_${__m}_INC_DEPS}") endif() endforeach() vp_check_dependencies(${test_deps}) if(VP_DEPENDENCIES_FOUND) if(NOT VISP_TEST_${the_module}_SOURCES) file(GLOB_RECURSE test_srcs "${test_path}/*.cpp") vp_source_group("Src" DIRBASE "${test_path}" FILES ${test_srcs}) set(VISP_TEST_${the_module}_SOURCES ${test_srcs}) endif() foreach(t ${VISP_TEST_${the_module}_SOURCES}) # check if source is not in exclude list list(FIND __exclude_sources ${t} __to_exclude_from_sources) if(${__to_exclude_from_sources} EQUAL -1) # Compute the name of the binary to create get_filename_component(the_target ${t} NAME_WE) # From source compile the binary and add link rules vp_add_executable(${the_target} ${t}) vp_target_include_modules(${the_target} ${test_deps}) vp_target_link_libraries(${the_target} ${test_deps} ${VISP_MODULE_${the_module}_DEPS} ${VISP_LINKER_LIBS}) # ctest only if not in the exclude list list(FIND __exclude_ctest ${t} __to_exclude_from_ctest) if(${__to_exclude_from_ctest} EQUAL -1) add_test(${the_target} ${the_target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) endif() # TODO FS add visp_test_${name} target to group all the tests add_dependencies(visp_tests ${the_target}) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(${the_target} PROPERTIES FOLDER "tests") endif() endif() endforeach() else(VP_DEPENDENCIES_FOUND) # TODO: warn about unsatisfied dependencies endif(VP_DEPENDENCIES_FOUND) endif() endmacro() # setup include paths for the list of passed modules macro(vp_include_modules) foreach(d ${ARGN}) if(d MATCHES "^visp_" AND HAVE_${d}) if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") vp_include_directories("${VISP_MODULE_${d}_LOCATION}/include") endif() elseif(EXISTS "${d}") vp_include_directories("${d}") endif() endforeach() endmacro() # same as previous but with dependencies macro(vp_include_modules_recurse) vp_include_modules(${ARGN}) foreach(d ${ARGN}) if(d MATCHES "^visp_" AND HAVE_${d} AND DEFINED VISP_MODULE_${d}_DEPS) foreach (sub ${VISP_MODULE_${d}_DEPS}) vp_include_modules(${sub}) endforeach() endif() endforeach() endmacro() # This is a command to configure files as include headers of the corresponding module. # vp_add_config_file() # # If the input config filename is suffixed by .in or .cmake the suffix is removed # in the configured file. # # Example: # vp_add_config_file(cmake/template/vpConfigModule.h.in) # creates include/visp3/module_name/vpConfigModule.h macro(vp_add_config_file) foreach(d ${ARGN}) # Removes first "/" if it exists string(FIND ${d} "/" FIRST_SEPARATOR_POS) if(${FIRST_SEPARATOR_POS} EQUAL 0) string(SUBSTRING ${d} 1 -1 d) endif() # Find start of file name string(FIND ${d} "/" LAST_SEPARATOR_POS REVERSE) if(${LAST_SEPARATOR_POS} EQUAL -1) set(START 0) else() math(EXPR START "${LAST_SEPARATOR_POS}+1") endif() # Save entire path set(FILENAME_CONFIG ${d}) # Find file name string(FIND ${d} "." EXTENSION_POS REVERSE) if(${EXTENSION_POS} EQUAL -1) string(SUBSTRING ${d} ${START} -1 FILENAME_CONFIG_SHORT) else() string(SUBSTRING ${d} ${EXTENSION_POS} -1 EXT_CONFIG_FILE) if(EXT_CONFIG_FILE MATCHES ".cmake" OR EXT_CONFIG_FILE MATCHES ".in") math(EXPR LENGTH "${EXTENSION_POS} - ${START}") string(SUBSTRING ${d} ${START} ${LENGTH} FILENAME_CONFIG_SHORT) else() string(SUBSTRING ${d} ${START} -1 FILENAME_CONFIG_SHORT) endif() endif() set(MODULE_NAME ${the_module}) if(MODULE_NAME MATCHES "^visp_") string(REGEX REPLACE "^visp_" "" MODULE_NAME "${MODULE_NAME}") endif() configure_file("${VISP_MODULE_${the_module}_LOCATION}/${FILENAME_CONFIG}" "${VISP_INCLUDE_DIR}/visp3/${MODULE_NAME}/${FILENAME_CONFIG_SHORT}") vp_create_compat_headers("${VISP_INCLUDE_DIR}/visp3/${MODULE_NAME}/${FILENAME_CONFIG_SHORT}") install(FILES "${VISP_INCLUDE_DIR}/visp3/${MODULE_NAME}/${FILENAME_CONFIG_SHORT}" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp3/${MODULE_NAME} COMPONENT dev ) endforeach() endmacro() # This is a command to add a list of paths associated to the corresponding module # to the CMAKE_MODULE_PATH global var to find specific cmake material # vp_add_cmake_module_path() # Example: # vp_add_cmake_module_path(cmake) # Appends the cmake full path to CMAKE_MODULE_PATH var. macro(vp_add_cmake_module_path) foreach(d ${ARGN}) # Removes first "/" if it exists string(FIND ${d} "/" FIRST_SEPARATOR_POS) if(${FIRST_SEPARATOR_POS} EQUAL 0) string(SUBSTRING ${d} 1 -1 d) endif() if(EXISTS "${VISP_MODULE_${the_module}_LOCATION}/${d}") list(APPEND CMAKE_MODULE_PATH "${VISP_MODULE_${the_module}_LOCATION}/${d}") endif() endforeach() endmacro() visp-3.0.0/cmake/VISPUse.cmake.in000066400000000000000000000027631264126442000164310ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # cmake PackageConfig file. # # Authors: # Fabien Spindler # ############################################################################# # Tell the compiler where to find ViSP's header files # and the third party headers we depend on include_directories(${VISP_INCLUDE_DIRS}) # Tell the compiler where to find ViSP's libraries # and the third party libraries we depend on link_libraries(${VISP_LIBRARIES}) visp-3.0.0/cmake/VISPUtils.cmake000066400000000000000000000320401264126442000163570ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Authors: # Fabien Spindler # ############################################################################# # adds include directories in such way that directories from the ViSP source tree go first function(vp_include_directories) vp_debug_message("vp_include_directories( ${ARGN} )") set(__add_before "") foreach(dir ${ARGN}) get_filename_component(__abs_dir "${dir}" ABSOLUTE) string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) # if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${VISP_BINARY_DIR}") if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") list(APPEND __add_before "${dir}") else() include_directories(AFTER SYSTEM "${dir}") endif() endforeach() include_directories(BEFORE ${__add_before}) endfunction() # adds include directories in such way that directories from the ViSP source tree go first function(vp_target_include_directories target) set(__params "") foreach(dir ${ARGN}) get_filename_component(__abs_dir "${dir}" ABSOLUTE) string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) # if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${VISP_BINARY_DIR}") if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") list(APPEND __params "${__abs_dir}") else() list(APPEND __params "${dir}") endif() endforeach() if(__params) if(CMAKE_VERSION VERSION_LESS 2.8.11) include_directories(${__params}) else() if(TARGET ${target}) target_include_directories(${target} PRIVATE ${__params}) else() set(__new_inc "${VP_TARGET_INCLUDE_DIRS_${target}};${__params}") set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") endif() endif() endif() endfunction() # clears all passed variables macro(vp_clear_vars) foreach(_var ${ARGN}) unset(${_var} CACHE) endforeach() endmacro() # print message macro(vp_debug_message) #string(REPLACE ";" " " __msg "${ARGN}") #message(STATUS "${__msg}") endmacro() # remove all matching elements from the list macro(vp_list_filterout lst regex) foreach(item ${${lst}}) if(item MATCHES "${regex}") list(REMOVE_ITEM ${lst} "${item}") endif() endforeach() endmacro() # stable & safe duplicates removal macro macro(vp_list_unique __lst) if(${__lst}) list(REMOVE_DUPLICATES ${__lst}) endif() endmacro() # safe list sorting macro macro(vp_list_sort __lst) if(${__lst}) list(SORT ${__lst}) endif() endmacro() # gets and removes the first element from list macro(vp_list_pop_front LST VAR) if(${LST}) list(GET ${LST} 0 ${VAR}) list(REMOVE_AT ${LST} 0) else() set(${VAR} "") endif() endmacro() # remove cmake ; list separator macro(vp_list_remove_separator __lst) if(${__lst}) set(__lst_reformated "") foreach(element ${${__lst}}) set(__lst_reformated "${__lst_reformated} ${element}") endforeach() set(${__lst} ${__lst_reformated}) endif() endmacro() # Provides an option that the user can optionally select. # Can accept condition to control when option is available for user. # Usage: # vp_option( # # # "help string describing the option" # "advanced list of vars separated by ;" # [IF ]) macro(VP_OPTION variable package quiet description advanced value) set(__option TRUE) set(__value ${value}) set(__condition "") set(__varname "__value") set(__p ${package}) # get the first package considered as the main package from a list: ie "Zlib;MyZlib" set(__first_package "") foreach(p ${package}) if(${p} MATCHES "^My") string(REGEX REPLACE "^My" "" p "${p}") endif() set(__first_package ${p}) break() endforeach() if(NOT ${__first_package} STREQUAL "") # get the first package name from the list #list(GET ${package} 0 ${__package}) string(TOLOWER "${__first_package}" __package_lower) string(TOUPPER "${__first_package}" __package_upper) # useful for Qt -> QT_FOUND endif() # set VISP_HAVE__FOUND="no" set(__alias_have_found_str VISP_HAVE_${__package_upper}_FOUND) set(${__alias_have_found_str} "no") foreach(arg ${ARGN}) if(arg STREQUAL "IF" OR arg STREQUAL "if") set(__varname "__condition") else() list(APPEND ${__varname} ${arg}) endif() endforeach() unset(__varname) if(__condition STREQUAL "") set(__condition 2 GREATER 1) endif() if(${__condition}) if(NOT ${__first_package} STREQUAL "") foreach(p ${package}) if("${quiet}" STREQUAL "") find_package(${p}) else() find_package(${p} ${quiet}) endif() if(${__package_upper}_FOUND OR ${__first_package}_FOUND) set(__option TRUE) break() else() set(__option FALSE) endif() endforeach() endif() if(${__option}) if(__value MATCHES ";") if(${__value}) option(${variable} "${description}" ON) else() option(${variable} "${description}" OFF) endif() elseif(DEFINED ${__value}) if(${__value}) option(${variable} "${description}" ON) else() option(${variable} "${description}" OFF) endif() else() option(${variable} "${description}" ${__value}) endif() else() unset(${variable} CACHE) endif() unset(__condition) unset(__value) else() set(${variable} OFF) endif() foreach(a ${advanced}) mark_as_advanced(${a}) endforeach() if(${variable} AND NOT ${__first_package} STREQUAL "") # set VISP_HAVE_=TRUE and VISP_HAVE__FOUND="yes" message(STATUS "${__package_lower} found") set(${__alias_have_found_str} "yes") # for ViSP-third-party.txt endif() unset(__option) unset(__alias_have) unset(__alias_have_found_str) endmacro() # Provides a macro to set a var. # Can accept condition to set var. # Usage: # vp_set( # [IF ]) macro(VP_SET variable value) set(__value ${value}) set(__condition "") set(__varname "__value") foreach(arg ${ARGN}) if(arg STREQUAL "IF" OR arg STREQUAL "if") set(__varname "__condition") else() list(APPEND ${__varname} ${arg}) endif() endforeach() unset(__varname) if(__condition STREQUAL "") set(__condition 2 GREATER 1) endif() if(${__condition}) if(__value MATCHES ";") if(${__value}) set(${variable} TRUE) else() set(${variable} FALSE) endif() elseif(DEFINED ${__value}) if(${__value}) set(${variable} TRUE) else() set(${variable} FALSE) endif() else() set(${variable} ${__value}) endif() endif() unset(__condition) unset(__value) endmacro() # short command to setup source group function(vp_source_group group) cmake_parse_arguments(SG "" "DIRBASE" "GLOB;GLOB_RECURSE;FILES" ${ARGN}) set(files "") if(SG_FILES) list(APPEND files ${SG_FILES}) endif() if(SG_GLOB) file(GLOB srcs ${SG_GLOB}) list(APPEND files ${srcs}) endif() if(SG_GLOB_RECURSE) file(GLOB_RECURSE srcs ${SG_GLOB_RECURSE}) list(APPEND files ${srcs}) endif() if(SG_DIRBASE) foreach(f ${files}) file(RELATIVE_PATH fpart "${SG_DIRBASE}" "${f}") if(fpart MATCHES "^\\.\\.") message(AUTHOR_WARNING "Can't detect subpath for source_group command: Group=${group} FILE=${f} DIRBASE=${SG_DIRBASE}") set(fpart "") else() get_filename_component(fpart "${fpart}" PATH) if(fpart) set(fpart "/${fpart}") # add '/' string(REPLACE "/" "\\" fpart "${fpart}") endif() endif() source_group("${group}${fpart}" FILES ${f}) endforeach() else() source_group(${group} FILES ${files}) endif() endfunction() # convert list of paths to full paths macro(vp_convert_to_full_paths VAR) if(${VAR}) set(__tmp "") foreach(path ${${VAR}}) get_filename_component(${VAR} "${path}" ABSOLUTE) list(APPEND __tmp "${${VAR}}") endforeach() set(${VAR} ${__tmp}) unset(__tmp) endif() endmacro() # add install command function(vp_install_target) install(TARGETS ${ARGN}) set(isPackage 0) unset(__package) unset(__target) foreach(e ${ARGN}) if(NOT DEFINED __target) set(__target "${e}") endif() if(isPackage EQUAL 1) set(__package "${e}") break() endif() if(e STREQUAL "EXPORT") set(isPackage 1) endif() endforeach() if(DEFINED __package) list(APPEND ${__package}_TARGETS ${__target}) set(${__package}_TARGETS "${${__package}_TARGETS}" CACHE INTERNAL "List of ${__package} targets") endif() if(INSTALL_CREATE_DISTRIB) if(MSVC AND NOT BUILD_SHARED_LIBS) set(__target "${ARGV0}") set(isArchive 0) set(isDst 0) unset(__dst) foreach(e ${ARGN}) if(isDst EQUAL 1) set(__dst "${e}") break() endif() if(isArchive EQUAL 1 AND e STREQUAL "DESTINATION") set(isDst 1) endif() if(e STREQUAL "ARCHIVE") set(isArchive 1) else() set(isArchive 0) endif() endforeach() # message(STATUS "Process ${__target} dst=${__dst}...") if(DEFINED __dst) if(CMAKE_VERSION VERSION_LESS 2.8.12) get_target_property(fname ${__target} LOCATION_DEBUG) if(fname MATCHES "\\.lib$") string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}") install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug) endif() get_target_property(fname ${__target} LOCATION_RELEASE) if(fname MATCHES "\\.lib$") string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}") install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release) endif() else() # CMake 2.8.12 brokes PDB support in STATIC libraries for MSVS endif() endif() endif() endif() endfunction() function(vp_target_link_libraries target) set(LINK_DEPS ${ARGN}) target_link_libraries(${target} ${LINK_DEPS}) endfunction() function(_vp_append_target_includes target) if(DEFINED VP_TARGET_INCLUDE_DIRS_${target}) target_include_directories(${target} PRIVATE ${VP_TARGET_INCLUDE_DIRS_${target}}) unset(VP_TARGET_INCLUDE_DIRS_${target} CACHE) endif() endfunction() function(vp_add_executable target) add_executable(${target} ${ARGN}) _vp_append_target_includes(${target}) endfunction() function(vp_add_library target) add_library(${target} ${ARGN}) _vp_append_target_includes(${target}) endfunction() # Macros that checks if package have been installed. # After it set vars: # _FOUND # _INCLUDE_DIRS # _LIBRARIES # VISP_HAVE_ macro(VP_CHECK_PACKAGE package) set(ALIAS ${package}) string(TOUPPER "${ALIAS}" ALIAS_UPPER) # useful for OpenGL set(ALIAS_FOUND ${ALIAS}_FOUND) set(ALIAS_UPPER_FOUND ${ALIAS_UPPER}_FOUND) set(ALIAS_INCLUDE_DIRS ${ALIAS}_INCLUDE_DIRS) set(ALIAS_LIBRARIES ${ALIAS}_LIBRARIES) set(ALIAS_VISP_HAVE VISP_HAVE_${ALIAS}) set(ALIAS_UPPER_VISP_HAVE VISP_HAVE_${ALIAS_UPPER}) find_package(${ALIAS}) if(${ALIAS_FOUND} OR ${ALIAS_UPPER_FOUND}) set(${ALIAS_VISP_HAVE} 1) set(${ALIAS_UPPER_VISP_HAVE} 1) endif() endmacro() # Macro the get the list of subdirs from the path # var: returned variable name # path: path from witch relative subdirs are macro(vp_get_relative_subdirs var path) set(ALIAS ${var}) file(GLOB_RECURSE rel_path_lst_ RELATIVE ${path} ${path}/*) set(${ALIAS} "") foreach(f ${rel_path_lst_}) get_filename_component(d ${f} PATH) list(APPEND ${ALIAS} ${d}) endforeach() list(REMOVE_DUPLICATES ${ALIAS}) endmacro() visp-3.0.0/cmake/templates/000077500000000000000000000000001264126442000155525ustar00rootroot00000000000000visp-3.0.0/cmake/templates/VISPConfig.cmake.in000066400000000000000000000303711264126442000210740ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # CMake package config file for ViSP. # # ** File generated automatically, do not modify ** # # This file will define the following CMake variables: # - VISP_LIBS : The list of all imported targets for VISP modules. # - VISP_INCLUDE_DIRS : ViSP and third-party include directories # - VISP_LIBRARIES : ViSP library to link against. Third-party libraries are # linked automatically thanks to cmake export file VISPModules.cmake # - VISP_VERSION_STRING : Full ViSP version that is build, "@VISP_VERSION@" # - VISP_VERSION_MAJOR : Major version part of VISP_VERSION: "@VISP_VERSION_MAJOR@" # - VISP_VERSION_MINOR : Minor version part of VISP_VERSION: "@VISP_VERSION_MINOR@" # - VISP_VERSION_PATCH : Patch version part of VISP_VERSION: "@VISP_VERSION_PATCH@" # # Advanced variables: # - VISP_SHARED : Use ViSP as shared library # - VISP_CONFIG_PATH : Path to this VISPConfig.cmake # - VISP_USE_FILE : File to include to use ViSP without specific cmake code # - VISP_LIB_COMPONENTS: Present VISP modules list # # Typical usage in user project: # # find_package(VISP REQUIRED) # include_directories(${VISP_INCLUDE_DIRS}) # target_link_libraries(MY_TARGET_NAME ${VISP_LIBRARIES}) # # It is also possible to build your project using VISP_USE_FILE. # # find_package(VISP) # if(VISP_FOUND) # include(${VISP_USE_FILE}) # endif() # # Or you can search for specific OpenCV modules: # # find_package(VISP REQUIRED core videoio) # # If the module is found then VISP__FOUND is set to TRUE. # # Authors: # Fabien Spindler # ############################################################################# #if(VISP_FOUND) # return() #endif() #set(VISP_FOUND TRUE) # Set the version numbers set(VISP_VERSION_STRING "@VISP_VERSION@") set(VISP_VERSION_MAJOR "@VISP_VERSION_MAJOR@") set(VISP_VERSION_MINOR "@VISP_VERSION_MINOR@") set(VISP_VERSION_PATCH "@VISP_VERSION_PATCH@") set(VISP_LIB_COMPONENTS @VISP_MODULES_CONFIGCMAKE@) # Form list of modules (components) to find if(NOT VISP_FIND_COMPONENTS) set(VISP_FIND_COMPONENTS ${VISP_LIB_COMPONENTS}) endif() # expand short module names and see if requested components exist set(VISP_FIND_COMPONENTS_ "") foreach(__vpcomponent ${VISP_FIND_COMPONENTS}) if(NOT __vpcomponent MATCHES "^visp_") set(__vpcomponent visp_${__vpcomponent}) endif() list(FIND VISP_LIB_COMPONENTS ${__vpcomponent} __vpcomponentIdx) if(__vpcomponentIdx LESS 0) #requested component is not found... if(VISP_FIND_REQUIRED) message(FATAL_ERROR "${__vpcomponent} is required but was not found") elseif(NOT VISP_FIND_QUIETLY) message(WARNING "${__vpcomponent} is required but was not found") endif() #indicate that module is NOT found string(TOUPPER "${__vpcomponent}" __vpcomponentUP) set(${__vpcomponentUP}_FOUND "${__vpcomponentUP}_FOUND-NOTFOUND") else() list(APPEND VISP_FIND_COMPONENTS_ ${__vpcomponent}) # Not using list(APPEND) here, because VISP_LIBS may not exist yet. # Also not clearing VISP_LIBS anywhere, so that multiple calls # to find_package(VISP) with different component lists add up. set(VISP_LIBS ${VISP_LIBS} "${__vpcomponent}") #indicate that module is found string(TOUPPER "${__vpcomponent}" __vpcomponentUP) set(${__vpcomponentUP}_FOUND 1) endif() endforeach() set(VISP_FIND_COMPONENTS ${VISP_FIND_COMPONENTS_}) #message("VISP_FIND_COMPONENTS: ${VISP_FIND_COMPONENTS}") # Resolve dependencies foreach(__opttype OPT DBG) set(VISP_LIBS_${__opttype} "${VISP_LIBS}") endforeach() # Some additional settings are required if ViSP is built as static libs set(VISP_SHARED @BUILD_SHARED_LIBS@) # Extract the directory where *this* file has been installed (determined at cmake run-time) set(VISP_CONFIG_PATH ${VISP_DIR} CACHE PATH "ViSPConfig.cmake path location" FORCE) mark_as_advanced(VISP_CONFIG_PATH) if(NOT WIN32) # Since this file is installed in ./${VISP_INSTALL_LIBDIR}/cmake/visp # the first "../../" are here to go to ${VISP_INSTALL_LIBDIR}, and then # VISP_INSTALL_LIBDIR_TO_PARENT goes to the parent dir "." set(VISP_INSTALL_PATH "${VISP_CONFIG_PATH}/../../@VISP_INSTALL_LIBDIR_TO_PARENT@") # Get the absolute path with no ../.. relative marks, to eliminate implicit linker warnings if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 2.8) get_filename_component(VISP_INSTALL_PATH "${VISP_INSTALL_PATH}" ABSOLUTE) else() get_filename_component(VISP_INSTALL_PATH "${VISP_INSTALL_PATH}" REALPATH) endif() endif() # Tells the user project where to find ViSP headers set(VISP_INCLUDE_DIRS "@VISP_INCLUDE_DIRS_CONFIGCMAKE@") # Tells the user project ViSP library name set(VISP_LIBRARIES ${VISP_LIBS}) # need to be improved if(POLICY CMP0024) # Fix to prevent multiple includes if(NOT TARGET visp_core) cmake_policy(PUSH) cmake_policy(SET CMP0024 OLD) # Our library dependencies (contains definitions for IMPORTED targets) include("${CMAKE_CURRENT_LIST_DIR}/VISPModules.cmake") cmake_policy(POP) endif() else() # Fix for cmake 2.8.7 to prevent multiple includes if(NOT TARGET visp_core) # Our library dependencies (contains definitions for IMPORTED targets) include("${CMAKE_CURRENT_LIST_DIR}/VISPModules.cmake") endif() endif() # where to find the USE file to be used by user project set(VISP_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/VISPUse.cmake") if(BUILD_TEST_COVERAGE) # Add build options for test coverage. Currently coverage is only supported # on gcc compiler # Because using -fprofile-arcs with shared lib can cause problems like: # hidden symbol `__bb_init_func', we add this option only for static # library build set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs") endif() #---------------------------------------------------------------------- # Remember VISP' third party libs configuration: #---------------------------------------------------------------------- SET(VISP_HAVE_X11 "@VISP_HAVE_X11@") SET(VISP_HAVE_PTHREAD "@VISP_HAVE_PTHREAD@") SET(VISP_HAVE_GTK "@VISP_HAVE_GTK@") SET(VISP_HAVE_GDI "@VISP_HAVE_GDI@") SET(VISP_HAVE_D3D9 "@VISP_HAVE_D3D9@") SET(VISP_HAVE_DISPLAY "@VISP_HAVE_DISPLAY@") SET(VISP_HAVE_GSL "@VISP_HAVE_GSL@") SET(VISP_HAVE_LAPACK_C "@VISP_HAVE_LAPACK_C@") SET(VISP_HAVE_LIBFREENECT "@VISP_HAVE_LIBFREENECT@") SET(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES "@VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES@") SET(VISP_HAVE_LIBFREENECT_OLD "@VISP_HAVE_LIBFREENECT_OLD@") SET(VISP_HAVE_LIBUSB_1 "@VISP_HAVE_LIBUSB_1@") SET(VISP_HAVE_OPENCV "@VISP_HAVE_OPENCV@") SET(VISP_HAVE_OPENCV_NONFREE "@VISP_HAVE_OPENCV_NONFREE@") SET(VISP_HAVE_OPENCV_VERSION "@VISP_HAVE_OPENCV_VERSION@") SET(VISP_HAVE_OGRE "@VISP_HAVE_OGRE@") SET(VISP_HAVE_OPENGL "@VISP_HAVE_OPENGL@") SET(VISP_HAVE_OIS "@VISP_HAVE_OIS@") SET(VISP_HAVE_COIN3D_AND_GUI "@VISP_HAVE_COIN3D_AND_GUI@") SET(VISP_HAVE_COIN3D "@VISP_HAVE_COIN3D@") SET(VISP_HAVE_QT "@VISP_HAVE_QT@") SET(VISP_HAVE_SOQT "@VISP_HAVE_SOQT@") SET(VISP_HAVE_SOWIN "@VISP_HAVE_SOWIN@") SET(VISP_HAVE_SOXT "@VISP_HAVE_SOXT@") SET(VISP_HAVE_DC1394 "@VISP_HAVE_DC1394@") SET(VISP_HAVE_CMU1394 "@VISP_HAVE_CMU1394@") SET(VISP_HAVE_V4L2 "@VISP_HAVE_V4L2@") SET(VISP_HAVE_DIRECTSHOW "@VISP_HAVE_DIRECTSHOW@") SET(VISP_HAVE_AFMA4 "@VISP_HAVE_AFMA4@") SET(VISP_HAVE_AFMA6 "@VISP_HAVE_AFMA6@") SET(VISP_HAVE_BICLOPS "@VISP_HAVE_BICLOPS@") SET(VISP_HAVE_PTU46 "@VISP_HAVE_PTU46@") SET(VISP_HAVE_VIPER650 "@VISP_HAVE_VIPER650@") SET(VISP_HAVE_VIPER850 "@VISP_HAVE_VIPER850@") SET(VISP_HAVE_PIONEER "@VISP_HAVE_PIONEER@") SET(VISP_HAVE_PARPORT "@VISP_HAVE_PARPORT@") SET(VISP_HAVE_XML2 "@VISP_HAVE_XML2@") SET(VISP_HAVE_JPEG "@VISP_HAVE_JPEG@") SET(VISP_HAVE_PNG "@VISP_HAVE_PNG@") SET(VISP_HAVE_FFMPEG "@VISP_HAVE_FFMPEG@") SET(VISP_HAVE_YARP "@VISP_HAVE_YARP@") SET(VISP_HAVE_OPENMP "@VISP_HAVE_OPENMP@") SET(VISP_HAVE_ACCESS_TO_NAS "@VISP_HAVE_ACCESS_TO_NAS@") SET(VISP_HAVE_CPP11_COMPATIBILITY "@VISP_HAVE_CPP11_COMPATIBILITY@") #---------------------------------------------------------------------- # Some useful macro to be able to build the tutorials along side ViSP #---------------------------------------------------------------------- # Create a target from the *.cpp file, link against ViSP libraries and add a dependency to ViSP library # tu ensure that the library is build before this target. macro(visp_add_target file_cpp) get_filename_component(target ${file_cpp} NAME_WE) include_directories(${VISP_INCLUDE_DIRS}) add_executable(${target} ${file_cpp}) target_link_libraries(${target} ${VISP_LIBRARIES}) endmacro() # Create a dependency to the target extracted from the *.cpp file and put the target in the solution dependency folder. macro(visp_add_dependency file_cpp dependency) get_filename_component(target ${file_cpp} NAME_WE) if(TARGET visp_${dependency}) add_dependencies(visp_${dependency} ${target}) if(ENABLE_SOLUTION_FOLDERS) set_target_properties(${target} PROPERTIES FOLDER "${dependency}") endif() endif() endmacro() # Copy the data files to the same location than the target associated to the cpp files # Since CMake 3.0.0 policy CMP0026 was introduced to disallow location property on target. # If CMake 3.0.0 is used, we use $ to get the target location if (CMAKE_VERSION VERSION_GREATER 2.8.12) macro(visp_copy_data file_cpp file_data) get_filename_component(target ${file_cpp} NAME_WE) #get_target_property(target_location ${target} LOCATION) get_filename_component(target_location "${target_location}" PATH) add_custom_command( TARGET ${target} POST_BUILD #COMMAND ${CMAKE_COMMAND} -E copy "${file_data}" "${target_location}" COMMAND ${CMAKE_COMMAND} -E copy "${file_data}" "$" ) endmacro() else() macro(visp_copy_data file_cpp file_data) get_filename_component(target ${file_cpp} NAME_WE) get_target_property(target_location ${target} LOCATION) get_filename_component(target_location "${target_location}" PATH) add_custom_command( TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${file_data}" "${target_location}" ) endmacro() endif() # Check dependencies for examples macro(visp_check_dependencies) set(VP_DEPENDENCIES_FOUND TRUE) foreach(d ${ARGN}) if(NOT TARGET ${d}) #message(WARNING "ViSP: Can't resolve dependency: ${d}") set(VP_DEPENDENCIES_FOUND FALSE) break() endif() endforeach() endmacro() # add subdirectory if dependencies are found # visp_add_subdirectory( REQUIRED_DEPS ) macro(visp_add_subdirectory subdir) set(__deps "") foreach(arg ${ARGN}) if(arg STREQUAL "REQUIRED_DEPS") set(__varname "__deps") else() list(APPEND ${__varname} ${arg}) endif() endforeach() unset(__varname) if(__deps STREQUAL "") set(VP_DEPENDENCIES_FOUND TRUE) else() visp_check_dependencies(${__deps}) endif() if(VP_DEPENDENCIES_FOUND) add_subdirectory(${subdir}) endif() endmacro() visp-3.0.0/cmake/templates/VISPConfigVersion.cmake.in000066400000000000000000000024451264126442000224430ustar00rootroot00000000000000# This is a basic version file for the Config-mode of find_package(). # It is used by write_basic_package_version_file() as input file for configure_file() # to create a version-file which can be installed along a config.cmake file. # # The created file sets PACKAGE_VERSION_EXACT if the current version string and # the requested version string are exactly the same and it sets # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. # The variable VISP_VERSION must be set before calling configure_file(). set(PACKAGE_VERSION @VISP_VERSION@) # There is a bug in CMake (at least in 2.7.0) whereby calling "find_package(FOO)" within # "find_package(FOO)" results in the version being checked in the # second version no matter if it was set. To get around this, check # "PACKAGE_FIND_VERSION" and if empty set return variables to TRUE to # make CMake happy. Not the best solution, but it does the trick. if(NOT PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE TRUE) set(PACKAGE_VERSION_EXACT TRUE) return() endif() if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() set(PACKAGE_VERSION_COMPATIBLE TRUE) if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") set(PACKAGE_VERSION_EXACT TRUE) endif() endif() visp-3.0.0/cmake/templates/ViSP-third-party.txt.in000066400000000000000000000054441264126442000220150ustar00rootroot00000000000000 ViSP third-party libraries Below you will find the list of third party libraries used to build ViSP on your computer. Mathematics: Gnu Scientific Library : ${VISP_HAVE_GSL_FOUND} Lapack/blas : ${VISP_HAVE_LAPACK_C_FOUND} Simulator: Ogre simulator : ${VISP_HAVE_OGRE_FOUND} \- Ogre3D : ${VISP_HAVE_OGRE_FOUND} \- OIS : ${VISP_HAVE_OIS_FOUND} Coin simulator : ${VISP_HAVE_COIN3D_AND_GUI_FOUND} \- Coin3D : ${VISP_HAVE_COIN3D_FOUND} \- SoWin : ${VISP_HAVE_SOWIN_FOUND} \- SoXt : ${VISP_HAVE_SOXT_FOUND} \- SoQt : ${VISP_HAVE_SOQT_FOUND} \- Qt4 : ${VISP_HAVE_QT4_FOUND} \- Qt3 : ${VISP_HAVE_QT3_FOUND} Robots Afma6 : ${VISP_HAVE_AFMA6_FOUND} Afma4 : ${VISP_HAVE_AFMA4_FOUND} Biclops : ${VISP_HAVE_BICLOPS_FOUND} Ptu46 : ${VISP_HAVE_PTU46_FOUND} Pioneer : ${VISP_HAVE_PIONEER_FOUND} Viper S650 : ${VISP_HAVE_VIPER650_FOUND} Viper S850 : ${VISP_HAVE_VIPER850_FOUND} Video devices (display) X11 : ${VISP_HAVE_X11_FOUND} GTK : ${VISP_HAVE_GTK2_FOUND} OpenCV : ${VISP_HAVE_OPENCV_FOUND} GDI : ${VISP_HAVE_GDI_FOUND} Direct3D : ${VISP_HAVE_DIRECT3D_FOUND} Framegrabbers Firewire libdc1394-2.x : ${VISP_HAVE_DC1394_FOUND} Video For Linux Two : ${VISP_HAVE_V4L2_FOUND} DirectShow : ${VISP_HAVE_DIRECTSHOW_FOUND} CMU 1394 Digital Camera SDK : ${VISP_HAVE_CMU1394_FOUND} OpenCV : ${VISP_HAVE_OPENCV_FOUND} Specific devices Yarp : ${VISP_HAVE_YARP_FOUND} Kinect : ${VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES_FOUND} \-libfreenect : ${VISP_HAVE_LIBFREENECT_FOUND} \-libusb-1.0 : ${VISP_HAVE_LIBUSB_1_FOUND} \-pthread : ${VISP_HAVE_PTHREAD_FOUND} Video and image Read/Write: FFMPEG : ${VISP_HAVE_FFMPEG_FOUND} libjpeg : ${VISP_HAVE_JPEG_FOUND} libpng : ${VISP_HAVE_PNG_FOUND} Misc: XML2 : ${VISP_HAVE_XML2_FOUND} pthread : ${VISP_HAVE_PTHREAD_FOUND} OpenMP : ${VISP_HAVE_OPENMP_FOUND} zbar : ${VISP_HAVE_ZBAR_FOUND} dmtx : ${VISP_HAVE_DMTX_FOUND} Documentation: Doxygen : ${VISP_HAVE_DOXYGEN_FOUND} ViSP built with C++11 features: ${VISP_HAVE_CPP11_COMPATIBILITY_FOUND} visp-3.0.0/cmake/templates/cmake_uninstall.cmake.in000066400000000000000000000044131264126442000223340ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # Comes from http://www.cmake.org/Wiki/CMake_FAQ to create an uninstall target # # Authors: # Fabien Spindler # ############################################################################# IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") #MESSAGE("Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") MESSAGE("There is no files to uninstall") ELSE(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) STRING(REGEX REPLACE "\n" ";" files "${files}") FOREACH(file ${files}) MESSAGE(STATUS "Uninstalling \"${file}\"") IF(EXISTS "${file}") EXEC_PROGRAM( "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) IF("${rm_retval}" STREQUAL 0) ELSE("${rm_retval}" STREQUAL 0) MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") ENDIF("${rm_retval}" STREQUAL 0) ELSE(EXISTS "${file}") MESSAGE(STATUS "File \"${file}\" does not exist.") ENDIF(EXISTS "${file}") ENDFOREACH(file) ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") visp-3.0.0/cmake/templates/resources.cfg.in000066400000000000000000000003161264126442000206520ustar00rootroot00000000000000# Resources required by the sample browser and most samples. [Essential] #Zip=@OGRE_MEDIA_DIR@/packs/SdkTrays.zip # Resource locations to be added to the default path [General] @OGRE_RESOURCES_FileSystem@ visp-3.0.0/cmake/templates/visp-config.bat.in000077500000000000000000000070541264126442000211040ustar00rootroot00000000000000@rem ############################################################################# @rem # @rem # This file is part of the ViSP software. @rem # Copyright (C) 2005 - 2015 by Inria. All rights reserved. @rem # @rem # This software is free software; you can redistribute it and/or @rem # modify it under the terms of the GNU General Public License @rem # ("GPL") version 2 as published by the Free Software Foundation. @rem # See the file LICENSE.txt at the root directory of this source @rem # distribution for additional information about the GNU GPL. @rem # @rem # For using ViSP with software that can not be combined with the GNU @rem # GPL, please contact Inria about acquiring a ViSP Professional @rem # Edition License. @rem # @rem # See http://visp.inria.fr for more information. @rem # @rem # This software was developed at: @rem # Inria Rennes - Bretagne Atlantique @rem # Campus Universitaire de Beaulieu @rem # 35042 Rennes Cedex @rem # France @rem # @rem # If you have questions regarding the use of this file, please contact @rem # Inria at visp@inria.fr @rem # @rem # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @rem # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @rem # @rem # Description: @rem # visp-config.bat script for Windows. @rem # Auto-generated from visp-config.bat.in by cmake. @rem # @rem # Authors: @rem # Fabien Spindler @rem # @rem ############################################################################# @echo off @rem Get the dirname @rem for /F %%x in ('CHDIR') do set PREFIX=%%x\.. set CURPATH=%CD /d %%~dp0% @rem echo CURPATH: %CURPATH% set PREFIX=%CURPATH%\.. set VERSION=${VISP_VERSION} set DEFS=${VISP_CONFIG_SCRIPT_DEFS} set INCLUDE="${VISP_CONFIG_SCRIPT_INC}" set OPENMP_SUPPORT=${VISP_OPENMP_SUPPORT} set LIBDIR="${VISP_CONFIG_SCRIPT_LIBDIR}" set LIBS_DEBUG=${VISP_CONFIG_SCRIPT_LIBS_DEBUG} set LIBS_OPTIMIZED=${VISP_CONFIG_SCRIPT_LIBS_OPTIMIZED} @rem Test if an argument is provided if "%1" == "" goto USAGE @rem Parse the argument list for %%a in (%*) do ( @rem echo Read arg %%a if "%%a" == "--help" ( goto USAGE ) if "%%a" == "--prefix" ( echo %PREFIX% goto END ) if "%%a" == "--def" ( echo %DEFS% goto END ) if "%%a" == "--include" ( echo %INCLUDE% goto END ) if "%%a" == "--openmp" ( echo %OPENMP_SUPPORT% goto END ) if "%%a" == "--libpath" ( echo %LIBDIR% goto END ) if "%%a" == "--libs-debug" ( echo %LIBS_DEBUG% goto END ) if "%%a" == "--libs-optimized" ( echo %LIBS_OPTIMIZED% goto END ) if "%%a" == "--version" ( echo ViSP %VERSION% Visual Servoing Platform echo. echo Copyright 2005 - 2015 Inria. All rights reserved. goto END ) if "%%a" == "--dumpversion" ( echo %VERSION% goto END ) ) :USAGE echo ViSP %VERSION% (Visual Servoing Platform) echo Copyright (C) 2005 - 2015 Inria. All rights reserved. echo. echo Usage: %0 [--prefix] [--def] [--include] [--openmp] [--libpath] echo [--libs-debug] [--libs-optimized] [--version] [--dumpversion] [--help] echo. echo --prefix Show ViSP installation prefix. echo --def Print pre-processor definitions. echo --include Print include directories. echo --openmp Indicates if OpenMP support has to be turned on/off. echo --libpath Print library directories. echo --libs-debug Print library dependencies for debug configuration. echo --libs-optimized Print library dependencies for optimized configuration. echo --dumpversion Output ViSP version information. echo --help Display this help and exit. echo. goto END :End visp-3.0.0/cmake/templates/visp-config.in000077500000000000000000000053441264126442000203370ustar00rootroot00000000000000#!/bin/sh ############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # visp-config shell script. # Auto-generated from visp-config.in by cmake. # # Authors: # Fabien Spindler # ############################################################################# relpath=`dirname $0` relpath=`(cd $relpath/..; pwd)` PREFIX=$relpath CFLAGS="${VISP_CONFIG_CFLAGS_SCRIPT}" LIBS="${VISP_CONFIG_LIBS_SCRIPT}" VERSION="${VISP_VERSION}" NO_NEWLINE_CHARACTER="${VISP_ECHO_NO_NEWLINE_CHARACTER}" NO_NEWLINE_OPTION="${VISP_ECHO_NO_NEWLINE_OPTION}" usage() { cat <= 1200 #pragma warning( disable: 4100 4127 4251 4275 4514 4668 4710 4820 ) #if _MSC_VER >= 1400 // 1400 = MSVC 8 2005 #pragma warning( disable: 4548 ) #endif #if _MSC_VER > 1500 // 1500 = MSVC 9 2008 #pragma warning( disable: 4986 ) #endif // 4100 : undocumented ("unreferenced formal parameter") // 4127 : conditional expression is constant // 4251 : 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2', ie. disable warnings related to inline functions // 4275 : non – DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' // 4514 : 'function' : unreferenced inline function has been removed // 4548 : expression before comma has no effect // 4668 : 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' // 4710 : 'function' : function not inlined // 4820 : 'bytes' bytes padding added after construct 'member_name' // 4986 : undocumented #endif #if defined _MSC_VER && (_MSC_VER == 1500) // Visual Studio 9 2008 specific stuff // Fix running 64-bit OpenMP Debug Builds compiled with Visual Studio 2008 SP1 // See discussion on https://gforge.inria.fr/forum/message.php?msg_id=149273&group_id=397 // and the proposed fix: http://www.johanseland.com/2010/08/running-64-bit-openmp-debug-builds.html # define _BIND_TO_CURRENT_OPENMP_VERSION 1 #endif #if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__) // Work arround to fix build issues that may occur with Mingw: // error: 'DBL_EPSILON' was not declared in this scope // error: 'FLT_EPSILON' was not declared in this scope # include # ifndef DBL_EPSILON # define DBL_EPSILON __DBL_EPSILON__ # endif # ifndef FLT_EPSILON # define FLT_EPSILON __FLT_EPSILON__ # endif #endif #include // ViSP major version. #define VISP_VERSION_MAJOR ${VISP_VERSION_MAJOR} // ViSP minor version. #define VISP_VERSION_MINOR ${VISP_VERSION_MINOR} // ViSP patch version. #define VISP_VERSION_PATCH ${VISP_VERSION_PATCH} // ViSP version with dots "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}". #cmakedefine VISP_VERSION ${VISP_VERSION} // ViSP version as an integer #define VP_VERSION_INT(a, b, c) (a<<16 | b<<8 | c) #define VISP_VERSION_INT VP_VERSION_INT(VISP_VERSION_MAJOR, \ VISP_VERSION_MINOR, \ VISP_VERSION_PATCH) // ViSP library is either compiled static or shared // Used to set declspec(import, export) in headers if required under Windows #cmakedefine VISP_BUILD_SHARED_LIBS // Defined if deprecated functionalities are requested to build #cmakedefine VISP_BUILD_DEPRECATED_FUNCTIONS // Defined if MSVC is the compiler #cmakedefine VISP_USE_MSVC // Defined if X11 library available. #cmakedefine VISP_HAVE_X11 // Defined if XML2 library available. #cmakedefine VISP_HAVE_XML2 // Defined if pthread library available. #cmakedefine VISP_HAVE_PTHREAD // Defined if YARP available. #cmakedefine VISP_HAVE_YARP // Defined if OpenCV available. #cmakedefine VISP_HAVE_OPENCV // Defined if OpenCV nonfree module available. Only with OpenCV < 3.0.0 #cmakedefine VISP_HAVE_OPENCV_NONFREE // Defined if OpenCV xfeatures2d module available. Only since OpenCV >= 3.0.0 #cmakedefine VISP_HAVE_OPENCV_XFEATURES2D // OpenCV version in hexadecimal (for example 2.1.0 gives 0x020100). #ifdef VISP_HAVE_OPENCV # define VISP_HAVE_OPENCV_VERSION ${VISP_HAVE_OPENCV_VERSION} #endif // Defined if GTK2 library available #cmakedefine VISP_HAVE_GTK // Defined if GDI (Graphics Device Interface) library available #cmakedefine VISP_HAVE_GDI // Defined if Direct3D9 library available #cmakedefine VISP_HAVE_D3D9 // Defined if one of the display device is available #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK) # define VISP_HAVE_DISPLAY #endif // Defined if GSL library available (-lgsl -lgslcblas). #cmakedefine VISP_HAVE_GSL // Defined if lapack/blas libraries are available (-lblas -llapack). #cmakedefine VISP_HAVE_LAPACK_C // Defined the path to the basic scenes used by the simulator #cmakedefine VISP_SCENES_DIR "${VISP_SCENES_DIR}" // Defined the path to the robot's arms 3D model used by the robot simulators #cmakedefine VISP_ROBOT_ARMS_DIR "${VISP_ROBOT_ARMS_DIR}" // Defined if Ogre3d is available. #cmakedefine VISP_HAVE_OGRE // Defined if Ogre3d plugins.cfg is available. #cmakedefine VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_HAVE_OGRE_PLUGINS_PATH}" // Defined if Ogre3d resources.cfg is available. #cmakedefine VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}" // Defined if OIS (Object Oriented Input System) library available. #cmakedefine VISP_HAVE_OIS // Defined if Coin3D and one of the GUI (SoXt, SoWin, SoQt + Qt) // libraries are available. #cmakedefine VISP_HAVE_COIN3D_AND_GUI // provided for compat with previous releases #ifdef VISP_HAVE_COIN3D_AND_GUI # define VISP_HAVE_COIN_AND_GUI #endif // Defined if Coin3D library available. #cmakedefine VISP_HAVE_COIN3D // provided for compat with previous releases #ifdef VISP_HAVE_COIN3D # define VISP_HAVE_COIN #endif // Defined if OpenGL library available. #cmakedefine VISP_HAVE_OPENGL // Defined if Qt library available (either Qt-3 or Qt-4). #cmakedefine VISP_HAVE_QT // Defined if SoQt library available. #cmakedefine VISP_HAVE_SOQT // Defined if SoWin library available. #cmakedefine VISP_HAVE_SOWIN // Defined if SoXt library available. #cmakedefine VISP_HAVE_SOXT // Defined if libjpeg library available. #cmakedefine VISP_HAVE_JPEG #ifdef VISP_HAVE_JPEG # define VISP_HAVE_LIBJPEG #endif // Defined if libpng library available. #cmakedefine VISP_HAVE_PNG #ifdef VISP_HAVE_PNG # define VISP_HAVE_LIBPNG #endif // Defined if libfreenect, libusb-1.0 and libpthread libraries available. #cmakedefine VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES // Defined if libfreenect library available. #cmakedefine VISP_HAVE_LIBFREENECT // Defined if libfreenect library in an old version package for // ubuntu 10.04 lucid is available. // This is a workaround useful to initialise vpKinect depending on the // libfreenect version //#ifdef VISP_HAVE_LIBFREENECT_OLD // Freenect::Freenect freenect; // vpKinect & kinect = freenect.createDevice(0); //#else // Freenect::Freenect freenect; // vpKinect & kinect = freenect.createDevice(0); //#endif #cmakedefine VISP_HAVE_LIBFREENECT_OLD // Defined if libusb-1.0 library available. #cmakedefine VISP_HAVE_LIBUSB_1 // Defined if ffmpeg library available. #cmakedefine VISP_HAVE_FFMPEG // Defined if raw1394 and dc1394-2.x libraries available. #cmakedefine VISP_HAVE_DC1394 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394) # define VISP_HAVE_DC1394_2 #endif // Defined if dc1394_camera_enumerate() is available in dc1394-2.x. // dc1394_camera_enumerate() was introduced after libdc1394-2.0.0-rc7. #cmakedefine VISP_HAVE_DC1394_CAMERA_ENUMERATE #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394_CAMERA_ENUMERATE) # define VISP_HAVE_DC1394_2_CAMERA_ENUMERATE #endif // Defined if dc1394_find_cameras() is available in dc1394-2.x // dc1394_find_cameras() is still present until libdc1394-2.0.0-rc7. // This function was suppress and replace by dc1394_camera_enumerate() // in more recent releases. #cmakedefine VISP_HAVE_DC1394_FIND_CAMERAS #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394_FIND_CAMERAS) # define VISP_HAVE_DC1394_2_FIND_CAMERAS #endif // Defined if CMU 1394 Digital Camera SDK available. #cmakedefine VISP_HAVE_CMU1394 // Defined if Video For Linux Two available. #cmakedefine VISP_HAVE_V4L2 // Defined if DirectShow library is available (only under Windows). #cmakedefine VISP_HAVE_DIRECTSHOW // Defined if Irisa's Afma4 robot available. #cmakedefine VISP_HAVE_AFMA4 // Defined if Irisa's Afma6 robot available. #cmakedefine VISP_HAVE_AFMA6 // Defined if Biclops pan-tilt head available. #cmakedefine VISP_HAVE_BICLOPS #cmakedefine VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION // Defined if Irisa's Ptu-46 pan-tilt head available. #cmakedefine VISP_HAVE_PTU46 // Defined if Irisa's Viper S650 robot available. #cmakedefine VISP_HAVE_VIPER650 // Defined if Irisa's Viper S850 robot available. #cmakedefine VISP_HAVE_VIPER850 // Defined if the Aria library and (pthread, rt, dl libraries under Unix) is found. // These libraries are used to control Pioneer mobile robots. #cmakedefine VISP_HAVE_PIONEER // Defined if linux/parport.h is available for parallel port usage. #cmakedefine VISP_HAVE_PARPORT // Defined if libzbar is available for bar code detection #cmakedefine VISP_HAVE_ZBAR // Defined if libdmtx is available for bar code detection #cmakedefine VISP_HAVE_DMTX // Defined if Inria's NAS server hosting /udd/ is available // Used for the moment in vpAfma6 class to check if config files are // available in /udd/fspindle/robot/Afma6/current/include/ #cmakedefine VISP_HAVE_ACCESS_TO_NAS // Defined if Doxygen documentation tool is found #cmakedefine VISP_HAVE_DOXYGEN // Defined if we want to compute interaction matrices by combining // other interaction matrices #cmakedefine VISP_MOMENTS_COMBINE_MATRICES //Defined if we want to use openmp #cmakedefine VISP_HAVE_OPENMP //Defined if we want to use c++ 11 #cmakedefine VISP_HAVE_CPP11_COMPATIBILITY // Defined if isnan macro is available #cmakedefine VISP_HAVE_FUNC_ISNAN // Defined if std::isnan function is available #cmakedefine VISP_HAVE_FUNC_STD_ISNAN // Defined if _isnan (Microsoft version) is available #cmakedefine VISP_HAVE_FUNC__ISNAN // Defined if isinf macro is available #cmakedefine VISP_HAVE_FUNC_ISINF // Defined if std::isinf function is available #cmakedefine VISP_HAVE_FUNC_STD_ISINF // Defined if _finite (Microsoft version) function is available #cmakedefine VISP_HAVE_FUNC__FINITE // Defined if round function is available #cmakedefine VISP_HAVE_FUNC_ROUND // Defined if std::round function is available #cmakedefine VISP_HAVE_FUNC_STD_ROUND // Handle portable symbol export. // Defining manually which symbol should be exported is required // under Windows whether MinGW or MSVC is used. // // The headers then have to be able to work in two different modes: // - dllexport when one is building the library, // - dllimport for clients using the library. // // On Linux, set the visibility accordingly. If C++ symbol visibility // is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility # if defined(_WIN32) || defined(__CYGWIN__) // On Microsoft Windows, use dllimport and dllexport to tag symbols. # define VISP_DLLIMPORT __declspec(dllimport) # define VISP_DLLEXPORT __declspec(dllexport) # define VISP_DLLLOCAL # else // On Linux, for GCC >= 4, tag symbols using GCC extension. # if __GNUC__ >= 4 # define VISP_DLLIMPORT __attribute__ ((visibility("default"))) # define VISP_DLLEXPORT __attribute__ ((visibility("default"))) # define VISP_DLLLOCAL __attribute__ ((visibility("hidden"))) # else // Otherwise (GCC < 4 or another compiler is used), export everything. # define VISP_DLLIMPORT # define VISP_DLLEXPORT # define VISP_DLLLOCAL # endif // __GNUC__ >= 4 # endif // defined(_WIN32) || defined(__CYGWIN__) // Under Windows, for shared libraries (DLL) we need to define export on // compilation or import on use (like a third party project). // We exploit here the fact that cmake auto set xxx_EXPORTS (with S) on // compilation. #if defined(VISP_BUILD_SHARED_LIBS) // Depending on whether one is building or using the // library define VISP_EXPORT to import or export. # ifdef visp_EXPORTS # define VISP_EXPORT VISP_DLLEXPORT # else # define VISP_EXPORT VISP_DLLIMPORT # endif # define VISP_LOCAL VISP_DLLLOCAL #else // If one is using the library statically, get rid of // extra information. # define VISP_EXPORT # define VISP_LOCAL #endif // Add the material to produce a warning when deprecated functions are used #ifndef vp_deprecated # if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX # define vp_deprecated __attribute__((deprecated)) # else # define vp_deprecated __declspec(deprecated) # endif #endif #endif visp-3.0.0/cmake/templates/vpHeader.h.in000066400000000000000000000001451264126442000200660ustar00rootroot00000000000000/* * ** File generated automatically, do not modify ** * */ @VISP_HEADER_CONTENT_CONFIGMAKE@ visp-3.0.0/demo/000077500000000000000000000000001264126442000134205ustar00rootroot00000000000000visp-3.0.0/demo/CMakeLists.txt000066400000000000000000000045361264126442000161700ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP overall configuration file. # # Authors: # Nicolas Melchior # ############################################################################# project(ViSP-demo) cmake_minimum_required(VERSION 2.6) find_package(VISP) if(MSVC) if(NOT VISP_SHARED) foreach(flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) if(${flag_var} MATCHES "/MD") string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") endif() if(${flag_var} MATCHES "/MDd") string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") endif() endforeach(flag_var) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib") endif() endif() visp_add_subdirectory(wireframe-simulator REQUIRED_DEPS visp_core visp_robot visp_vs visp_io visp_gui) visp-3.0.0/demo/wireframe-simulator/000077500000000000000000000000001264126442000174165ustar00rootroot00000000000000visp-3.0.0/demo/wireframe-simulator/CMakeLists.txt000066400000000000000000000042761264126442000221670ustar00rootroot00000000000000############################################################################# # # This file is part of the ViSP software. # Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. # See the file LICENSE.txt at the root directory of this source # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU # GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # # See http://visp.inria.fr for more information. # # This software was developed at: # Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France # # If you have questions regarding the use of this file, please contact # Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: # ViSP overall configuration file. # # Authors: # Fabien Spindler # ############################################################################# project(demo-wireframe-simulator) cmake_minimum_required(VERSION 2.8) find_package(VISP REQUIRED visp_core visp_robot visp_vs visp_io visp_gui) # SOURCE variable corresponds to the list of all the sources to build binaries. # The generate binary comes by removing the .cpp extension to # the source name. # # If you want to add/remove a source, modify here set(demo_cpp servoSimu4Points.cpp servoSimuCylinder.cpp servoSimuSphere.cpp ) foreach(cpp ${demo_cpp}) visp_add_target(${cpp}) if(COMMAND visp_add_dependency) visp_add_dependency(${cpp} "demos") endif() endforeach() # Add test # To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH # environment variable to the ViSP test sequences location. # To get these sequence download ViSP-images.tar.gz from # http://www.irisa.fr/lagadic/visp/visp.html add_test(servoSimu4Points servoSimu4Points -d) add_test(servoSimuCylinder servoSimuCylinder -d) add_test(servoSimuSphere servoSimuSphere -d) visp-3.0.0/demo/wireframe-simulator/servoSimu4Points.cpp000066400000000000000000000332701264126442000234040ustar00rootroot00000000000000/**************************************************************************** * * This file is part of the ViSP software. * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. * See the file LICENSE.txt at the root directory of this source * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * * See http://visp.inria.fr for more information. * * This software was developed at: * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France * * If you have questions regarding the use of this file, please contact * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * Description: * Demonstration of the wireframe simulator with a simple visual servoing * * Authors: * Nicolas Melchior * *****************************************************************************/ /*! \example servoSimu4Points.cpp Demonstration of the wireframe simulator with a simple visual servoing. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define GETOPTARGS "dh" #ifdef VISP_HAVE_DISPLAY void usage(const char *name, std::string ipath, const char *badparam); bool getOptions(int argc, const char **argv, std::string &ipath, bool &display); /*! Print the program options. \param name : Program name. \param ipath : Input image path. \param badparam : Bad parameter name. */ void usage(const char *name, std::string ipath, const char *badparam) { fprintf(stdout, "\n\ Demonstration of the wireframe simulator with a simple visual servoing.\n\ \n\ The visual servoing consists in bringing the camera at a desired \n\ position from the object.\n\ \n\ The visual features used to compute the pose of the camera and \n\ thus the control law are four points.\n\ \n\ This demonstration explains also how to move the object around a world\n\ reference frame. Here, the movement is a rotation around the x and y axis\n\ at a given distance from the world frame. In fact the object trajectory\n\ is on a sphere whose center is the origin of the world frame.\n\ \n\ SYNOPSIS\n\ %s [-d] [-h]\n", name); fprintf(stdout, "\n\ OPTIONS: Default\n\ -i %s\n\ Set mire.pgm image input path.\n\ From this path read \"ViSP-images/mire/mire.pgm\" video.\n\ Setting the VISP_INPUT_IMAGE_PATH environment variable \n\ produces the same behaviour than using this option.\n\ \n\ -d \n\ Turn off the display.\n\ \n\ -h\n\ Print the help.\n", ipath.c_str()); if (badparam) fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); } /*! Set the program options. \param argc : Command line number of parameters. \param argv : Array of command line parameters. \param ipath : Input image path. \param display : Display activation. \return false if the program has to be stopped, true otherwise. */ bool getOptions(int argc, const char **argv, std::string &ipath, bool &display) { const char *optarg_; int c; while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { switch (c) { case 'i': ipath = optarg_; break; case 'd': display = false; break; case 'h': usage(argv[0],ipath, NULL); return false; break; default: usage(argv[0],ipath, optarg_); return false; break; } } if ((c == 1) || (c == -1)) { // standalone param or error usage(argv[0], ipath, NULL); std::cerr << "ERROR: " << std::endl; std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; return false; } return true; } int main(int argc, const char ** argv) { try { bool opt_display = true; std::string opt_ipath; std::string env_ipath; std::string ipath ; std::string filename; // Read the command line options if (getOptions(argc, argv, opt_ipath, opt_display) == false) { exit (-1); } vpImage Iint(480,640,255); vpImage Iext1(480,640,255); vpImage Iext2(480,640,255); #if defined VISP_HAVE_X11 vpDisplayX display[3]; #elif defined VISP_HAVE_OPENCV vpDisplayOpenCV display[3]; #elif defined VISP_HAVE_GDI vpDisplayGDI display[3]; #elif defined VISP_HAVE_D3D9 vpDisplayD3D display[3]; #elif defined VISP_HAVE_GTK vpDisplayGTK display[3]; #endif if (opt_display) { // Display size is automatically defined by the image (I) size display[0].init(Iint, 100, 100,"The internal view") ; display[1].init(Iext1, 100, 100,"The first external view") ; display[2].init(Iext2, 100, 100,"The second external view") ; vpDisplay::setWindowPosition (Iint, 0, 0); vpDisplay::setWindowPosition (Iext1, 700, 0); vpDisplay::setWindowPosition (Iext2, 0, 550); vpDisplay::display(Iint); vpDisplay::flush(Iint); vpDisplay::display(Iext1); vpDisplay::flush(Iext1); vpDisplay::display(Iext2); vpDisplay::flush(Iext2); } vpServo task; vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); // Since the task gain lambda is very high, we need to increase default max velocities robot.setMaxTranslationVelocity(10); robot.setMaxRotationVelocity(vpMath::rad(180)); // Set initial position of the object in the camera frame vpHomogeneousMatrix cMo(0,0.1,2.0,vpMath::rad(35),vpMath::rad(25),0); // Set desired position of the object in the camera frame vpHomogeneousMatrix cdMo(0.0,0.0,1.0,vpMath::rad(0),vpMath::rad(0),vpMath::rad(0)); // Set initial position of the object in the world frame vpHomogeneousMatrix wMo(0.0,0.0,0.2,0,0,0); // Position of the camera in the world frame vpHomogeneousMatrix wMc; wMc = wMo * cMo.inverse(); //The four point used as visual features vpPoint point[4] ; point[0].setWorldCoordinates(-0.1,-0.1,0) ; point[3].setWorldCoordinates(-0.1,0.1,0) ; point[2].setWorldCoordinates(0.1,0.1,0) ; point[1].setWorldCoordinates(0.1,-0.1,0) ; // Projection of the points for (int i = 0 ; i < 4 ; i++) point[i].track(cMo); //Set the current visual feature vpFeaturePoint p[4]; for (int i = 0 ; i < 4 ; i++) vpFeatureBuilder::create(p[i], point[i]); // Projection of the points for (int i = 0 ; i < 4 ; i++) point[i].track(cdMo); vpFeaturePoint pd[4]; for (int i = 0 ; i < 4 ; i++) vpFeatureBuilder::create(pd[i], point[i]); task.setServo(vpServo::EYEINHAND_L_cVe_eJe); task.setInteractionMatrixType(vpServo::DESIRED); vpHomogeneousMatrix cMe; // Identity vpVelocityTwistMatrix cVe(cMe); task.set_cVe(cVe); vpMatrix eJe; robot.get_eJe(eJe); task.set_eJe(eJe); for (int i = 0 ; i < 4 ; i++) task.addFeature(p[i],pd[i]) ; task.setLambda(10); std::list list; vpImageSimulator imsim; vpColVector X[4]; for (int i = 0; i < 4; i++) X[i].resize(3); X[0][0] = -0.2; X[0][1] = -0.2; X[0][2] = 0; X[1][0] = 0.2; X[1][1] = -0.2; X[1][2] = 0; X[2][0] = 0.2; X[2][1] = 0.2; X[2][2] = 0; X[3][0] = -0.2; X[3][1] = 0.2; X[3][2] = 0; // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value env_ipath = vpIoTools::getViSPImagesDataPath(); if (! env_ipath.empty()) ipath = env_ipath; if (!opt_ipath.empty()) ipath = opt_ipath; filename = vpIoTools::createFilePath(ipath, "ViSP-images/mire/mire.pgm"); imsim.init(filename.c_str(), X); list.push_back(imsim); vpWireFrameSimulator sim; // Set the scene sim.initScene(vpWireFrameSimulator::PLATE, vpWireFrameSimulator::D_STANDARD,list); // Initialize simulator frames sim.set_fMo( wMo ); // Position of the object in the world reference frame sim.setCameraPositionRelObj(cMo) ; // initial position of the camera sim.setDesiredCameraPosition(cdMo); // desired position of the camera // Set the External camera position vpHomogeneousMatrix camMf(vpHomogeneousMatrix(0.0,0,3.5,vpMath::rad(0),vpMath::rad(30),0)); sim.setExternalCameraPosition(camMf); //Computes the position of a camera which is fixed in the object frame vpHomogeneousMatrix camoMf(0,0.0,1.5,0,vpMath::rad(140),0); camoMf = camoMf*(sim.get_fMo().inverse()); //Set the parameters of the cameras (internal and external) vpCameraParameters camera(1000,1000,320,240); sim.setInternalCameraParameters(camera); sim.setExternalCameraParameters(camera); int stop = 10; if (opt_display) { stop = 2500; //Get the internal and external views sim.getInternalImage(Iint); sim.getExternalImage(Iext1); sim.getExternalImage(Iext2, camoMf); //Display the object frame (current and desired position) vpDisplay::displayFrame(Iint,cMo,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iint,cdMo,camera,0.2,vpColor::none); //Display the object frame the world reference frame and the camera frame vpDisplay::displayFrame(Iext1,camMf*sim.get_fMo()*cMo.inverse(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,camMf*sim.get_fMo(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,camMf,camera,0.2,vpColor::none); //Display the world reference frame and the object frame vpDisplay::displayFrame(Iext2,camoMf,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext2,camoMf*sim.get_fMo(),camera,0.05,vpColor::none); vpDisplay::flush(Iint); vpDisplay::flush(Iext1); vpDisplay::flush(Iext2); std::cout << "Click on a display" << std::endl; while (!vpDisplay::getClick(Iint,false) && !vpDisplay::getClick(Iext1,false) && !vpDisplay::getClick(Iext2,false)){}; } robot.setPosition( wMc ); //Print the task task.print() ; int iter = 0; vpColVector v ; while(iter++ < stop) { if (opt_display) { vpDisplay::display(Iint) ; vpDisplay::display(Iext1) ; vpDisplay::display(Iext2) ; } double t = vpTime::measureTimeMs(); robot.get_eJe(eJe) ; task.set_eJe(eJe) ; wMc = robot.getPosition() ; cMo = wMc.inverse() * wMo; for (int i = 0 ; i < 4 ; i++) { point[i].track(cMo) ; vpFeatureBuilder::create(p[i],point[i]) ; } v = task.computeControlLaw() ; robot.setVelocity(vpRobot::CAMERA_FRAME, v) ; //Compute the movement of the object around the world reference frame. vpHomogeneousMatrix a(0, 0, 0.2, 0, 0, 0); vpHomogeneousMatrix b(0, 0, 0, vpMath::rad(1.5*iter), 0, 0); vpHomogeneousMatrix c(0, 0, 0, 0, vpMath::rad(2.5*iter), 0); // Move the object in the world frame wMo = b*c*a; sim.set_fMo( wMo ); //Move the object in the simulator sim.setCameraPositionRelObj(cMo); //Compute the position of the external view which is fixed in the object frame camoMf.buildFrom(0,0.0,1.5,0,vpMath::rad(150),0); camoMf = camoMf*(sim.get_fMo().inverse()); if (opt_display) { //Get the internal and external views sim.getInternalImage(Iint); sim.getExternalImage(Iext1); sim.getExternalImage(Iext2,camoMf); //Display the object frame (current and desired position) vpDisplay::displayFrame(Iint,cMo,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iint,cdMo,camera,0.2,vpColor::none); //Display the camera frame, the object frame the world reference frame vpDisplay::displayFrame(Iext1,sim.getExternalCameraPosition()*sim.get_fMo()*cMo.inverse(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,sim.getExternalCameraPosition()*sim.get_fMo(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,sim.getExternalCameraPosition(),camera,0.2,vpColor::none); //Display the world reference frame and the object frame vpDisplay::displayFrame(Iext2,camoMf,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext2,camoMf*sim.get_fMo(),camera,0.05,vpColor::none); vpDisplay::flush(Iint); vpDisplay::flush(Iext1); vpDisplay::flush(Iext2); } vpTime::wait(t, sampling_time * 1000); // Wait 40 ms std::cout << "|| s - s* || = " << ( task.getError() ).sumSquare() < #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define GETOPTARGS "dh" #ifdef VISP_HAVE_DISPLAY void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &display); /*! Print the program options. \param name : Program name. \param badparam : Bad parameter name. */ void usage(const char *name, const char *badparam) { fprintf(stdout, "\n\ Demonstration of the wireframe simulator with a simple visual servoing.\n\ \n\ The visual servoing consists in bringing the camera at a desired position\n\ from the object.\n\ \n\ The visual features used to compute the pose of the camera and \n\ thus the control law are two lines. These features are computed thanks \n\ to the equation of a cylinder.\n\ \n\ This demonstration explains also how to move the object around a world \n\ reference frame. Here, the movment is a rotation around the x and y axis \n\ at a given distance from the world frame. In fact the object trajectory \n\ is on a sphere whose center is the origin of the world frame.\n\ \n\ SYNOPSIS\n\ %s [-d] [-h]\n", name); fprintf(stdout, "\n\ OPTIONS: \n\ -d \n\ Turn off the display.\n\ \n\ -h\n\ Print the help.\n"); if (badparam) fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); } /*! Set the program options. \param argc : Command line number of parameters. \param argv : Array of command line parameters. \param display : Display activation. \return false if the program has to be stopped, true otherwise. */ bool getOptions(int argc, const char **argv, bool &display) { const char *optarg_; int c; while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { switch (c) { case 'd': display = false; break; case 'h': usage(argv[0], NULL); return false; break; default: usage(argv[0], optarg_); return false; break; } } if ((c == 1) || (c == -1)) { // standalone param or error usage(argv[0], NULL); std::cerr << "ERROR: " << std::endl; std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; return false; } return true; } int main(int argc, const char ** argv) { try { bool opt_display = true; // Read the command line options if (getOptions(argc, argv, opt_display) == false) { exit (-1); } vpImage Iint(480,640,255); vpImage Iext(480,640,255); #if defined VISP_HAVE_X11 vpDisplayX display[2]; #elif defined VISP_HAVE_OPENCV vpDisplayOpenCV display[2]; #elif defined VISP_HAVE_GDI vpDisplayGDI display[2]; #elif defined VISP_HAVE_D3D9 vpDisplayD3D display[2]; #elif defined VISP_HAVE_GTK vpDisplayGTK display[2]; #endif if (opt_display) { // Display size is automatically defined by the image (I) size display[0].init(Iint, 100, 100,"The internal view") ; display[1].init(Iext, 100, 100,"The first external view") ; vpDisplay::setWindowPosition (Iint, 0, 0); vpDisplay::setWindowPosition (Iext, 700, 0); vpDisplay::display(Iint); vpDisplay::flush(Iint); vpDisplay::display(Iext); vpDisplay::flush(Iext); } vpServo task; vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); // Set initial position of the object in the camera frame vpHomogeneousMatrix cMo(0,0.1,0.3,vpMath::rad(35),vpMath::rad(25),vpMath::rad(75)); // Set desired position of the object in the camera frame vpHomogeneousMatrix cdMo(0.0,0.0,0.5,vpMath::rad(90),vpMath::rad(0),vpMath::rad(0)); // Set initial position of the object in the world frame vpHomogeneousMatrix wMo(0.0,0.0,0,0,0,0); // Position of the camera in the world frame vpHomogeneousMatrix wMc; wMc = wMo * cMo.inverse(); // Create a cylinder vpCylinder cylinder(0,0,1,0,0,0,0.1); // Projection of the cylinder cylinder.track(cMo); //Set the current visual feature vpFeatureLine l[2]; vpFeatureBuilder::create(l[0], cylinder, vpCylinder::line1); vpFeatureBuilder::create(l[1], cylinder, vpCylinder::line2); // Projection of the cylinder cylinder.track(cdMo); vpFeatureLine ld[2]; vpFeatureBuilder::create(ld[0], cylinder, vpCylinder::line1); vpFeatureBuilder::create(ld[1], cylinder, vpCylinder::line2); task.setServo(vpServo::EYEINHAND_L_cVe_eJe); task.setInteractionMatrixType(vpServo::DESIRED); vpHomogeneousMatrix cMe; vpVelocityTwistMatrix cVe(cMe); task.set_cVe(cVe); vpMatrix eJe; robot.get_eJe(eJe); task.set_eJe(eJe); for (int i = 0 ; i < 2 ; i++) task.addFeature(l[i],ld[i]) ; task.setLambda(1); vpWireFrameSimulator sim; // Set the scene sim.initScene(vpWireFrameSimulator::CYLINDER, vpWireFrameSimulator::D_STANDARD); // Initialize simulator frames sim.set_fMo( wMo ); // Position of the object in the world reference frame sim.setCameraPositionRelObj(cMo) ; // initial position of the camera sim.setDesiredCameraPosition(cdMo); // desired position of the camera // Set the External camera position vpHomogeneousMatrix camMf(vpHomogeneousMatrix(0.0,0,3.5,vpMath::rad(0),vpMath::rad(30),0)); sim.setExternalCameraPosition(camMf); // Set the parameters of the cameras (internal and external) vpCameraParameters camera(1000,1000,320,240); sim.setInternalCameraParameters(camera); sim.setExternalCameraParameters(camera); int stop = 10; if (opt_display) { stop = 2500; //Get the internal and external views sim.getInternalImage(Iint); sim.getExternalImage(Iext); //Display the object frame (current and desired position) vpDisplay::displayFrame(Iint,cMo,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iint,cdMo,camera,0.2,vpColor::none); //Display the object frame the world reference frame and the camera frame vpDisplay::displayFrame(Iext,camMf*sim.get_fMo()*cMo.inverse(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext,camMf*sim.get_fMo(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext,camMf,camera,0.2,vpColor::none); vpDisplay::flush(Iint); vpDisplay::flush(Iext); std::cout << "Click on a display" << std::endl; while (!vpDisplay::getClick(Iint,false) && !vpDisplay::getClick(Iext,false)){}; } robot.setPosition( wMc ); //Print the task task.print(); int iter = 0; vpColVector v ; //Set the secondary task parameters vpColVector e1(6) ; e1 = 0 ; vpColVector e2(6) ; e2 = 0 ; vpColVector proj_e1 ; vpColVector proj_e2 ; iter = 0; double rapport = 0; double vitesse = 0.3; int tempo = 600; while(iter++ < stop) { if (opt_display) { vpDisplay::display(Iint) ; vpDisplay::display(Iext) ; } double t = vpTime::measureTimeMs(); robot.get_eJe(eJe) ; task.set_eJe(eJe) ; wMc = robot.getPosition(); cMo = wMc.inverse() * wMo; cylinder.track(cMo) ; vpFeatureBuilder::create(l[0], cylinder, vpCylinder::line1); vpFeatureBuilder::create(l[1], cylinder, vpCylinder::line2); v = task.computeControlLaw() ; //Compute the velocity with the secondary task if ( iter%tempo < 200 && iter%tempo >= 0) { e2 = 0; e1[0] = -fabs(vitesse) ; proj_e1 = task.secondaryTask(e1); rapport = -vitesse/proj_e1[0]; proj_e1 *= rapport ; v += proj_e1 ; } if ( iter%tempo < 300 && iter%tempo >= 200) { e1 = 0; e2[1] = -fabs(vitesse) ; proj_e2 = task.secondaryTask(e2); rapport = -vitesse/proj_e2[1]; proj_e2 *= rapport ; v += proj_e2 ; } if ( iter%tempo < 500 && iter%tempo >= 300) { e2 = 0; e1[0] = -fabs(vitesse) ; proj_e1 = task.secondaryTask(e1); rapport = vitesse/proj_e1[0]; proj_e1 *= rapport ; v += proj_e1 ; } if ( iter%tempo < 600 && iter%tempo >= 500) { e1 = 0; e2[1] = -fabs(vitesse) ; proj_e2 = task.secondaryTask(e2); rapport = vitesse/proj_e2[1]; proj_e2 *= rapport ; v += proj_e2 ; } robot.setVelocity(vpRobot::CAMERA_FRAME, v) ; // Update the simulator frames sim.set_fMo( wMo ); // This line is not really requested since the object doesn't move sim.setCameraPositionRelObj( cMo ); if (opt_display) { //Get the internal and external views sim.getInternalImage(Iint); sim.getExternalImage(Iext); //Display the object frame (current and desired position) vpDisplay::displayFrame(Iint,cMo,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iint,cdMo,camera,0.2,vpColor::none); //Display the object frame the world reference frame and the camera frame vpDisplay::displayFrame(Iext,sim.getExternalCameraPosition()*sim.get_fMo()*cMo.inverse(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext,sim.getExternalCameraPosition()*sim.get_fMo(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext,sim.getExternalCameraPosition(),camera,0.2,vpColor::none);; vpDisplay::flush(Iint); vpDisplay::flush(Iext); } vpTime::wait(t, sampling_time * 1000); // Wait 40 ms std::cout << "|| s - s* || = " << (task.getError() ).sumSquare() < #include // std::fabs #include // numeric_limits #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define GETOPTARGS "dh" #ifdef VISP_HAVE_DISPLAY void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, bool &display); void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s); void computeInteractionMatrix(const vpGenericFeature &s,const vpSphere &sphere, vpMatrix &L); /*! Print the program options. \param name : Program name. \param badparam : Bad parameter name. */ void usage(const char *name, const char *badparam) { fprintf(stdout, "\n\ Demonstration of the wireframe simulator with a simple visual servoing.\n\ \n\ The visual servoing consists in bringing the camera at a desired position from the object.\n\ \n\ The visual features used to compute the pose of the camera and thus the control law are special moments computed with the sphere's parameters.\n\ \n\ SYNOPSIS\n\ %s [-d] [-h]\n", name); fprintf(stdout, "\n\ OPTIONS: Default\n\ -d \n\ Turn off the display.\n\ \n\ -h\n\ Print the help.\n"); if (badparam) fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); } /*! Set the program options. \param argc : Command line number of parameters. \param argv : Array of command line parameters. \param display : Display activation. \return false if the program has to be stopped, true otherwise. */ bool getOptions(int argc, const char **argv, bool &display) { const char *optarg_; int c; while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { switch (c) { case 'd': display = false; break; case 'h': usage(argv[0], NULL); return false; break; default: usage(argv[0], optarg_); return false; break; } } if ((c == 1) || (c == -1)) { // standalone param or error usage(argv[0], NULL); std::cerr << "ERROR: " << std::endl; std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; return false; } return true; } /* Computes the virtual visual features corresponding to the sphere and stores it in the generic feature. The visual feature vector is computed thanks to the following formula : s = {sx, sy, sz} sx = gx*h2/(sqrt(h2+1) sx = gy*h2/(sqrt(h2+1) sz = sqrt(h2+1) with gx and gy the center of gravity of the ellipse, with h2 = (gx²+gy²)/(4*n20*gy²+4*n02*gx²-8n11gxgy) with n20,n02,n11 the second order moments of the sphere */ void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s) { double gx = sphere.get_x(); double gy = sphere.get_y(); double m02 = sphere.get_mu02(); double m20 = sphere.get_mu20(); double m11 = sphere.get_mu11(); double h2; //if (gx != 0 || gy != 0) if (std::fabs(gx) > std::numeric_limits::epsilon() || std::fabs(gy) > std::numeric_limits::epsilon()) h2 = (vpMath::sqr(gx)+vpMath::sqr(gy))/(4*m20*vpMath::sqr(gy)+4*m02*vpMath::sqr(gx)-8*m11*gx*gy); else h2 = 1/(4*m20); double sx = gx*h2/(sqrt(h2+1)); double sy = gy*h2/(sqrt(h2+1)); double sz = sqrt(h2+1); //(h2-(vpMath::sqr(sx)+vpMath::sqr(sy)-1))/(2*sqrt(h2)); s.set_s(sx,sy,sz); } /* Computes the interaction matrix such as L = [-1/R*I3 [s]x] with R the radius of the sphere with I3 the 3x3 identity matrix with [s]x the skew matrix related to s */ void computeInteractionMatrix(const vpGenericFeature &s,const vpSphere &sphere, vpMatrix &L) { L = 0; L[0][0] = -1/sphere.getR(); L[1][1] = -1/sphere.getR(); L[2][2] = -1/sphere.getR(); double s0,s1,s2; s.get_s(s0,s1,s2); vpTranslationVector c(s0,s1,s2); vpMatrix sk; sk = c.skew(); for(unsigned int i = 0; i < 3; i++) for(unsigned int j = 0; j < 3; j++) L[i][j+3] = sk[i][j]; } int main(int argc, const char ** argv) { try { bool opt_display = true; // Read the command line options if (getOptions(argc, argv, opt_display) == false) { exit (-1); } vpImage Iint(480,640,255); vpImage Iext1(480,640,255); vpImage Iext2(480,640,255); #if defined VISP_HAVE_X11 vpDisplayX display[3]; #elif defined VISP_HAVE_OPENCV vpDisplayOpenCV display[3]; #elif defined VISP_HAVE_GDI vpDisplayGDI display[3]; #elif defined VISP_HAVE_D3D9 vpDisplayD3D display[3]; #elif defined VISP_HAVE_GTK vpDisplayGTK display[3]; #endif if (opt_display) { // Display size is automatically defined by the image (I) size display[0].init(Iint, 100, 100,"The internal view") ; display[1].init(Iext1, 100, 100,"The first external view") ; display[2].init(Iext2, 100, 100,"The second external view") ; vpDisplay::setWindowPosition (Iint, 0, 0); vpDisplay::setWindowPosition (Iext1, 700, 0); vpDisplay::setWindowPosition (Iext2, 0, 550); vpDisplay::display(Iint); vpDisplay::flush(Iint); vpDisplay::display(Iext1); vpDisplay::flush(Iext1); vpDisplay::display(Iext2); vpDisplay::flush(Iext2); } vpServo task; vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); // Since the task gain lambda is very high, we need to increase default max velocities robot.setMaxTranslationVelocity(10); robot.setMaxRotationVelocity(vpMath::rad(180)); // Set initial position of the object in the camera frame vpHomogeneousMatrix cMo(0,0.1,2.0,vpMath::rad(35),vpMath::rad(25),0); // Set desired position of the object in the camera frame vpHomogeneousMatrix cdMo(0.0,0.0,0.8,vpMath::rad(0),vpMath::rad(0),vpMath::rad(0)); // Set initial position of the object in the world frame vpHomogeneousMatrix wMo(0.0,0.0,0,0,0,0); // Position of the camera in the world frame vpHomogeneousMatrix wMc; wMc = wMo * cMo.inverse(); robot.setPosition( wMc ); //The sphere vpSphere sphere(0,0,0,0.15); // Projection of the sphere sphere.track(cMo); //Set the current visual feature vpGenericFeature s(3); computeVisualFeatures(sphere, s); // Projection of the points sphere.track(cdMo); vpGenericFeature sd(3); computeVisualFeatures(sphere, sd); vpMatrix L(3,6); computeInteractionMatrix(sd,sphere,L); sd.setInteractionMatrix(L); task.setServo(vpServo::EYEINHAND_L_cVe_eJe); task.setInteractionMatrixType(vpServo::DESIRED); vpHomogeneousMatrix cMe; vpVelocityTwistMatrix cVe(cMe); task.set_cVe(cVe); vpMatrix eJe; robot.get_eJe(eJe); task.set_eJe(eJe); task.addFeature(s,sd) ; task.setLambda(7); vpWireFrameSimulator sim; // Set the scene sim.initScene(vpWireFrameSimulator::SPHERE, vpWireFrameSimulator::D_STANDARD); // Initialize simulator frames sim.set_fMo( wMo ); // Position of the object in the world reference frame sim.setCameraPositionRelObj(cMo) ; // initial position of the camera sim.setDesiredCameraPosition(cdMo); // desired position of the camera // Set the External camera position vpHomogeneousMatrix camMf(0.0,0,3.5,vpMath::rad(0),vpMath::rad(30),0); sim.setExternalCameraPosition(camMf); // Computes the position of a camera which is fixed in the object frame vpHomogeneousMatrix camoMf(0,0.0,2.5,0,vpMath::rad(140),0); camoMf = camoMf*(sim.get_fMo().inverse()); // Set the parameters of the cameras (internal and external) vpCameraParameters camera(1000,1000,320,240); sim.setInternalCameraParameters(camera); sim.setExternalCameraParameters(camera); int stop = 10; if (opt_display) { stop = 1000; //Get the internal and external views sim.getInternalImage(Iint); sim.getExternalImage(Iext1); sim.getExternalImage(Iext2,camoMf); //Display the object frame (current and desired position) vpDisplay::displayFrame(Iint,cMo,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iint,cdMo,camera,0.2,vpColor::none); //Display the object frame the world reference frame and the camera frame vpDisplay::displayFrame(Iext1,camMf*sim.get_fMo()*cMo.inverse(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,camMf*sim.get_fMo(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,camMf,camera,0.2,vpColor::none); //Display the world reference frame and the object frame vpDisplay::displayFrame(Iext2,camoMf,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext2,camoMf*sim.get_fMo(),camera,0.05,vpColor::none); vpDisplay::flush(Iint); vpDisplay::flush(Iext1); vpDisplay::flush(Iext2); std::cout << "Click on a display" << std::endl; while (!vpDisplay::getClick(Iint,false) && !vpDisplay::getClick(Iext1,false) && !vpDisplay::getClick(Iext2,false)){}; } //Print the task task.print() ; int iter = 0; vpColVector v ; while(iter++ < stop) { if (opt_display) { vpDisplay::display(Iint) ; vpDisplay::display(Iext1) ; vpDisplay::display(Iext2) ; } double t = vpTime::measureTimeMs(); robot.get_eJe(eJe) ; task.set_eJe(eJe) ; wMc = robot.getPosition() ; cMo = wMc.inverse() * wMo; sphere.track(cMo); //Set the current visual feature computeVisualFeatures(sphere, s); v = task.computeControlLaw() ; robot.setVelocity(vpRobot::CAMERA_FRAME, v); sim.setCameraPositionRelObj(cMo); //Compute the position of the external view which is fixed in the object frame camoMf.buildFrom(0,0.0,2.5,0,vpMath::rad(150),0); camoMf = camoMf*(sim.get_fMo().inverse()); if (opt_display) { //Get the internal and external views sim.getInternalImage(Iint); sim.getExternalImage(Iext1); sim.getExternalImage(Iext2,camoMf); //Display the object frame (current and desired position) vpDisplay::displayFrame(Iint,cMo,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iint,cdMo,camera,0.2,vpColor::none); //Display the camera frame, the object frame the world reference frame vpDisplay::displayFrame(Iext1,sim.getExternalCameraPosition()*sim.get_fMo()*cMo.inverse(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,sim.getExternalCameraPosition()*sim.get_fMo(),camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext1,sim.getExternalCameraPosition(),camera,0.2,vpColor::none); //Display the world reference frame and the object frame vpDisplay::displayFrame(Iext2,camoMf,camera,0.2,vpColor::none); vpDisplay::displayFrame(Iext2,camoMf*sim.get_fMo(),camera,0.05,vpColor::none); vpDisplay::flush(Iint); vpDisplay::flush(Iext1); vpDisplay::flush(Iext2); } vpTime::wait(t, sampling_time * 1000); // Wait 40 ms std::cout << "|| s - s* || = " << ( task.getError() ).sumSquare() <