neovim/cmake.deps/CMakeLists.txt
James McCoy a8fc94a2fd build(deps): include Find module
Now that all the Find<Foo>.cmake modules are using our custom
find_path2, the bundled deps build needs to include the Find module so
it has access to find_path2.

The missing include was causing the PPA build to fail:

```
cd .deps && \
	cmake -G 'Unix Makefiles'   \
	-DUSE_EXISTING_SRC_DIR=ON -DUSE_BUNDLED_LUAROCKS=OFF -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_GPERF=OFF -DUSE_BUNDLED_LUA=OFF /<<PKGBUILDDIR>>//cmake.deps
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found GNU Make at /usr/bin/make
-- CMAKE_BUILD_TYPE not specified, default is 'Debug'
-- Performing Test HAS_OG_FLAG
-- Performing Test HAS_OG_FLAG - Success
-- Found Git: /usr/bin/git (found version "2.17.1")
CMake Error at /<<PKGBUILDDIR>>/cmake/FindLuajit.cmake:1 (find_path2):
  Unknown CMake command "find_path2".
Call Stack (most recent call first):
  cmake/BuildLuv.cmake:13 (find_package)
  CMakeLists.txt:127 (include)

-- Configuring incomplete, errors occurred!
```
2023-10-18 23:47:20 +02:00

161 lines
4.4 KiB
CMake

# This is not meant to be included by the top-level.
cmake_minimum_required (VERSION 3.10)
project(NVIM_DEPS C)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
# Point CMake at any custom modules we may ship
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/../cmake")
include(ExternalProject)
include(CheckCCompilerFlag)
include(Deps)
include(Util)
include(Find)
set_default_buildtype()
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT isMultiConfig)
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-g)
check_c_compiler_flag(-Og HAS_OG_FLAG)
if(HAS_OG_FLAG)
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
endif()
set(DEPS_INCLUDE_FLAGS "-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
#XXX(tarruda): Lua is only used for debugging the functional test client, don't
# build it unless explicitly requested
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
if(USE_BUNDLED AND MSVC)
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
else()
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." OFF)
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
endif()
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
find_package(Git)
if(NOT Git_FOUND)
message(FATAL_ERROR "Git is required to apply patches.")
endif()
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
if(APPLE)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
execute_process(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE MACOS_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${MACOS_VERSION}")
endif()
message(STATUS "Using deployment target ${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
set_directory_properties(PROPERTIES
EP_PREFIX "${DEPS_BUILD_DIR}"
CMAKE_CONFIGURE_DEPENDS deps.txt)
file(READ deps.txt DEPENDENCIES)
STRING(REGEX REPLACE "\n" ";" DEPENDENCIES "${DEPENDENCIES}")
foreach(dep ${DEPENDENCIES})
STRING(REGEX REPLACE " " ";" dep "${dep}")
list(GET dep 0 name)
list(GET dep 1 value)
if(NOT ${name})
# _URL variables must NOT be set when USE_EXISTING_SRC_DIR is set,
# otherwise ExternalProject will try to re-download the sources.
if(NOT USE_EXISTING_SRC_DIR)
set(${name} ${value})
endif()
endif()
endforeach()
if(USE_BUNDLED_UNIBILIUM)
include(BuildUnibilium)
endif()
if(USE_BUNDLED_LIBTERMKEY)
include(BuildLibtermkey)
if(USE_BUNDLED_UNIBILIUM)
add_dependencies(libtermkey unibilium)
endif()
endif()
if(USE_BUNDLED_LIBVTERM)
include(BuildLibvterm)
endif()
if(USE_BUNDLED_LIBUV)
include(BuildLibuv)
endif()
if(USE_BUNDLED_MSGPACK)
include(BuildMsgpack)
endif()
if(USE_BUNDLED_LUAJIT)
include(BuildLuajit)
endif()
if(USE_BUNDLED_LUA)
include(BuildLua)
endif()
if(USE_BUNDLED_LUV)
include(BuildLuv)
endif()
if(USE_BUNDLED_LPEG)
include(BuildLpeg)
endif()
if(USE_BUNDLED_GETTEXT)
include(BuildGettext)
endif()
if(USE_BUNDLED_LIBICONV)
include(BuildLibiconv)
endif()
if(USE_BUNDLED_TS_PARSERS)
include(BuildTreesitterParsers)
endif()
if(USE_BUNDLED_TS)
include(BuildTreesitter)
endif()
if(WIN32)
include(GetBinaryDeps)
GetExecutable(TARGET cat)
GetExecutable(TARGET tee)
GetExecutable(TARGET xxd)
GetBinaryDep(TARGET win32yank_X86_64
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy win32yank.exe ${DEPS_BIN_DIR})
endif()