mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
aa090f9801
The package argument is case sensitive, which is important to handle X_FIND_REQUIRED properly, i.e. error out early if it is not found: CMake Error at /usr/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find Unibilium (missing: UNIBILIUM_LIBRARY UNIBILIUM_INCLUDE_DIR) Otherwise it would continue until: CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: UNIBILIUM_INCLUDE_DIR (ADVANCED) Quickly checked via `rg 'find_package_handle_standard|find_package.*REQUIRED' -I | sort`. Ref: https://gitlab.kitware.com/cmake/cmake/issues/19413
33 lines
1.1 KiB
CMake
33 lines
1.1 KiB
CMake
# - Try to find luv
|
|
# Once done this will define
|
|
# LIBLUV_FOUND - System has libluv
|
|
# LIBLUV_INCLUDE_DIRS - The libluv include directories
|
|
# LIBLUV_LIBRARIES - The libraries needed to use libluv
|
|
|
|
find_path(LIBLUV_INCLUDE_DIR luv/luv.h
|
|
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS}
|
|
${LIMIT_SEARCH})
|
|
|
|
# If we're asked to use static linkage, add libluv.a as a preferred library name.
|
|
if(LIBLUV_USE_STATIC)
|
|
list(APPEND LIBLUV_NAMES
|
|
"${CMAKE_STATIC_LIBRARY_PREFIX}luv${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
endif()
|
|
|
|
list(APPEND LIBLUV_NAMES luv)
|
|
|
|
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
|
|
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS}
|
|
${LIMIT_SEARCH})
|
|
|
|
set(LIBLUV_LIBRARIES ${LIBLUV_LIBRARY})
|
|
set(LIBLUV_INCLUDE_DIRS ${LIBLUV_INCLUDE_DIR})
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
# handle the QUIETLY and REQUIRED arguments and set LIBLUV_FOUND to TRUE
|
|
# if all listed variables are TRUE
|
|
find_package_handle_standard_args(LibLUV DEFAULT_MSG
|
|
LIBLUV_LIBRARY LIBLUV_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(LIBLUV_INCLUDE_DIR LIBLUV_LIBRARY)
|