Skip to content

Commit

Permalink
Set overriding user provided prefix to be off by default (#3463)
Browse files Browse the repository at this point in the history
It is surprising to override standard input variables. This requires the
user to actively opt-in to overriding the standard CMake behavior.
  • Loading branch information
jp-dark authored Dec 19, 2024
1 parent 0d5a1df commit 0ff3f16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libtiledbsoma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ option(TILEDB_WERROR "Enables the -Werror flag during compilation." OFF)
option(TILEDB_REMOVE_DEPRECATIONS "If true, do not build deprecated APIs." OFF)
option(TILEDB_SERIALIZATION "If true, enables building with support for query serialization" ON)
option(TILEDB_VERBOSE "If true, sets default logging to verbose for TileDB" OFF)
option(OVERRIDE_INSTALL_PREFIX "Ignores the setting of CMAKE_INSTALL_PREFIX and sets a default prefix" ON)
option(OVERRIDE_INSTALL_PREFIX "Ignores the setting of CMAKE_INSTALL_PREFIX and sets a default prefix" OFF)
option(ENABLE_ARROW_EXPORT "Installs an extra header for exporting in-memory results with Apache Arrow" ON)
option(TILEDB_LOG_OUTPUT_ON_FAILURE "If true, print error logs if dependency sub-project build fails" ON)
option(TILEDB_SANITIZER "Sanitizer to use in TILEDB. ")
Expand Down Expand Up @@ -122,7 +122,7 @@ endif()
#set(CMAKE_CXX_VISIBILITY_PRESET hidden)

# Root directory default installation prefix
if(OVERRIDE_INSTALL_PREFIX)
if(OVERRIDE_INSTALL_PREFIX OR NOT CMAKE_INSTALL_PREFIX)
set(PREFIX_REL_PATH "${CMAKE_SOURCE_DIR}/../dist")
get_filename_component(DEFAULT_PREFIX "${PREFIX_REL_PATH}" ABSOLUTE)
set(CMAKE_INSTALL_PREFIX "${DEFAULT_PREFIX}" CACHE PATH "Default install prefix" FORCE)
Expand Down
2 changes: 2 additions & 0 deletions scripts/bld
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ fi
# set installation path
if [ -n "${prefix}" ]; then
extra_opts+=" -DCMAKE_INSTALL_PREFIX=${prefix} -DOVERRIDE_INSTALL_PREFIX=OFF"
else
extra_opts+=" -DOVERRIDE_INSTALL_PREFIX=ON"
fi

# build with custom tiledb
Expand Down
2 changes: 2 additions & 0 deletions scripts/bld.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ if ($Configuration -eq 'Debug' -and $TileDBLocation -ne '') {

if ($Prefix -ne '') {
$ExtraOpts += " -DCMAKE_INSTALL_PREFIX=$Prefix -DOVERRIDE_INSTALL_PREFIX=OFF"
} else {
$ExtraOpts += " -DOVERRIDE_INSTALL_PREFIX=ON"
}

if ($TileDBLocation -ne '') {
Expand Down

0 comments on commit 0ff3f16

Please sign in to comment.