Merge pull request #1099 from DDRBoxman/x11

cmake: Do not require X11 on OSX
master
Jim 2017-12-03 10:18:16 -08:00 committed by GitHub
commit c4ed55d8f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -5,7 +5,7 @@ if(APPLE)
include_directories(${COCOA})
endif()
if(UNIX)
if(LINUX)
find_package(X11 REQUIRED)
link_libraries(${X11_LIBRARIES})
include_directories(${X11_INCLUDE_DIR})

View File

@ -20,6 +20,14 @@ elseif(NOT APPLE)
include/glad/glad_glx.h)
endif()
set(glad_include_dirs
PRIVATE ${OPENGL_INCLUDE_DIR})
if (LINUX)
list (APPEND glad_include_dirs
PRIVATE ${X11_X11_INCLUDE_PATH})
endif()
add_library(glad SHARED
${glad_SOURCES}
${glad_PLATFORM_SOURCES})
@ -29,7 +37,7 @@ set_target_properties(glad PROPERTIES
SOVERSION "0")
target_include_directories(glad
PUBLIC include
PRIVATE ${X11_X11_INCLUDE_PATH} ${OPENGL_INCLUDE_DIR})
${glad_include_dirs})
target_compile_definitions(glad
PRIVATE GLAD_GLAPI_EXPORT_BUILD)