Skip to content

Commit

Permalink
Replace fetch_content by find_package for p2300 package
Browse files Browse the repository at this point in the history
  • Loading branch information
aurianer committed Sep 8, 2022
1 parent 6d252fd commit d9326fe
Showing 1 changed file with 2 additions and 35 deletions.
37 changes: 2 additions & 35 deletions cmake/pika_setup_p2300.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ if(PIKA_WITH_P2300_REFERENCE_IMPLEMENTATION AND NOT PIKA_FIND_PACKAGE)
)
endif()

include(FetchContent)

fetchcontent_declare(
P2300
GIT_REPOSITORY https://github.com/brycelelbach/wg21_P2300_std_execution.git
GIT_TAG 063fd9a9e8d9c0284f795f5342e057b3bc428202
)
fetchcontent_getproperties(P2300)
if(NOT p2300_POPULATED)
fetchcontent_populate(P2300)
endif()

add_library(P2300 INTERFACE)
target_include_directories(
P2300 SYSTEM INTERFACE "$<BUILD_INTERFACE:${p2300_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_compile_features(P2300 INTERFACE cxx_std_20)

install(
TARGETS P2300
EXPORT pika_internal_targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT core
)
pika_export_internal_targets(P2300)

install(
DIRECTORY "${p2300_SOURCE_DIR}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT core
)

target_link_libraries(pika_base_libraries INTERFACE P2300)
find_package(p2300 QUIET)
target_link_libraries(pika_base_libraries INTERFACE P2300::p2300)
endif()

0 comments on commit d9326fe

Please sign in to comment.