cmake/Help/variable/CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT.rst

17 lines
559 B
ReStructuredText
Raw Normal View History

2016-12-03 23:28:24 +01:00
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
-------------------------------------------
2021-09-14 00:13:48 +02:00
.. versionadded:: 3.7.1
2016-12-03 23:28:24 +01:00
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. 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()