Merge pull request #3916 from chewi/system-squish

CMake: Add option to use system Squish library
This commit is contained in:
Benau 2019-05-14 10:08:12 +08:00 committed by GitHub
commit 8ccf57f100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,8 @@ CMAKE_DEPENDENT_OPTION(BUILD_RECORDER "Build opengl recorder" ON
"NOT SERVER_ONLY;NOT APPLE" OFF)
CMAKE_DEPENDENT_OPTION(USE_FRIBIDI "Support for right-to-left languages" ON
"NOT SERVER_ONLY" OFF)
CMAKE_DEPENDENT_OPTION(USE_SYSTEM_SQUISH "Use system Squish library instead of the built-in version, when available." ON
"NOT SERVER_ONLY" OFF)
CMAKE_DEPENDENT_OPTION(USE_WIIUSE "Support for wiimote input devices" ON
"NOT SERVER_ONLY;NOT MINGW;NOT CYGWIN" OFF)
@ -247,8 +249,10 @@ if(NOT SERVER_ONLY)
endif()
if(NOT SERVER_ONLY)
find_library(SQUISH_LIBRARY NAMES squish libsquish)
find_path(SQUISH_INCLUDEDIR NAMES squish.h PATHS)
if(USE_SYSTEM_SQUISH)
find_library(SQUISH_LIBRARY NAMES squish libsquish)
find_path(SQUISH_INCLUDEDIR NAMES squish.h PATHS)
endif()
if (NOT SQUISH_LIBRARY OR NOT SQUISH_INCLUDEDIR)
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libsquish")
include_directories("${PROJECT_SOURCE_DIR}/lib/libsquish")