Skip to content

Commit

Permalink
Merge pull request #987 from LLNL/feature/install-thirdparty-exports
Browse files Browse the repository at this point in the history
Install targets for thirdparty exports
  • Loading branch information
davidbeckingsale authored Mar 18, 2021
2 parents 5f5328f + 849188b commit cd0f951
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
###############################################################################
# Copyright (c) 2016-21, Lawrence Livermore National Security, LLC
# and RAJA project contributors. See the RAJA/COPYRIGHT file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

Expand Down Expand Up @@ -73,6 +72,8 @@ option(RAJA_ENABLE_RUNTIME_PLUGINS "Enable support for loading plugins at runtim

set(TEST_DRIVER "" CACHE STRING "driver used to wrap test commands")

set(BLT_EXPORT_THIRDPARTY ON CACHE BOOL "")

cmake_minimum_required(VERSION 3.9)

if (ENABLE_CUDA)
Expand Down
20 changes: 19 additions & 1 deletion cmake/SetupPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,22 @@ if (ENABLE_TBB)
message(WARNING "TBB NOT FOUND")
set(ENABLE_TBB Off)
endif()
endif ()
endif ()

set(TPL_DEPS)
blt_list_append(TO TPL_DEPS ELEMENTS cuda cuda_runtime IF ENABLE_CUDA)
blt_list_append(TO TPL_DEPS ELEMENTS hip hip_runtime IF ENABLE_HIP)
blt_list_append(TO TPL_DEPS ELEMENTS openmp IF ENABLE_OPENMP)
blt_list_append(TO TPL_DEPS ELEMENTS mpi IF ENABLE_MPI)

foreach(dep ${TPL_DEPS})
# If the target is EXPORTABLE, add it to the export set
get_target_property(_is_imported ${dep} IMPORTED)
if(NOT ${_is_imported})
install(TARGETS ${dep}
EXPORT RAJA
DESTINATION lib)
# Namespace target to avoid conflicts
set_target_properties(${dep} PROPERTIES EXPORT_NAME RAJA::${dep})
endif()
endforeach()

0 comments on commit cd0f951

Please sign in to comment.