Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.25 KB

Install.md

File metadata and controls

40 lines (30 loc) · 1.25 KB

PHP/Install

Set the CMAKE_INSTALL_* variables inside the install(CODE|SCRIPT).

This is built on top of the CMake's GNUInstallDirs module and the install() command. At the time of writing, CMake documentation mentions special cases where, for example, the CMAKE_INSTALL_FULL_SYSCONFDIR variable becomes the /etc, when the install prefix is /usr, and similar.

However, some of these special cases aren't taken into account when using the install() commands. See: https://gitlab.kitware.com/cmake/cmake/-/issues/25852

This module exposes the following function:

php_install(CODE <code> ...)

It acts the same as install(CODE <code> ...), except that also the CMAKE_INSTALL_* variables are available inside the argument, like in the rest of the CMake code.

php_install(CODE "
  message(STATUS \"CMAKE_INSTALL_SYSCONFDIR=\${CMAKE_INSTALL_SYSCONFDIR}\")
")

Usage

# CMakeLists.txt
include(PHP/Install)