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
|
- libvorbis-dev
|
||||||
- libxinerama-dev
|
- libxinerama-dev
|
||||||
- libxrandr-dev
|
- libxrandr-dev
|
||||||
|
- libxtst-dev
|
||||||
- yasm
|
- yasm
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
@@ -106,5 +106,6 @@ elseif(LINUX)
|
|||||||
option(WITH_PULSEAUDIO "Build with PulseAudio support" ON)
|
option(WITH_PULSEAUDIO "Build with PulseAudio support" ON)
|
||||||
option(WITH_JACK "Build with JACK support" OFF)
|
option(WITH_JACK "Build with JACK support" OFF)
|
||||||
option(WITH_XRANDR "Build with Xrandr support" ON)
|
option(WITH_XRANDR "Build with Xrandr support" ON)
|
||||||
|
option(WITH_LIBXTST "Build with libXtst support" ON)
|
||||||
option(WITH_X11 "Build with X11 support" ON)
|
option(WITH_X11 "Build with X11 support" ON)
|
||||||
endif()
|
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)
|
set(HAS_XRANDR TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(HAS_LIBXTST FALSE)
|
||||||
|
if(WITH_LIBXTST)
|
||||||
|
find_package(Xtst REQUIRED)
|
||||||
|
set(HAS_LIBXTST TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(HAS_XINERAMA FALSE)
|
set(HAS_XINERAMA FALSE)
|
||||||
if(WITH_XINERAMA)
|
if(WITH_XINERAMA)
|
||||||
find_package(Xinerama REQUIRED)
|
find_package(Xinerama REQUIRED)
|
||||||
|
|||||||
+4
-1
@@ -369,6 +369,9 @@ else() # Linux
|
|||||||
if(${HAS_XRANDR})
|
if(${HAS_XRANDR})
|
||||||
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XRANDR)
|
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XRANDR)
|
||||||
endif()
|
endif()
|
||||||
|
if(${HAS_LIBXTST})
|
||||||
|
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_LIBXTST)
|
||||||
|
endif()
|
||||||
if(${HAS_XINERAMA})
|
if(${HAS_XINERAMA})
|
||||||
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XINERAMA)
|
sm_add_compile_definition("${SM_EXE_NAME}" HAVE_XINERAMA)
|
||||||
endif()
|
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})
|
list(APPEND SMDATA_LINK_LIB ${PCRE_LIBRARY})
|
||||||
endif()
|
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)
|
list(REMOVE_DUPLICATES SMDATA_LINK_LIB)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user