cmake: find libdrm with pkg-config

This commit is contained in:
Chia-I Wu 2014-08-02 09:14:28 +08:00
parent 2d2ae54aec
commit add717e09c

View File

@ -14,12 +14,17 @@ configure_file (
) )
include_directories("${PROJECT_BINARY_DIR}") include_directories("${PROJECT_BINARY_DIR}")
# xgl global includes
include_directories("/usr/include/drm")
include_directories("${PROJECT_SOURCE_DIR}/include") include_directories("${PROJECT_SOURCE_DIR}/include")
include(FindPkgConfig)
pkg_check_modules(LIBDRM REQUIRED libdrm)
if (NOT LIBDRM_FOUND)
message(FATAL_ERROR "libdrm not found")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
include(GetGitRevisionDescription) include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1) get_git_head_revision(GIT_REFSPEC GIT_SHA1)