speed-dreams-code/cmake/FindSOLID.cmake
pouillot b1217241b9 Re #634 Port from txml to 3rd party Expat 2 for all platforms (with temporary option to disable if needed)
Re #712 Port from bundled SOLID 2 to 3rd party Free Solid for all platforms (with temporary option to disable if needed)

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4790 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 1e245a29829973f5e1fe8dc1784fb508201be89e
Former-commit-id: c0d7956316c9ad71fc203674961e2e654ada1847
2012-07-08 13:22:12 +00:00

74 lines
2 KiB
CMake

# Locate SOLID libraries (collision detection for solid bodies)
# This module defines
# SOLID_SOLID_LIBRARY, SOLID_BROAD_LIBRARY : name of each lib
# SOLID_LIBRARY : list of lib names
# SOLID_FOUND : if false, do not try to link to SOLID
# SOLID_INCLUDE_DIR : where to find the headers
#
# $SOLID_DIR is an environment variable that would
# correspond to the ./configure --prefix=$SOLID_DIR
# used in building SOLID.
#
# Created by Jean-Philippe Meuret (based on Mart Kelder's FindPLIB.cmake).
IF(NOT APPLE)
FIND_PATH(SOLID_SOLIDINCLUDE_DIR SOLID/solid.h
HINTS ENV SOLID_DIR
PATH_SUFFIXES
include/SOLID include
PATHS
/usr /usr/local
DOC "Location of SOLID")
ELSE(NOT APPLE)
FIND_PATH(SOLID_SOLIDINCLUDE_DIR solid.h
HINTS ENV SOLID_DIR
PATH_SUFFIXES
Headers include/SOLID include
PATHS
#Additional MacOS Paths
~/Library/Frameworks/SOLID.framework
/Library/Frameworks/SOLID.framework
/System/Library/Frameworks/SOLID.framework # Tiger
/usr /usr/local
DOC "Location of SOLID")
ENDIF(NOT APPLE)
SET(SOLID_INCLUDE_DIR ${SOLID_SOLIDINCLUDE_DIR} CACHE DOC "Include dir for SOLID")
FIND_LIBRARY(SOLID_SOLID_LIBRARY
NAMES solid
HINTS ENV SOLID_DIR
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATHS /usr /usr/local)
IF(WIN32)
FIND_LIBRARY(SOLID_BROAD_LIBRARY
NAMES broad
HINTS ENV SOLID_DIR
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATHS /usr /usr/local)
ENDIF(WIN32)
IF(SOLID_INCLUDE_DIR AND SOLID_SOLID_LIBRARY AND (NOT WIN32 OR SOLID_BROAD_LIBRARY))
SET(SOLID_FOUND TRUE)
ENDIF(SOLID_INCLUDE_DIR AND SOLID_SOLID_LIBRARY AND (NOT WIN32 OR SOLID_BROAD_LIBRARY))
IF(SOLID_FOUND)
MESSAGE(STATUS "Looking for SOLID - found (${SOLID_SOLID_LIBRARY})")
SET(SOLID_LIBRARY ${SOLID_SOLID_LIBRARY})
IF(WIN32)
SET(SOLID_LIBRARY ${SOLID_LIBRARY} ${SOLID_BROAD_LIBRARY})
ENDIF(WIN32)
ELSE(SOLID_FOUND)
MESSAGE(FATAL_ERROR "Could not find SOLID")
ENDIF(SOLID_FOUND)
MARK_AS_ADVANCED(SOLID_SOLIDINCLUDE_DIR)