https://github.com/Kitware/CMake
Raw File
Tip revision: 25d2850c190ba915a7527a29dda6efe61be901f0 authored by Brad King on 21 March 2024, 13:32:22 UTC
CMake 3.29.0
Tip revision: 25d2850
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
-------------------------------------------

.. versionadded:: 3.7.1

CMake sets this variable to a ``TRUE`` value when the
:variable:`CMAKE_INSTALL_PREFIX` has just been initialized to
its default value, typically on the first
run of CMake within a new build tree and the :envvar:`CMAKE_INSTALL_PREFIX`
environment variable is not set on the first run of CMake. This can be used
by project code to change the default without overriding a user-provided value:

.. code-block:: cmake

  if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
    set(CMAKE_INSTALL_PREFIX "/my/default" CACHE PATH "..." FORCE)
  endif()
back to top