Skip to content

Commit

Permalink
Properly configure installed Coroutines module
Browse files Browse the repository at this point in the history
  • Loading branch information
karzhenkov committed Jan 23, 2021
1 parent aebd1a2 commit 2f54023
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()

if(CXX_COROUTINES_HEADER STREQUAL coroutine)
set(CXX_COROUTINES_COMPONENT Final)
else()
set(CXX_COROUTINES_COMPONENT Experimental)
endif()

export(EXPORT cppcoroTargets
FILE "${PROJECT_BINARY_DIR}/cppcoro/cppcoroTargets.cmake"
NAMESPACE cppcoro::)
configure_file(cmake/cppcoroConfig.cmake
"${PROJECT_BINARY_DIR}/cppcoro/cppcoroConfig.cmake"
COPYONLY)
@ONLY)
configure_file(cmake/FindCoroutines.cmake
"${PROJECT_BINARY_DIR}/cppcoro/FindCoroutines.cmake"
COPYONLY)
Expand Down
2 changes: 1 addition & 1 deletion cmake/cppcoroConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

include(CMakeFindDependencyMacro)
find_dependency(Coroutines QUIET REQUIRED)
find_dependency(Coroutines QUIET REQUIRED COMPONENTS @CXX_COROUTINES_COMPONENT@)

include("${CMAKE_CURRENT_LIST_DIR}/cppcoroTargets.cmake")

0 comments on commit 2f54023

Please sign in to comment.