# Find MYO # # This module defines # MYO_FOUND # MYO_INCLUDE_DIRS # MYO_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 # # On a new cmake run, we do not need to be verbose IF(MYO_INCLUDE_DIR AND MYO_LIBRARY) SET(MYO_FIND_QUIETLY TRUE) ENDIF() # If MYO_ROOT was defined in the environment, use it. if (NOT MYO_ROOT) if(NOT "$ENV{MYO_ROOT}" STREQUAL "") set(MYO_ROOT $ENV{MYO_ROOT}) else() set(MYO_ROOT $ENV{SCOL_DEPENDENCIES_PATH}/myo) endif() endif() # concat all the search paths IF(MYO_ROOT) SET(MYO_INCLUDE_SEARCH_DIRS ${MYO_INCLUDE_SEARCH_DIRS} ${MYO_ROOT}/include ) SET(MYO_LIBRARY_SEARCH_RELEASE_DIRS ${MYO_LIBRARY_SEARCH_DIRS} ${MYO_ROOT}/lib ) SET(MYO_LIBRARY_SEARCH_DEBUG_DIRS ${MYO_LIBRARY_SEARCH_DIRS} ${MYO_ROOT}/lib ) ENDIF() # log message IF (NOT MYO_FIND_QUIETLY) MESSAGE(STATUS "Checking for MYO library") ENDIF() # Search for header files FIND_PATH(MYO_INCLUDE_DIR myo/myo.hpp PATHS ${MYO_INCLUDE_SEARCH_DIRS}) # Search for libraries files (release mode) if(WIN32 AND (WIN64 OR (CMAKE_SIZEOF_VOID_P EQUAL 8))) FIND_LIBRARY(MYO_LIBRARY_RELEASE myo64 PATHS ${MYO_LIBRARY_SEARCH_RELEASE_DIRS}) # Search for libraries files (debug mode) FIND_LIBRARY(MYO_LIBRARY_DEBUG myo64 PATHS ${MYO_LIBRARY_SEARCH_DEBUG_DIRS}) else () FIND_LIBRARY(MYO_LIBRARY_RELEASE myo32 PATHS ${MYO_LIBRARY_SEARCH_RELEASE_DIRS}) # Search for libraries files (debug mode) FIND_LIBRARY(MYO_LIBRARY_DEBUG myo32 PATHS ${MYO_LIBRARY_SEARCH_DEBUG_DIRS}) endif () # Configure libraries for debug/release SET(MYO_INCLUDE_DIRS ${MYO_INCLUDE_DIR} CACHE STRING "Directory containing MYO header files") SET(MYO_LIBRARY debug ${MYO_LIBRARY_DEBUG} optimized ${MYO_LIBRARY_RELEASE}) SET(MYO_LIBRARIES ${MYO_LIBRARY} CACHE STRING "MYO libraries files") IF(MYO_INCLUDE_DIR AND MYO_LIBRARY) SET(MYO_FOUND TRUE) ENDIF() # Hide those variables in GUI SET(MYO_INCLUDE_DIR ${MYO_INCLUDE_DIR} CACHE INTERNAL "") SET(MYO_LIBRARY_RELEASE ${MYO_LIBRARY_RELEASE} CACHE INTERNAL "") SET(MYO_LIBRARY_DEBUG ${MYO_LIBRARY_DEBUG} CACHE INTERNAL "") SET(MYO_LIBRARY ${MYO_LIBRARY} CACHE INTERNAL "") # log find result IF(MYO_FOUND) IF(NOT MYO_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${MYO_LIBRARIES}") MESSAGE(STATUS " includes: ${MYO_INCLUDE_DIRS}") ENDIF() ELSE(MYO_FOUND) IF(NOT MYO_LIBRARIES) MESSAGE(STATUS, "MYO library or one of it dependencies could not be found.") ENDIF() IF(NOT MYO_INCLUDE_DIRS) MESSAGE(STATUS "MYO include files could not be found.") ENDIF() ENDIF(MYO_FOUND)