Commit Graph

8 Commits

Author SHA1 Message Date
dundargoc
4cf4ae93df
build: cmake cleanup (#22251)
- Remove unused code
- Use consistent casing. Variable names such as LibLuV_LIBRARIES is
  needlessly jarring, even if the name might be technically correct.
- Use title casing for packages. find_package(unibilium) requires the
  find_module to be named "Findunibilium.cmake", which makes it harder
  to spot when scanning the files. Instead, use "Unibilium".
2023-03-02 22:50:43 +01:00
Daniel Hahler
16b64c339e build: rename CMake find modules for LibFindMacros #10928
We are using "LIBFOO" prefixes for `LIBFOO_INCLUDE_DIRS` etc, and
therefore need to use this for the PREFIX with LibFindMacros also, so
that `"${${PREFIX}_FIND_VERSION}"` gets handled there properly.

The alternative would be to either manually handle/set the upper/mixed case
variants of those variable additionally, which is not as easy.

Keeping the existing names is useful for packagers.

Before this the version requirements with
`find_package(Unibilium 2.0 REQUIRED)` was not handled (a49cf5126), and
it prepares for using a required version with libvterm
(initially/wrongly ported in 1896c72a5).
2019-09-06 14:39:41 -07:00
Daniel Hahler
a49cf51269
build: require unibilium>=2.0 (#10681)
* build: require unibilium>=2.0

This also ports FindUnibilium to LibFindMacros, which was planned
anyway, and makes the version check easier.

With an older Unibilium our fallback code in `terminfo_from_builtin`
will not work (because it assumes the new data structures from 2.0.0 [1]),
and nvim would crash later because of `ut` being NUL.

1: 42f3cdd284
2019-08-03 15:20:28 +02:00
Daniel Hahler
6765bbc651
build: CMake: remove usage of USE_BUNDLED_X in main project (#10354)
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.
2019-06-28 02:02:19 +02:00
Daniel Hahler
aa090f9801
cmake: fix usage of find_package_handle_standard_args (#10288)
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
2019-06-21 03:48:46 +02:00
Daniel Hahler
b60e5c85ad cmake: USE_BUNDLED_X instead of X_USE_BUNDLED (#6357) 2017-03-25 23:02:20 +01:00
Florian Walch
2446b997c6 CMake: Remove duplicate PkgConfig lookups. 2015-04-29 22:26:55 +03:00
Florian Walch
07d4142a18 CMake: Refer to Unibilium instead of LibUnibilium. 2015-04-29 22:26:55 +03:00