diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e2dbdeef5fbff6177398b7c53bdc4308da171f1..32134886d4c856ad374ee6528a7c5f8350e4cfaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -778,6 +778,12 @@ endif() # Export targets # ################## +# Threads::Threads may be a dependency of BLAS/LAPACK and CUDA +# the target may be required for cmake users linking with CHAMELEONconfig.cmake +if (TARGET Threads::Threads) + morse_export_imported_target(Threads Threads threads chameleon) +endif() + # see https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html include(CMakePackageConfigHelpers) diff --git a/cmake_modules/CHAMELEONConfig.cmake.in b/cmake_modules/CHAMELEONConfig.cmake.in index 9bc029786004c25d85a6fe8a8a4731a6e0bff74b..744cdd723f8c89461b3393d1d4067028d86be1ee 100644 --- a/cmake_modules/CHAMELEONConfig.cmake.in +++ b/cmake_modules/CHAMELEONConfig.cmake.in @@ -11,6 +11,9 @@ check_required_components(CHAMELEON) # dependencies of CHAMELEON include("${CMAKE_CURRENT_LIST_DIR}/mTargets.cmake") +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/threadsTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/threadsTargets.cmake") +endif() if (NOT @CHAMELEON_SIMULATION@) include("${CMAKE_CURRENT_LIST_DIR}/cblasTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/lapackeTargets.cmake")