mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 21:01:05 +08:00
f0e72be285
My goal is to reduce our need on sfml_find_package until it can finally be removed. It's preferred to simply use find_package to find 3rd party projects. I had to add IMPORTED targets to some of our find modules so that we could get away from using INTERFACE libraries for external code. That also implied that our find moduels need to be installed so that users have access to them when processing SFML's config module.
24 lines
562 B
CMake
24 lines
562 B
CMake
#
|
|
# Try to find GBM library and include path.
|
|
# Once done this will define
|
|
#
|
|
# GBM_FOUND
|
|
# GBM_INCLUDE_PATH
|
|
# GBM_LIBRARY
|
|
#
|
|
|
|
if(PKG_CONFIG_FOUND)
|
|
pkg_check_modules(PC_GBM gbm QUIET)
|
|
endif()
|
|
|
|
find_path(GBM_INCLUDE_DIR NAMES gbm.h)
|
|
find_library(GBM_LIBRARY NAMES gbm)
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(GBM DEFAULT_MSG GBM_LIBRARY GBM_INCLUDE_DIR)
|
|
|
|
add_library(GBM::GBM IMPORTED UNKNOWN)
|
|
set_target_properties(GBM::GBM PROPERTIES
|
|
INTERFACE_INCLUDE_DIRECTORIES ${GBM_INCLUDE_DIR}
|
|
IMPORTED_LOCATION ${GBM_LIBRARY})
|