Skip to content

Commit

Permalink
Add HPXStdexecTarget.cmake file export
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Aug 23, 2024
1 parent 8a64f0f commit 79e9ce8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cmake/HPX_SetupStdexec.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(HPX_WITH_STDEXEC)
)

fetchcontent_getproperties(Stdexec)
if(NOT stdexec_POPULATED)
if(NOT Stdexec_POPULATED)
fetchcontent_populate(Stdexec)
endif()
set(Stdexec_ROOT ${stdexec_SOURCE_DIR})
Expand Down Expand Up @@ -76,14 +76,15 @@ if(HPX_WITH_STDEXEC)
install(
EXPORT HPXStdexecTarget
NAMESPACE Stdexec::
FILE HPXStdexecTarget.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${HPX_PACKAGE_NAME}
COMPONENT cmake
)

# TODO: Enforce a single spelling
add_library(Stdexec::Stdexec ALIAS Stdexec)
add_library(STDEXEC::stdexec ALIAS Stdexec)

# fetchcontent_makeavailable(Stdexec)
endif()

else()
Expand Down
12 changes: 7 additions & 5 deletions cmake/templates/HPXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ endif()

# Stdexec can be installed by HPX or externally installed. In the first case we use
# exported targets, in the second we find Stdexec again using find_package.
if(HPX_WITH_FETCH_STDEXEC)
include("${CMAKE_CURRENT_LIST_DIR}/HPXStdexecTarget.cmake")
else()
set(Stdexec_ROOT "@Stdexec_ROOT@")
include(HPX_SetupStdexec)
if(HPX_WITH_STDEXEC)
if(HPX_WITH_FETCH_STDEXEC)
include("${CMAKE_CURRENT_LIST_DIR}/HPXStdexecTarget.cmake")
else()
set(Stdexec_ROOT "@Stdexec_ROOT@")
include(HPX_SetupStdexec)
endif()
endif()


Expand Down

0 comments on commit 79e9ce8

Please sign in to comment.