mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -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.
46 lines
1.4 KiB
CMake
46 lines
1.4 KiB
CMake
# - Try to find luajit
|
|
# Once done this will define
|
|
# LUAJIT_FOUND - System has luajit
|
|
# LUAJIT_INCLUDE_DIRS - The luajit include directories
|
|
# LUAJIT_LIBRARIES - The libraries needed to use luajit
|
|
|
|
find_package(PkgConfig)
|
|
if (PKG_CONFIG_FOUND)
|
|
pkg_check_modules(PC_LUAJIT QUIET luajit)
|
|
endif()
|
|
|
|
set(LUAJIT_DEFINITIONS ${PC_LUAJIT_CFLAGS_OTHER})
|
|
|
|
find_path(LUAJIT_INCLUDE_DIR luajit.h
|
|
PATHS ${PC_LUAJIT_INCLUDEDIR} ${PC_LUAJIT_INCLUDE_DIRS}
|
|
PATH_SUFFIXES luajit-2.0)
|
|
|
|
# If we're asked to use static linkage, add libluajit-5.1.a as a preferred
|
|
# library name.
|
|
if(LUAJIT_USE_STATIC)
|
|
list(APPEND LUAJIT_NAMES
|
|
"${CMAKE_STATIC_LIBRARY_PREFIX}luajit-5.1${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
endif()
|
|
|
|
if(MSVC)
|
|
list(APPEND LUAJIT_NAMES lua51)
|
|
elseif(MINGW)
|
|
list(APPEND LUAJIT_NAMES libluajit libluajit-5.1)
|
|
else()
|
|
list(APPEND LUAJIT_NAMES luajit-5.1)
|
|
endif()
|
|
|
|
find_library(LUAJIT_LIBRARY NAMES ${LUAJIT_NAMES}
|
|
PATHS ${PC_LUAJIT_LIBDIR} ${PC_LUAJIT_LIBRARY_DIRS})
|
|
|
|
set(LUAJIT_LIBRARIES ${LUAJIT_LIBRARY})
|
|
set(LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIR})
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE
|
|
# if all listed variables are TRUE
|
|
find_package_handle_standard_args(LuaJit DEFAULT_MSG
|
|
LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)
|
|
|
|
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARY)
|