Skip to content

Commit fd71684

Browse files
committed
Opt in to the default CMake install path
1 parent cd9542c commit fd71684

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ To build static libraries only, set both BUILD_SHARED_LIBS and BUILD_SHARED_AND_
130130
endif()
131131

132132

133-
# If the user did not customize the install prefix,
134-
# set it to live under build so we don't inadvertently pollute /usr/local
135-
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
133+
option(USE_DEFAULT_INSTALL_PATH "Override the CMake default installation path" OFF)
134+
if(NOT USE_DEFAULT_INSTALL_PATH)
135+
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")
136136
set (CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE)
137137
endif()
138138

0 commit comments

Comments
 (0)