chore(cmake): improve Xext lookup for systems other than Linux
parent
0f2db9e5ef
commit
282c7ae031
|
@ -91,6 +91,10 @@ else()
|
|||
if(NOT OpusFile_FOUND)
|
||||
message(FATAL_ERROR "libopus/libopusfile not found, please install it (and make sure it's in your path)")
|
||||
endif()
|
||||
include(cmake/FindXext.cmake)
|
||||
if(NOT XEXT_FOUND)
|
||||
message(FATAL_ERROR "libXext, please install it (and make sure it's in your path)")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
|
|
@ -140,7 +140,8 @@ endif()
|
|||
if(WIN32)
|
||||
target_link_libraries(OpenSpades ws2_32.lib winmm.lib)
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
target_link_libraries(OpenSpades Xext)
|
||||
target_link_libraries(OpenSpades ${XEXT_LIBRARY})
|
||||
include_directories(${XEXT_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
FIND_PATH(XEXT_INCLUDE_DIR NAMES X11/extensions/Xext.h
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where Xext.h resides")
|
||||
FIND_LIBRARY( XEXT_LIBRARY
|
||||
NAMES XEXT Xext
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
DOC "The Xext library")
|
||||
|
||||
IF (XEXT_INCLUDE_DIR)
|
||||
SET( XEXT_FOUND 1 CACHE STRING "Set to 1 if XEXT is found, 0 otherwise")
|
||||
ELSE (XEXT_INCLUDE_DIR)
|
||||
SET( XEXT_FOUND 0 CACHE STRING "Set to 1 if XEXT is found, 0 otherwise")
|
||||
ENDIF (XEXT_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED( XEXT_FOUND )
|
Loading…
Reference in New Issue