# Find TUsb # # This module defines # TUsb_FOUND # TUsb_INCLUDE_DIRS # TUsb_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(TUsb_INCLUDE_DIR AND TUsb_LIBRARY) SET(TUsb_FIND_QUIETLY TRUE) ENDIF() # If TUSB_ROOT was defined in the environment, use it. Else, search in registry for install path. Registry keys order is important! IF(NOT TUsb_ROOT) IF("$ENV{TUSB_ROOT}" STREQUAL "") SET(TUsb_ROOT "$ENV{SCOL_DEPENDENCIES_PATH}/SDK TUSB") ELSE() SET(TUsb_ROOT $ENV{TUSB_ROOT}) ENDIF() ENDIF() if(TUsb_ROOT) SET(TUsb_INCLUDE_SEARCH_DIRS ${TUsb_INCLUDE_SEARCH_DIRS} ${TUsb_ROOT} ) endif() # log message IF (NOT TUsb_FIND_QUIETLY) MESSAGE(STATUS "Checking for TUsb library") ENDIF() # Search for header files FIND_PATH(TUsb_INCLUDE_DIR TUSB_Controller.tlb PATHS ${TUsb_INCLUDE_SEARCH_DIRS}) # Configure libraries SET(TUsb_INCLUDE_DIRS ${TUsb_INCLUDE_DIR} CACHE STRING "Directory containing TUsb header files") # Hide those variables in GUI SET(TUsb_INCLUDE_DIR ${TUsb_INCLUDE_DIR} CACHE INTERNAL "") IF(TUsb_INCLUDE_DIR) SET(TUsb_FOUND TRUE) ENDIF() # log find result IF(TUsb_FOUND) IF(NOT TUsb_FIND_QUIETLY) MESSAGE(STATUS " includes: ${TUsb_INCLUDE_DIRS}") ENDIF() ELSE(TUsb_FOUND) IF(NOT TUsb_INCLUDE_DIRS) MESSAGE(STATUS "TUsb include files could not be found.") ENDIF() ENDIF(TUsb_FOUND)