Skip to content

Commit 8ea71af

Browse files
committed
Use CMake's FILE_SET to replace target_include_directories for better convience
1 parent cddcd5a commit 8ea71af

File tree

1 file changed

+167
-19
lines changed

1 file changed

+167
-19
lines changed

CMakeLists.txt

Lines changed: 167 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,169 @@ set(stdexec_export_targets)
151151
# Define the main library
152152
add_library(stdexec INTERFACE)
153153

154+
target_sources(stdexec
155+
PUBLIC
156+
FILE_SET headers
157+
TYPE HEADERS
158+
BASE_DIRS include
159+
FILES
160+
include/exec/__detail/__atomic_intrusive_queue.hpp
161+
include/exec/__detail/__atomic_ref.hpp
162+
include/exec/__detail/__basic_sequence.hpp
163+
include/exec/__detail/__bit_cast.hpp
164+
include/exec/__detail/__bwos_lifo_queue.hpp
165+
include/exec/__detail/__numa.hpp
166+
include/exec/__detail/__system_context_default_impl.hpp
167+
include/exec/__detail/__system_context_default_impl_entry.hpp
168+
include/exec/__detail/__system_context_replaceability_api.hpp
169+
include/exec/__detail/__xorshift.hpp
170+
include/exec/__detail/intrusive_heap.hpp
171+
include/exec/any_sender_of.hpp
172+
include/exec/async_scope.hpp
173+
include/exec/at_coroutine_exit.hpp
174+
include/exec/create.hpp
175+
include/exec/env.hpp
176+
include/exec/finally.hpp
177+
include/exec/inline_scheduler.hpp
178+
include/exec/into_tuple.hpp
179+
include/exec/just_from.hpp
180+
include/exec/libdispatch_queue.hpp
181+
include/exec/linux/__detail/memory_mapped_region.hpp
182+
include/exec/linux/__detail/safe_file_descriptor.hpp
183+
include/exec/linux/io_uring_context.hpp
184+
include/exec/linux/memory_mapped_region.hpp
185+
include/exec/linux/safe_file_descriptor.hpp
186+
include/exec/materialize.hpp
187+
include/exec/on.hpp
188+
include/exec/on_coro_disposition.hpp
189+
include/exec/repeat_effect_until.hpp
190+
include/exec/repeat_n.hpp
191+
include/exec/reschedule.hpp
192+
include/exec/scope.hpp
193+
include/exec/sequence.hpp
194+
include/exec/sequence/any_sequence_of.hpp
195+
include/exec/sequence/empty_sequence.hpp
196+
include/exec/sequence/ignore_all_values.hpp
197+
include/exec/sequence/iterate.hpp
198+
include/exec/sequence/transform_each.hpp
199+
include/exec/sequence_senders.hpp
200+
include/exec/single_thread_context.hpp
201+
include/exec/start_now.hpp
202+
include/exec/static_thread_pool.hpp
203+
include/exec/system_context.hpp
204+
include/exec/task.hpp
205+
include/exec/timed_scheduler.hpp
206+
include/exec/timed_thread_scheduler.hpp
207+
include/exec/trampoline_scheduler.hpp
208+
include/exec/variant_sender.hpp
209+
include/exec/when_any.hpp
210+
include/nvexec/detail/config.cuh
211+
include/nvexec/detail/cuda_atomic.cuh
212+
include/nvexec/detail/cuda_fwd.cuh
213+
include/nvexec/detail/memory.cuh
214+
include/nvexec/detail/queue.cuh
215+
include/nvexec/detail/throw_on_cuda_error.cuh
216+
include/nvexec/detail/variant.cuh
217+
include/nvexec/multi_gpu_context.cuh
218+
include/nvexec/nvtx.cuh
219+
include/nvexec/stream/algorithm_base.cuh
220+
include/nvexec/stream/bulk.cuh
221+
include/nvexec/stream/common.cuh
222+
include/nvexec/stream/ensure_started.cuh
223+
include/nvexec/stream/launch.cuh
224+
include/nvexec/stream/let_xxx.cuh
225+
include/nvexec/stream/reduce.cuh
226+
include/nvexec/stream/schedule_from.cuh
227+
include/nvexec/stream/split.cuh
228+
include/nvexec/stream/start_detached.cuh
229+
include/nvexec/stream/submit.cuh
230+
include/nvexec/stream/sync_wait.cuh
231+
include/nvexec/stream/then.cuh
232+
include/nvexec/stream/transfer.cuh
233+
include/nvexec/stream/upon_error.cuh
234+
include/nvexec/stream/upon_stopped.cuh
235+
include/nvexec/stream/when_all.cuh
236+
include/nvexec/stream_context.cuh
237+
include/stdexec/__detail/__as_awaitable.hpp
238+
include/stdexec/__detail/__awaitable.hpp
239+
include/stdexec/__detail/__basic_sender.hpp
240+
include/stdexec/__detail/__bulk.hpp
241+
include/stdexec/__detail/__completion_signatures.hpp
242+
include/stdexec/__detail/__concepts.hpp
243+
include/stdexec/__detail/__config.hpp
244+
include/stdexec/__detail/__connect_awaitable.hpp
245+
include/stdexec/__detail/__continue_on.hpp
246+
include/stdexec/__detail/__cpo.hpp
247+
include/stdexec/__detail/__debug.hpp
248+
include/stdexec/__detail/__diagnostics.hpp
249+
include/stdexec/__detail/__domain.hpp
250+
include/stdexec/__detail/__ensure_started.hpp
251+
include/stdexec/__detail/__env.hpp
252+
include/stdexec/__detail/__execute.hpp
253+
include/stdexec/__detail/__execution_fwd.hpp
254+
include/stdexec/__detail/__force_include.hpp
255+
include/stdexec/__detail/__inline_scheduler.hpp
256+
include/stdexec/__detail/__into_variant.hpp
257+
include/stdexec/__detail/__intrusive_mpsc_queue.hpp
258+
include/stdexec/__detail/__intrusive_ptr.hpp
259+
include/stdexec/__detail/__intrusive_queue.hpp
260+
include/stdexec/__detail/__intrusive_slist.hpp
261+
include/stdexec/__detail/__just.hpp
262+
include/stdexec/__detail/__let.hpp
263+
include/stdexec/__detail/__manual_lifetime.hpp
264+
include/stdexec/__detail/__meta.hpp
265+
include/stdexec/__detail/__on.hpp
266+
include/stdexec/__detail/__operation_states.hpp
267+
include/stdexec/__detail/__optional.hpp
268+
include/stdexec/__detail/__ranges.hpp
269+
include/stdexec/__detail/__read_env.hpp
270+
include/stdexec/__detail/__receiver_adaptor.hpp
271+
include/stdexec/__detail/__receiver_ref.hpp
272+
include/stdexec/__detail/__receivers.hpp
273+
include/stdexec/__detail/__run_loop.hpp
274+
include/stdexec/__detail/__schedule_from.hpp
275+
include/stdexec/__detail/__schedulers.hpp
276+
include/stdexec/__detail/__scope.hpp
277+
include/stdexec/__detail/__sender_adaptor_closure.hpp
278+
include/stdexec/__detail/__sender_introspection.hpp
279+
include/stdexec/__detail/__senders.hpp
280+
include/stdexec/__detail/__senders_core.hpp
281+
include/stdexec/__detail/__shared.hpp
282+
include/stdexec/__detail/__spin_loop_pause.hpp
283+
include/stdexec/__detail/__split.hpp
284+
include/stdexec/__detail/__start_detached.hpp
285+
include/stdexec/__detail/__start_on.hpp
286+
include/stdexec/__detail/__stop_token.hpp
287+
include/stdexec/__detail/__stopped_as_error.hpp
288+
include/stdexec/__detail/__stopped_as_optional.hpp
289+
include/stdexec/__detail/__submit.hpp
290+
include/stdexec/__detail/__sync_wait.hpp
291+
include/stdexec/__detail/__tag_invoke.hpp
292+
include/stdexec/__detail/__then.hpp
293+
include/stdexec/__detail/__transfer_just.hpp
294+
include/stdexec/__detail/__transform_completion_signatures.hpp
295+
include/stdexec/__detail/__transform_sender.hpp
296+
include/stdexec/__detail/__tuple.hpp
297+
include/stdexec/__detail/__type_traits.hpp
298+
include/stdexec/__detail/__upon_error.hpp
299+
include/stdexec/__detail/__upon_stopped.hpp
300+
include/stdexec/__detail/__utility.hpp
301+
include/stdexec/__detail/__variant.hpp
302+
include/stdexec/__detail/__when_all.hpp
303+
include/stdexec/__detail/__with_awaitable_senders.hpp
304+
include/stdexec/__detail/__write_env.hpp
305+
include/stdexec/concepts.hpp
306+
include/stdexec/coroutine.hpp
307+
include/stdexec/execution.hpp
308+
include/stdexec/functional.hpp
309+
include/stdexec/stop_token.hpp
310+
include/tbbexec/tbb_thread_pool.hpp
311+
FILE_SET version_config
312+
TYPE HEADERS
313+
BASE_DIRS ${CMAKE_BINARY_DIR}/include
314+
FILES
315+
${CMAKE_BINARY_DIR}/include/stdexec_version_config.hpp
316+
)
154317
list(APPEND stdexec_export_targets stdexec)
155318

