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

FindOGREBullet.cmake (2665B)


      1 # Find OGREBullet includes and library
      2 #
      3 # This module defines
      4 #  OGREBULLET_INCLUDE_DIR
      5 #  OGREBULLET_LIBRARIES, the libraries to link against to use Bullet.
      6 #  OGREBULLET_LIB_DIR, the location of the libraries
      7 #  OGREBULLET_FOUND, If false, do not try to use Bullet
      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 (OGREBULLET_LIBRARIES AND OGREBULLET_INCLUDE_DIR)
     15 	SET(OGREBULLET_FIND_QUIETLY TRUE) # Already in cache, be silent
     16 ENDIF (OGREBULLET_LIBRARIES AND OGREBULLET_INCLUDE_DIR)
     17 
     18 IF (WIN32) #Windows
     19 	MESSAGE(STATUS "Looking for OGREBullet")
     20 	##SET(OGRESDK $ENV{OGRE_HOME})
     21 	SET(OGREBULLETSOURCE $ENV{OGREBULLET_HOME})
     22 	#IF (OGRESDK)
     23 	#	MESSAGE(STATUS "Using OGRE SDK")
     24 	#	STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}")
     25 	#	SET(OGRE_INCLUDE_DIR ${OGRESDK}/include)
     26 	#	SET(OGRE_LIB_DIR ${OGRESDK}/lib)
     27 	#	SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
     28 	#ENDIF (OGRESDK)
     29 	IF (OGREBULLETSOURCE)
     30 		MESSAGE(STATUS "Using OGREBullet built from source")
     31 		SET(OGREBULLET_INCLUDE_DIR $ENV{OGREBULLET_HOME}/Collisions/include $ENV{OGREBULLET_HOME}/Dynamics/include)
     32 		SET(OGREBULLET_LIB_DIR $ENV{OGREBULLET_HOME}/lib/Debug $ENV{OGREBULLET_HOME}/lib/Release)
     33 		SET(OGREBULLET_LIBRARIES debug OgreBulletCollisions_d debug OgreBulletDynamics_d optimized OgreBulletCollisions optimized OgreBulletDynamics)
     34 	ENDIF (OGREBULLETSOURCE)
     35 #ELSE (WIN32) #Unix
     36 #	CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
     37 #	FIND_PACKAGE(PkgConfig)
     38 #	PKG_SEARCH_MODULE(OGRE OGRE)
     39 #	SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
     40 #	SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
     41 #	SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
     42 ENDIF (WIN32)
     43 
     44 #Do some preparation
     45 SEPARATE_ARGUMENTS(OGREBULLET_INCLUDE_DIR)
     46 SEPARATE_ARGUMENTS(OGREBULLET_LIBRARIES)
     47 
     48 SET(OGREBULLET_INCLUDE_DIR ${OGREBULLET_INCLUDE_DIR} CACHE PATH "")
     49 SET(OGREBULLET_LIBRARIES ${OGREBULLET_LIBRARIES} CACHE STRING "")
     50 SET(OGREBULLET_LIB_DIR ${OGREBULLET_LIB_DIR} CACHE PATH "")
     51 
     52 IF (OGREBULLET_INCLUDE_DIR AND OGREBULLET_LIBRARIES)
     53 	SET(OGREBULLET_FOUND TRUE)
     54 ENDIF (OGREBULLET_INCLUDE_DIR AND OGREBULLET_LIBRARIES)
     55 
     56 IF (OGREBULLET_FOUND)
     57 	IF (NOT OGREBULLET_FIND_QUIETLY)
     58 		MESSAGE(STATUS "  libraries : ${OGREBULLET_LIBRARIES} from ${OGREBULLET_LIB_DIR}")
     59 		MESSAGE(STATUS "  includes  : ${OGREBULLET_INCLUDE_DIR}")
     60 	ENDIF (NOT OGREBULLET_FIND_QUIETLY)
     61 ELSE (OGREBULLET_FOUND)
     62 	IF (OGREBULLET_FIND_REQUIRED)
     63 		MESSAGE(FATAL_ERROR "Could not find OGREBullet")
     64 	ENDIF (OGREBULLET_FIND_REQUIRED)
     65 ENDIF (OGREBULLET_FOUND)