zibbr

Random 3d and p2p stuff that was originally the beginnings of an overly ambitious p2p virtual world thingy
git clone https://code.literati.org/zibbr.git
Log | Files | Refs

FindOIS.cmake (2285B)


      1 # - Find OIS includes and library
      2 #
      3 # This module defines
      4 #  OIS_INCLUDE_DIR
      5 #  OIS_LIBRARIES, the libraries to link against to use OIS.
      6 #  OIS_LIB_DIR, the location of the libraries
      7 #  OIS_FOUND, If false, do not try to use OIS
      8 #
      9 # Copyright © 2007, Matt Williams
     10 #
     11 # Redistribution and use is allowed according to the terms of the BSD license.
     12 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
     13 
     14 IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
     15 	SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent
     16 ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
     17 
     18 IF (WIN32) #Windows
     19 	MESSAGE(STATUS "Looking for OIS")
     20 	
     21 	SET(OGRESDK $ENV{OGRE_HOME})
     22 	SET(OGRESOURCE $ENV{OGRE_SRC})
     23 	IF (OGRESDK)
     24 		MESSAGE(STATUS "Using OIS in OGRE SDK")
     25 		SET(OGRESDK $ENV{OGRE_HOME})
     26 		STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}")
     27 		SET(OIS_INCLUDE_DIR ${OGRESDK}/include/OIS)
     28 		SET(OIS_LIB_DIR ${OGRESDK}/lib)
     29 		SET(OIS_LIBRARIES debug OIS_d optimized OIS)
     30 	ENDIF (OGRESDK)
     31 	IF (OGRESOURCE)
     32 		MESSAGE(STATUS "Using OIS in OGRE dependencies")
     33             SET(OIS_INCLUDE_DIR C:/ogre/Dependencies/include C:/ogre/Dependencies/include/OIS)
     34 		SET(OIS_LIB_DIR C:/ogre/Dependencies/lib/Release C:/ogre/Dependencies/lib/Debug)
     35 		SET(OIS_LIBRARIES debug OIS_d optimized OIS)
     36 	ENDIF (OGRESOURCE)
     37 ELSE (WIN32) #Unix
     38 	CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
     39 	FIND_PACKAGE(PkgConfig REQUIRED)
     40 	PKG_SEARCH_MODULE(OIS OIS)
     41 	SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
     42 	SET(OIS_LIB_DIR ${OIS_LIBDIR})
     43 	SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
     44 ENDIF (WIN32)
     45 
     46 #Do some preparation
     47 SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR)
     48 SEPARATE_ARGUMENTS(OIS_LIBRARIES)
     49 
     50 SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "")
     51 SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
     52 SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "")
     53 
     54 IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
     55 	SET(OIS_FOUND TRUE)
     56 ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
     57 
     58 IF (OIS_FOUND)
     59 	IF (NOT OIS_FIND_QUIETLY)
     60 		MESSAGE(STATUS "  libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}")
     61 		MESSAGE(STATUS "  includes  : ${OIS_INCLUDE_DIR}")
     62 	ENDIF (NOT OIS_FIND_QUIETLY)
     63 ELSE (OIS_FOUND)
     64 	IF (OIS_FIND_REQUIRED)
     65 		MESSAGE(FATAL_ERROR "Could not find OIS")
     66 	ENDIF (OIS_FIND_REQUIRED)
     67 ENDIF (OIS_FOUND)