Skip to content

Commit

Permalink
[Patch] Install Move Tools to shared/amrex
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Oct 19, 2023
1 parent f39a06a commit 54f40e3
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
81 changes: 81 additions & 0 deletions recipes/amrex/3599.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From a1accf5a6ea7468f7e223c0305cdb13c70a34fc2 Mon Sep 17 00:00:00 2001
From: Axel Huebl <[email protected]>
Date: Wed, 18 Oct 2023 09:58:37 -0700
Subject: [PATCH] Install Move Tools to `shared/amrex`

Packaging AMReX for Conda, we realized that we break with
common conventions on Unix systems by installing a top-level
`Tools/` directory.

This moves its content in both the build directory and the
install destination to `share/amrex/` and
`<CMakePkgRoot>/AMReXCMakeModules/`, respectively.
---
Tools/CMake/AMReXInstallHelpers.cmake | 31 ++++++++++++++++++---------
1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/Tools/CMake/AMReXInstallHelpers.cmake b/Tools/CMake/AMReXInstallHelpers.cmake
index 0720efb4cf9..a01cd63301d 100644
--- a/Tools/CMake/AMReXInstallHelpers.cmake
+++ b/Tools/CMake/AMReXInstallHelpers.cmake
@@ -26,7 +26,7 @@ function (install_amrex_targets)
else()
set(CMAKE_FILES_DIR lib/cmake/AMReX)
endif()
- set(MODULE_PATH Tools/CMake) # Relative path to top level installation/build-tree
+ set(MODULE_PATH ${CMAKE_FILES_DIR}/AMReXCMakeModules) # Relative path to top level installation/build-tree

# Write Config file -- this is designed to work for both install and build trees
configure_package_config_file(${AMREX_CMAKE_MODULES_PATH}/AMReXConfig.cmake.in
@@ -60,7 +60,7 @@ function (install_amrex_targets)

install( EXPORT AMReXTargets
NAMESPACE AMReX::
- DESTINATION lib/cmake/AMReX )
+ DESTINATION ${CMAKE_FILES_DIR} )

#
# alias: last element will be legacy target
@@ -88,11 +88,17 @@ function (install_amrex_targets)
# Install Tools directory
install(
DIRECTORY
- ${PROJECT_SOURCE_DIR}/Tools/CMake
- ${PROJECT_SOURCE_DIR}/Tools/C_scripts
- ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ ${PROJECT_SOURCE_DIR}/Tools/C_scripts
+ ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ DESTINATION
+ share/amrex
+ USE_SOURCE_PERMISSIONS
+ )
+ install(
+ DIRECTORY
+ ${PROJECT_SOURCE_DIR}/Tools/CMake/
DESTINATION
- Tools
+ ${MODULE_PATH}
USE_SOURCE_PERMISSIONS
)
endif()
@@ -106,11 +112,16 @@ function (install_amrex_targets)
# Copy Tools directory to build tree
file(
COPY
- ${PROJECT_SOURCE_DIR}/Tools/CMake
- ${PROJECT_SOURCE_DIR}/Tools/C_scripts
- ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ ${PROJECT_SOURCE_DIR}/Tools/C_scripts
+ ${PROJECT_SOURCE_DIR}/Tools/typechecker
+ DESTINATION
+ ${PROJECT_BINARY_DIR}/share/amrex
+ )
+ file(
+ COPY
+ ${PROJECT_SOURCE_DIR}/Tools/CMake/
DESTINATION
- ${PROJECT_BINARY_DIR}/Tools
+ ${PROJECT_BINARY_DIR}/${MODULE_PATH}
)


4 changes: 4 additions & 0 deletions recipes/amrex/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ package:
source:
url: https://github.com/AMReX-Codes/amrex/archive/refs/tags/{{ version }}.tar.gz
sha256: e76e4787735c06ae747eaf57a682b12fed297ef2d5c7727051e20d34e4e79ce3
patches:
# Install CMake Scripts from Tools/CMake/ to <CMakePkgRoot>/Modules/
# https://github.com/AMReX-Codes/amrex/pull/3599
- 3599.patch

build:
number: 0
Expand Down

0 comments on commit 54f40e3

Please sign in to comment.