156319
# Set library version
@@ -160,10 +323,6 @@ set_target_properties(stdexec PROPERTIES
160323

161324
# Declare the public include directories
162325
include(GNUInstallDirs)
163-
target_include_directories(stdexec INTERFACE
164-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
165-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
166-
)
167326

168327
target_link_libraries(stdexec INTERFACE Threads::Threads)
169328

@@ -357,10 +516,6 @@ endif()
357516

358517
set(SYSTEM_CONTEXT_SOURCES src/system_context/system_context.cpp)
359518
add_library(system_context STATIC ${SYSTEM_CONTEXT_SOURCES})
360-
target_include_directories(system_context PRIVATE
361-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
362-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
363-
)
364519
target_compile_features(system_context PUBLIC cxx_std_20)
365520
set_target_properties(system_context PROPERTIES
366521
CXX_STANDARD 20
@@ -370,7 +525,7 @@ target_compile_options(system_context PUBLIC
370525
$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:__cplusplus /Zc:preprocessor>
371526
)
372527
add_library(STDEXEC::system_context ALIAS system_context)
373-
528+
target_link_libraries(system_context PUBLIC stdexec)
374529

375530

376531
if(CMAKE_CROSSCOMPILING)
@@ -421,16 +576,9 @@ endif()
421576
include(CPack)
422577

423578
install(TARGETS stdexec system_context
424-
DESTINATION ${CMAKE_INSTALL_LIBDIR}
425-
EXPORT stdexec-exports)
426-
427-
install(
428-
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
429-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
430-
431-
install(
432-
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/stdexec_version_config.hpp
433-
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
579+
EXPORT stdexec-exports
580+
FILE_SET headers
581+
FILE_SET version_config)
434582

435583
##############################################################################
436584
# Install exports ------------------------------------------------------------

0 commit comments

Comments
 (0)