Skip to content

Commit

Permalink
CMAKE_INSTALL_PREFX: Only Toplevel (AMReX-Codes#936)
Browse files Browse the repository at this point in the history
Set a non-default CMAKE_INSTALL_PREFIX only if AMReX is the top-level
CMake project. Otherwise, the default of a downstream project using
AMReX as subproject will be placed in a quite confusing, temporary
directory.
  • Loading branch information
ax3l authored May 26, 2020
1 parent 38f9ee1 commit fadf58e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ set( CMAKE_MODULE_PATH ${AMREX_CMAKE_MODULES_PATH} )
#
# Provide a default install directory
#
if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set ( CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/installdir"
CACHE PATH "AMReX installation directory" FORCE)
if ( CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
set ( CMAKE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/installdir"
CACHE PATH "AMReX installation directory" FORCE)
endif ()

#
Expand Down

0 comments on commit fadf58e

Please sign in to comment.