What is cmake_install.cmake

You generally don’t use cmake_install.cmake directly. From the v3.12 page it states:

The install() command generates a file, cmake_install.cmake, inside
the build directory, which is used internally by the generated install
target and by CPack.

With your current CMakeLists.txt, the generated file doesn’t do much. To create a useful install you would need to add more INSTALL commands to your CMakeLists.txt using the syntax below.

INSTALL(TARGETS targets... [EXPORT <export-name>]
    [[ARCHIVE|LIBRARY|RUNTIME|FRAMEWORK|BUNDLE|
      PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE]
     [DESTINATION <dir>]
     [INCLUDES DESTINATION [<dir> ...]]
     [PERMISSIONS permissions...]
     [CONFIGURATIONS [Debug|Release|...]]
     [COMPONENT <component>]
     [OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]
    ] [...])

For further reading on this command, check out the documentation site and wiki.

If it’s desired to manually execute the script as stated by Nic30g the 3.12 page states that cmake -P accepts the following variables:

COMPONENT
Set this variable to install only a single CPack component as opposed to all of them. For example, if you only want to install the Development component, run

 cmake -DCOMPONENT=Development -P cmake_install.cmake

BUILD_TYPE
Set this variable to change the build type if you are using a multi-config generator. For example, to install with the Debug configuration, run

 cmake -DBUILD_TYPE=Debug -P cmake_install.cmake.

DESTDIR
This is an environment variable rather than a CMake variable. It allows you to change the installation prefix on UNIX systems. See DESTDIR for details.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)