You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.3 KiB
CMake
73 lines
2.3 KiB
CMake
14 years ago
|
# Look for a directory containing external libraries.
|
||
|
#
|
||
|
# The following values are defined
|
||
14 years ago
|
# EXTERNAL_PATH - where to find external
|
||
14 years ago
|
# EXTERNAL_INCLUDE_PATH - where to find external includes
|
||
14 years ago
|
# EXTERNAL_BINARY_PATH - where to find external binaries
|
||
14 years ago
|
# EXTERNAL_LIBRARY_PATH - where to find external libraries
|
||
|
# EXTERNAL_FOUND - True if the external libraries are available
|
||
|
|
||
14 years ago
|
SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH})
|
||
9 years ago
|
SET(EXTERNAL_TEMP_FILE "include/zlib.h")
|
||
14 years ago
|
SET(EXTERNAL_NAME "external")
|
||
|
|
||
|
# If using STLport preprend external_stlport
|
||
|
IF(WITH_STLPORT)
|
||
|
SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external_stlport ${CMAKE_CURRENT_SOURCE_DIR}/../external_stlport ${EXTERNAL_TEMP_PATH})
|
||
|
SET(EXTERNAL_TEMP_FILE "include/stlport/string")
|
||
|
SET(EXTERNAL_NAME "external with STLport")
|
||
8 years ago
|
ENDIF()
|
||
14 years ago
|
|
||
14 years ago
|
FIND_PATH(EXTERNAL_PATH
|
||
|
${EXTERNAL_TEMP_FILE}
|
||
|
PATHS
|
||
|
$ENV{EXTERNAL_PATH}
|
||
|
${EXTERNAL_TEMP_PATH}
|
||
|
/usr/local
|
||
|
/usr
|
||
|
/sw
|
||
|
/opt/local
|
||
|
/opt/csw
|
||
|
/opt
|
||
|
)
|
||
14 years ago
|
|
||
14 years ago
|
IF(EXTERNAL_PATH)
|
||
|
SET(EXTERNAL_FOUND TRUE)
|
||
14 years ago
|
SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include")
|
||
|
|
||
14 years ago
|
# Using 32 or 64 bits binaries
|
||
13 years ago
|
IF(TARGET_X64 AND WIN32)
|
||
14 years ago
|
SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin64")
|
||
9 years ago
|
ELSE()
|
||
14 years ago
|
SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin")
|
||
9 years ago
|
ENDIF()
|
||
14 years ago
|
|
||
14 years ago
|
# Using 32 or 64 bits libraries
|
||
13 years ago
|
IF(TARGET_X64 AND WIN32)
|
||
14 years ago
|
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64")
|
||
9 years ago
|
ELSE()
|
||
14 years ago
|
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib")
|
||
9 years ago
|
ENDIF()
|
||
14 years ago
|
|
||
|
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}")
|
||
|
# Stupid hack for FindOpenAL.cmake
|
||
|
SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}")
|
||
|
SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}")
|
||
9 years ago
|
ENDIF()
|
||
14 years ago
|
|
||
|
IF(EXTERNAL_FOUND)
|
||
14 years ago
|
IF(NOT External_FIND_QUIETLY)
|
||
|
MESSAGE(STATUS "Found ${EXTERNAL_NAME}: ${EXTERNAL_PATH}")
|
||
9 years ago
|
ENDIF()
|
||
9 years ago
|
ELSE()
|
||
14 years ago
|
IF(External_FIND_REQUIRED)
|
||
|
MESSAGE(FATAL_ERROR "Unable to find ${EXTERNAL_NAME}!")
|
||
9 years ago
|
ELSE()
|
||
14 years ago
|
IF(NOT External_FIND_QUIETLY)
|
||
|
MESSAGE(STATUS "Warning: Unable to find ${EXTERNAL_NAME}!")
|
||
9 years ago
|
ENDIF()
|
||
|
ENDIF()
|
||
|
ENDIF()
|
||
14 years ago
|
|
||
14 years ago
|
MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_BINARY_PATH EXTERNAL_LIBRARY_PATH)
|