mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
6765bbc651
The variables are not meant to be defined there really, but only with the third-party project. Using them, e.g. with the following, would actually result in libvterm not being found then: make CMAKE_EXTRA_FLAGS="-DUSE_BUNDLED_LIBVTERM=ON" \ DEPS_CMAKE_FLAGS="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBVTERM=ON" In https://github.com/neovim/neovim/pull/6357 they were renamed to `USE_BUNDLED_X` from `X_USE_BUNDLED`, but the above reasoning applies to the old names, too. Internally `CMAKE_PREFIX_PATH` is used to add the built/bundled third party packages for `find_package`, so there is no reason to e.g. query the values via `load_cache` for example from the third-party project.
38 lines
1.3 KiB
CMake
38 lines
1.3 KiB
CMake
# - Try to find unibilium
|
|
# Once done this will define
|
|
# UNIBILIUM_FOUND - System has unibilium
|
|
# UNIBILIUM_INCLUDE_DIRS - The unibilium include directories
|
|
# UNIBILIUM_LIBRARIES - The libraries needed to use unibilium
|
|
|
|
find_package(PkgConfig)
|
|
if (PKG_CONFIG_FOUND)
|
|
pkg_check_modules(PC_UNIBILIUM QUIET unibilium)
|
|
endif()
|
|
|
|
set(UNIBILIUM_DEFINITIONS ${PC_UNIBILIUM_CFLAGS_OTHER})
|
|
|
|
find_path(UNIBILIUM_INCLUDE_DIR unibilium.h
|
|
PATHS ${PC_UNIBILIUM_INCLUDEDIR} ${PC_UNIBILIUM_INCLUDE_DIRS})
|
|
|
|
# If we're asked to use static linkage, add libunibilium.a as a preferred library name.
|
|
if(UNIBILIUM_USE_STATIC)
|
|
list(APPEND UNIBILIUM_NAMES
|
|
"${CMAKE_STATIC_LIBRARY_PREFIX}unibilium${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
endif()
|
|
|
|
list(APPEND UNIBILIUM_NAMES unibilium)
|
|
|
|
find_library(UNIBILIUM_LIBRARY NAMES ${UNIBILIUM_NAMES}
|
|
HINTS ${PC_UNIBILIUM_LIBDIR} ${PC_UNIBILIUM_LIBRARY_DIRS})
|
|
|
|
set(UNIBILIUM_LIBRARIES ${UNIBILIUM_LIBRARY})
|
|
set(UNIBILIUM_INCLUDE_DIRS ${UNIBILIUM_INCLUDE_DIR})
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
# handle the QUIETLY and REQUIRED arguments and set UNIBILIUM_FOUND to TRUE
|
|
# if all listed variables are TRUE
|
|
find_package_handle_standard_args(Unibilium DEFAULT_MSG
|
|
UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(UNIBILIUM_INCLUDE_DIR UNIBILIUM_LIBRARY)
|