Skip to content
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

CMake: Fix export with AMReX_INSTALL=OFF #2838

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ endif ()
#
# Install amrex -- Export
#
if(AMReX_INSTALL)
include(AMReXInstallHelpers)
install_amrex_targets(${_amrex_targets})

if(AMReX_INSTALL)
# Add a test_install target to smoke-test
# the installation
add_test_install_target(
Expand Down
4 changes: 3 additions & 1 deletion Tools/CMake/AMReXInstallHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function (install_amrex_targets)
${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIR}/AMReXConfigVersion.cmake
COMPATIBILITY AnyNewerVersion )

if(AMReX_INSTALL)
install( FILES
${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIR}/AMReXConfig.cmake
${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIR}/AMReXConfigVersion.cmake
Expand Down Expand Up @@ -78,11 +79,12 @@ function (install_amrex_targets)
Tools
USE_SOURCE_PERMISSIONS
)
endif()

#
# Export build-tree
#
export( EXPORT AMReXTargets NAMESPACE AMReX::
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line only works if an equivalent install() line exists for the same target.

export(TARGETS ${_targets} NAMESPACE AMReX::
FILE ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIR}/AMReXTargets.cmake)

# Copy Tools directory to build tree
Expand Down