Use libXtst again with CMake (#1908)
* Use libXtst again with CMake It seems that Xtst was never used after the transition to CMake. This is related to https://github.com/stepmania/stepmania/issues/1902. * Travis: install libxtst-dev
This commit is contained in:
committed by
Colby Klein
parent
9bf8f40a1c
commit
0bd2365ebc
@@ -27,6 +27,7 @@ addons:
|
||||
- libvorbis-dev
|
||||
- libxinerama-dev
|
||||
- libxrandr-dev
|
||||
- libxtst-dev
|
||||
- yasm
|
||||
|
||||
matrix:
|
||||
|
||||
@@ -106,5 +106,6 @@ elseif(LINUX)
|
||||
option(WITH_PULSEAUDIO "Build with PulseAudio support" ON)
|
||||
option(WITH_JACK "Build with JACK support" OFF)
|
||||
option(WITH_XRANDR "Build with Xrandr support" ON)
|
||||
option(WITH_LIBXTST "Build with libXtst support" ON)
|
||||
option(WITH_X11 "Build with X11 support" ON)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
find_path(LIBXTST_INCLUDE_DIR NAMES X11/extensions/XTest.h
|
||||
PATHS /opt/X11/include
|
||||
PATH_SUFFIXES X11/extensions
|
||||
DOC "The libXtst include directory"
|
||||
)
|
||||
|
||||
find_library(LIBXTST_LIBRARY NAMES Xtst
|
||||
PATHS /opt/X11/lib
|
||||
DOC "The libXtst library"
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBXTST DEFAULT_MSG LIBXTST_LIBRARY LIBXTST_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(LIBXTST_INCLUDE_DIR LIBXTST_LIBRARY)
|
||||
|
||||
@@ -395,6 +395,12 @@ elseif(LINUX)
|
||||
set(HAS_XRANDR TRUE)
|
||||
endif()
|
||||
|
||||
set(HAS_LIBXTST FALSE)
|
||||
if(WITH_LIBXTST)
|
||||
find_package(Xtst REQUIRED)
|
||||
set(HAS_LIBXTST TRUE)
|
||||
endif()
|
||||
|
||||
set(HAS_XINERAMA FALSE)
|
||||
if(WITH_XINERAMA)
|
||||
find_package(Xinerama REQUIRED)
|
||||
|
||||
+4
-1
@@ -369,6 +369,9 @@ else() # Linux
|
||||
if(${HAS_XRANDR})
|
||||
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XRANDR)
|
||||
endif()
|
||||
if(${HAS_LIBXTST})
|
||||
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_LIBXTST)
|
||||
endif()
|
||||
if(${HAS_XINERAMA})
|
||||
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XINERAMA)
|
||||
endif()
|
||||
@@ -606,7 +609,7 @@ else() # Unix / Linux TODO: Remember to find and locate the zip archive files.
|
||||
list(APPEND SMDATA_LINK_LIB ${PCRE_LIBRARY})
|
||||
endif()
|
||||
|
||||
list(APPEND SMDATA_LINK_LIB ${XRANDR_LIBRARIES} ${XINERAMA_LIBRARIES})
|
||||
list(APPEND SMDATA_LINK_LIB ${XRANDR_LIBRARIES} ${LIBXTST_LIBRARY} ${XINERAMA_LIBRARIES})
|
||||
|
||||
list(REMOVE_DUPLICATES SMDATA_LINK_LIB)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user