# Find Aruco # # This module defines # Aruco_FOUND # Aruco_INCLUDE_DIRS # Aruco_LIBRARIES # # Copyright (c) 2012 I-maginer # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser 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 Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA, or go to # http://www.gnu.org/copyleft/lesser.txt # SET(aruco_VERSION 1.4.0) SET(aruco_VERSION_MAJOR 1) SET(aruco_VERSION_MINOR 4) SET(aruco_VERSION_PATCH 0) # On a new cmake run, we do not need to be verbose IF(Aruco_INCLUDE_DIR AND Aruco_LIBRARY) SET(Aruco_FIND_QUIETLY TRUE) ENDIF() include(FindPkgMacros) create_search_paths(ARUCO) # If Aruco_ROOT was defined in the environment, use it. if (NOT Aruco_ROOT) if(NOT "$ENV{ARUCO_ROOT}" STREQUAL "") set(Aruco_ROOT $ENV{ARUCO_ROOT}) else() set(Aruco_ROOT ${ARUCO_PREFIX_PATH}) endif() endif() SET(Aruco_INCLUDE_SEARCH_DIRS ${Aruco_INCLUDE_SEARCH_DIRS} ${Aruco_ROOT}/include ${Aruco_ROOT}/include/aruco ) SET(Aruco_LIBRARY_SEARCH_DEBUG_DIRS ${Aruco_LIBRARY_SEARCH_DIRS} ${Aruco_ROOT}/lib/Debug ${Aruco_ROOT}/lib ) SET(Aruco_LIBRARY_SEARCH_RELEASE_DIRS ${Aruco_LIBRARY_SEARCH_DIRS} ${Aruco_ROOT}/lib/Release ${Aruco_ROOT}/lib ) # Search for header files FIND_PATH(Aruco_INCLUDE_DIR aruco.h PATHS ${Aruco_INCLUDE_SEARCH_DIRS}) # Search for libraries files (release mode) FIND_LIBRARY(Aruco_LIBRARY_RELEASE aruco aruco${aruco_VERSION_MAJOR}${aruco_VERSION_MINOR}${aruco_VERSION_PATCH} aruco_d PATHS ${Aruco_LIBRARY_SEARCH_RELEASE_DIRS}) # Search for libraries files (debug mode) if (ANDROID) SET (Aruco_LIBRARY_DEBUG ${Aruco_LIBRARY_RELEASE}) else() FIND_LIBRARY(Aruco_LIBRARY_DEBUG aruco_d arucod aruco${aruco_VERSION_MAJOR}${aruco_VERSION_MINOR}${aruco_VERSION_PATCH}_d aruco aruco${aruco_VERSION_MAJOR}${aruco_VERSION_MINOR}${aruco_VERSION_PATCH} PATHS ${Aruco_LIBRARY_SEARCH_DEBUG_DIRS}) endif() # Configure libraries for debug/release SET(Aruco_INCLUDE_DIRS ${Aruco_INCLUDE_DIR} CACHE STRING "Directory containing Aruco header files") SET(Aruco_LIBRARY debug ${Aruco_LIBRARY_DEBUG} optimized ${Aruco_LIBRARY_RELEASE}) SET(Aruco_LIBRARIES ${Aruco_LIBRARY} CACHE STRING "Aruco libraries files") IF(Aruco_INCLUDE_DIR AND Aruco_LIBRARY) SET(Aruco_FOUND TRUE) ENDIF() # Hide those variables in GUI SET(Aruco_INCLUDE_DIR ${Aruco_INCLUDE_DIR} CACHE INTERNAL "") SET(Aruco_LIBRARY_DEBUG ${Aruco_LIBRARY_DEBUG} CACHE INTERNAL "") SET(Aruco_LIBRARY_RELEASE ${Aruco_LIBRARY_RELEASE} CACHE INTERNAL "") SET(Aruco_LIBRARY ${Aruco_LIBRARY} CACHE INTERNAL "") # log find result IF(Aruco_FOUND) IF(NOT Aruco_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${Aruco_LIBRARIES}") MESSAGE(STATUS " includes: ${Aruco_INCLUDE_DIRS}") ENDIF() ELSE(Aruco_FOUND) IF(NOT Aruco_LIBRARIES) MESSAGE(STATUS, "Aruco library or one of it dependencies could not be found.") ENDIF() IF(NOT Aruco_INCLUDE_DIRS) MESSAGE(STATUS "Aruco include files could not be found.") ENDIF() ENDIF(Aruco_FOUND)