build: allow to use system angelscript
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
parent
65c25065ee
commit
7005f3b069
@ -121,9 +121,15 @@ elseif(MSVC)
|
||||
endif()
|
||||
|
||||
|
||||
# Build the angelscript library
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/angelscript/projects/cmake")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/lib/angelscript/include")
|
||||
# Build the angelscript library if not in system
|
||||
find_package(Angelscript)
|
||||
if(ANGELSCRIPT_FOUND)
|
||||
include_directories(${Angelscript_INCLUDE_DIRS})
|
||||
else()
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/angelscript/projects/cmake")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/lib/angelscript/include")
|
||||
set(Angelscript_LIBRARIES angelscript)
|
||||
endif()
|
||||
|
||||
# OpenAL
|
||||
if(APPLE)
|
||||
@ -310,7 +316,7 @@ target_link_libraries(supertuxkart
|
||||
enet
|
||||
glew
|
||||
stkirrlicht
|
||||
angelscript
|
||||
${Angelscript_LIBRARIES}
|
||||
${CURL_LIBRARIES}
|
||||
${OGGVORBIS_LIBRARIES}
|
||||
${OPENAL_LIBRARY}
|
||||
|
33
cmake/FindAngelscript.cmake
Normal file
33
cmake/FindAngelscript.cmake
Normal file
@ -0,0 +1,33 @@
|
||||
# - Try to find angelscript
|
||||
# Once done this will define
|
||||
#
|
||||
# ANGELSCRIPT_FOUND - system has angelscript
|
||||
# Angelscript_INCLUDE_DIRS - the angelscript include directory
|
||||
# Angelscript_LIBRARIES - the libraries needed to use angelscript
|
||||
#
|
||||
|
||||
FIND_PATH(Angelscript_INCLUDE_DIRS angelscript.h
|
||||
PATHS
|
||||
/usr/local
|
||||
/usr
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(Angelscript_LIBRARY
|
||||
NAMES angelscript
|
||||
PATHS
|
||||
/usr/local
|
||||
/usr
|
||||
PATH_SUFFIXES lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set ANGELSCRIPT_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Angelscript DEFAULT_MSG Angelscript_LIBRARY Angelscript_INCLUDE_DIRS)
|
||||
|
||||
IF (ANGELSCRIPT_FOUND)
|
||||
SET(Angelscript_LIBRARIES ${Angelscript_LIBRARY})
|
||||
ENDIF (ANGELSCRIPT_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(Angelscript_LIBRARY Angelscript_LIBRARIES Angelscript_INCLUDE_DIRS)
|
Loading…
Reference in New Issue
Block a user