-
Notifications
You must be signed in to change notification settings - Fork 543
Opt in to the default CMake install path #994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opt in to the default CMake install path #994
Conversation
…SE_DEFAULT_INSTALL_PATH=ON
4893307
to
48aa1e1
Compare
message(FATAL_ERROR "You cannot set both CMAKE_INSTALL_PREFIX and USE_DEFAULT_INSTALL_PATH") | ||
endif() | ||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT USE_DEFAULT_INSTALL_PATH) | ||
message(WARNING "the CMake default install path is being overriden. This behavior will not be the default in a future release. Build with -DUSE_DEFAULT_INSTALL_PATH=ON to opt into what will be the default behavior in a future release") | ||
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the Configure the driver
steps in the install documentation to use the USE_DEFAULT_INSTALL_PATH
option.
Co-authored-by: Kevin Albertson <[email protected]>
# set it to live under build so we don't inadvertently pollute /usr/local | ||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
option(USE_DEFAULT_INSTALL_PATH "Override the CMake default installation path" OFF) | ||
if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND USE_DEFAULT_INSTALL_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT
is only TRUE on the very first execution of configure, so setting USE_DEFAULT_INSTALL_PATH=TRUE
will trigger this branch on every subsequent configure, preventing it from succeeding until CMAKE_INSTALL_PREFIX
is un-set on the CLI with -U
.
CXX-2703
Allow user to opt in to the default CMake install path by setting
-DUSE_DEFAULT_INSTALL_PATH=ON