vivananax.blogg.se

Cmake install lib
Cmake install lib







  1. Cmake install lib how to#
  2. Cmake install lib install#

Add a nice header with the name, description, and home page. Find an appropriate location in 3rdparty/CMakeLists.txt to declare the library. Add the URL/tarball file to the top of 3rdparty/CMakeLists.txt. It would ease life of all packagers in distribution if it can be replaced by CMake macro CMAKEINSTALLLIBDIR so it will expand correctly on distribution using /usr/lib64 for example. project('another-application' VERSION 0. The steps to add a new third-party dependency are: Add the version and SHA256 hash to Versions.cmake. Authors of this library don’t distribute binary. To be able to load 3D models with the pre-made project we need Assimp library. First step: using CMake Download sources.

Cmake install lib how to#

It was left on purpose - we will learn how to use CMake by building Assimp ourselves. Instead you should rely on relative paths (as done above) or the $ generator expression (in exceptional circumstances) to avoid making your installation script non-relocatable. In a number of CMakeLists.txt there's an hardcoded lib/cloudcompare. The one dependency that is missing is Assimp library (responsible for loading 3D models). INCLUDES DESTINATION "$/cmake/mb"ĬACHE STRING "Installation directory for CMake package files")įinally, you should never read or set CMAKE_INSTALL_PREFIX from within the CMakeLists.txt file. This should be all you need: include(GNUInstallDirs) In CMake 3.14+ these are used as the default destinations for install(TARGETS).

  • CMAKE_INSTALL_DATADIR - the path below the installation prefix where package-specific data should be stored.
  • Often overridden on multiarch systems to include the target architecture, such as lib/aarch64-linux-gnu.
  • CMAKE_INSTALL_LIBDIR - the path below the installation prefix where libraries should be stored.
  • CMAKE_INSTALL_INCLUDEDIR - the path below the installation prefix where the include structure should exist.
  • See the documentation for the full list, but the following are the most relevant here: This module defines a number of standard cache variables for configuring installation destinations. You always want to include(GNUInstallDirs) (even on Windows).

    Cmake install lib install#

    Just because you seem new to CMake, a couple words of advice re: install rules.įirst, avoid hard-coding destinations.









    Cmake install lib