CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT — CMake 4.4.3 Documentation

# CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT

Added in version 3.7.1.

CMake sets this variable to a `TRUE` value when the `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 `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:

    if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
      set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "/my/default")
    endif()