2010-09-24 21:24:05 +00:00
|
|
|
# Look for a directory containing external libraries.
|
|
|
|
#
|
|
|
|
# The following values are defined
|
2010-09-28 13:27:32 +00:00
|
|
|
# EXTERNAL_PATH - where to find external
|
2010-09-24 21:24:05 +00:00
|
|
|
# EXTERNAL_INCLUDE_PATH - where to find external includes
|
2011-06-08 09:46:11 +00:00
|
|
|
# EXTERNAL_BINARY_PATH - where to find external binaries
|
2010-09-24 21:24:05 +00:00
|
|
|
# EXTERNAL_LIBRARY_PATH - where to find external libraries
|
|
|
|
# EXTERNAL_FOUND - True if the external libraries are available
|
|
|
|
|
2010-09-28 13:27:32 +00:00
|
|
|
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})
|
2011-09-10 16:45:54 +00:00
|
|
|
SET(EXTERNAL_TEMP_FILE "include/wwwconf.h")
|
2010-09-28 13:27:32 +00:00
|
|
|
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")
|
|
|
|
ENDIF(WITH_STLPORT)
|
|
|
|
|
2011-05-14 12:04:03 +00:00
|
|
|
FIND_PATH(EXTERNAL_PATH
|
|
|
|
${EXTERNAL_TEMP_FILE}
|
|
|
|
PATHS
|
|
|
|
$ENV{EXTERNAL_PATH}
|
|
|
|
${EXTERNAL_TEMP_PATH}
|
|
|
|
/usr/local
|
|
|
|
/usr
|
|
|
|
/sw
|
|
|
|
/opt/local
|
|
|
|
/opt/csw
|
|
|
|
/opt
|
|
|
|
)
|
2010-09-28 13:27:32 +00:00
|
|
|
|
2011-05-14 12:04:03 +00:00
|
|
|
IF(EXTERNAL_PATH)
|
|
|
|
SET(EXTERNAL_FOUND TRUE)
|
2010-09-24 21:24:05 +00:00
|
|
|
SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include")
|
|
|
|
|
2011-06-08 09:46:11 +00:00
|
|
|
# Using 32 or 64 bits binaries
|
2011-09-10 16:45:54 +00:00
|
|
|
IF(TARGET_X64 AND WIN32)
|
2011-06-08 09:46:11 +00:00
|
|
|
SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin64")
|
2011-09-10 16:45:54 +00:00
|
|
|
ELSE(TARGET_X64 AND WIN32)
|
2011-06-08 09:46:11 +00:00
|
|
|
SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin")
|
2011-09-10 16:45:54 +00:00
|
|
|
ENDIF(TARGET_X64 AND WIN32)
|
2011-08-19 14:58:18 +00:00
|
|
|
|
2010-09-24 21:24:05 +00:00
|
|
|
# Using 32 or 64 bits libraries
|
2011-09-10 16:45:54 +00:00
|
|
|
IF(TARGET_X64 AND WIN32)
|
2010-09-24 21:24:05 +00:00
|
|
|
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64")
|
2011-09-10 16:45:54 +00:00
|
|
|
ELSE(TARGET_X64 AND WIN32)
|
2010-09-24 21:24:05 +00:00
|
|
|
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib")
|
2011-09-10 16:45:54 +00:00
|
|
|
ENDIF(TARGET_X64 AND WIN32)
|
2010-09-24 21:24:05 +00:00
|
|
|
|
|
|
|
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}")
|
2011-05-14 12:04:03 +00:00
|
|
|
ENDIF(EXTERNAL_PATH)
|
2010-09-24 21:24:05 +00:00
|
|
|
|
|
|
|
IF(EXTERNAL_FOUND)
|
2010-09-28 13:27:32 +00:00
|
|
|
IF(NOT External_FIND_QUIETLY)
|
|
|
|
MESSAGE(STATUS "Found ${EXTERNAL_NAME}: ${EXTERNAL_PATH}")
|
|
|
|
ENDIF(NOT External_FIND_QUIETLY)
|
2010-09-24 21:24:05 +00:00
|
|
|
ELSE(EXTERNAL_FOUND)
|
2010-09-28 13:27:32 +00:00
|
|
|
IF(External_FIND_REQUIRED)
|
|
|
|
MESSAGE(FATAL_ERROR "Unable to find ${EXTERNAL_NAME}!")
|
|
|
|
ELSE(External_FIND_REQUIRED)
|
|
|
|
IF(NOT External_FIND_QUIETLY)
|
|
|
|
MESSAGE(STATUS "Warning: Unable to find ${EXTERNAL_NAME}!")
|
|
|
|
ENDIF(NOT External_FIND_QUIETLY)
|
|
|
|
ENDIF(External_FIND_REQUIRED)
|
2010-09-24 21:24:05 +00:00
|
|
|
ENDIF(EXTERNAL_FOUND)
|
2010-09-25 13:41:37 +00:00
|
|
|
|
2011-06-08 09:46:11 +00:00
|
|
|
MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_BINARY_PATH EXTERNAL_LIBRARY_PATH)
|