Skip to content

Commit 752882e

Browse files
maikeldietmarkuehl
andauthored
Change exported install name to beman::execution26 (#109)
* Change exported install name to beman::execution26 * adjust the header update script and add missing headers --------- Co-authored-by: Dietmar Kühl <[email protected]>
1 parent 5d0de33 commit 752882e

File tree

5 files changed

+30
-21
lines changed

5 files changed

+30
-21
lines changed

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
1212
endif()
1313

1414
set(TARGET_NAME execution26)
15-
set(TARGET_NAMESPACE beman) # FIXME: not used in install(EXPORT ...) CK?
15+
set(TARGET_NAMESPACE beman)
1616
set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME})
1717
set(TARGET_LIBRARY ${PROJECT_NAME})
18-
set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
18+
set(TARGET_ALIAS ${TARGET_NAMESPACE}::${TARGET_NAME})
1919
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
2020
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)
2121

@@ -40,7 +40,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug)
4040
# uncomment to enable the options. Some of them accept one or more inputs:
4141
project_options(
4242
PREFIX
43-
${PROJECT_NAME}
43+
${TARGET_NAME}
4444
ENABLE_CACHE
4545
# NO! # ENABLE_CLANG_TIDY
4646
# NO! ENABLE_VS_ANALYSIS

bin/update-cmake-headers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_headers(dir):
2929
}
3030

3131
file_set_re = re.compile(" *FILE_SET.*")
32-
section_re = re.compile(" *\${TARGET_LIBRARY}_(?P<section>.*)_headers$")
32+
section_re = re.compile(" *\${TARGET_NAME}_(?P<section>.*)_headers$")
3333
header_re = re.compile(" *\${PROJECT_SOURCE_DIR}/include/beman/.*/.*\.hpp")
3434

3535
if len(sys.argv) != 2:

examples/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ foreach(EXAMPLE ${EXAMPLES})
2121
set(EXAMPLE_TARGET ${TARGET_PREFIX}.examples.${EXAMPLE})
2222
add_executable(${EXAMPLE_TARGET})
2323
target_sources(${EXAMPLE_TARGET} PRIVATE ${EXAMPLE}.cpp)
24-
target_link_libraries(${EXAMPLE_TARGET} PRIVATE ${TARGET_LIBRARY})
24+
target_link_libraries(${EXAMPLE_TARGET} PRIVATE ${TARGET_NAMESPACE}::${TARGET_NAME})
2525
endforeach()

src/beman/execution26/CMakeLists.txt

+24-15
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
# cmake-format: on
55

6-
add_library(${TARGET_LIBRARY} STATIC)
7-
add_library(${TARGET_ALIAS} ALIAS ${TARGET_LIBRARY})
6+
add_library(${TARGET_NAME} STATIC)
7+
add_library(${TARGET_ALIAS} ALIAS ${TARGET_NAME})
88

99
if(CMAKE_BUILD_TYPE STREQUAL Debug)
10-
target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_options>)
11-
target_link_libraries(${TARGET_LIBRARY} PUBLIC $<BUILD_INTERFACE:${TARGET_LIBRARY}_project_warnings>)
10+
target_link_libraries(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${TARGET_NAME}_project_options>)
11+
target_link_libraries(${TARGET_NAME} PUBLIC $<BUILD_INTERFACE:${TARGET_NAME}_project_warnings>)
1212
endif()
1313

1414
include(CMakePrintHelpers)
15-
cmake_print_variables(TARGET_ALIAS TARGET_LIBRARY TARGET_PREFIX PROJECT_SOURCE_DIR)
15+
cmake_print_variables(TARGET_ALIAS TARGET_NAME TARGET_PREFIX PROJECT_SOURCE_DIR)
1616

1717
target_sources(
18-
${TARGET_LIBRARY}
18+
${TARGET_NAME}
1919
PRIVATE execution.cpp
2020
PUBLIC FILE_SET
21-
${TARGET_LIBRARY}_public_headers
21+
${TARGET_NAME}_public_headers
2222
TYPE
2323
HEADERS
2424
BASE_DIRS
@@ -28,7 +28,7 @@ target_sources(
2828
${PROJECT_SOURCE_DIR}/include/beman/execution26/functional.hpp
2929
${PROJECT_SOURCE_DIR}/include/beman/execution26/stop_token.hpp
3030
PUBLIC FILE_SET
31-
${TARGET_LIBRARY}_detail_headers
31+
${TARGET_NAME}_detail_headers
3232
TYPE
3333
HEADERS
3434
BASE_DIRS
@@ -39,8 +39,10 @@ target_sources(
3939
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/apply_sender.hpp
4040
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/as_awaitable.hpp
4141
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/as_except_ptr.hpp
42+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/atomic_intrusive_stack.hpp
4243
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/await_result_type.hpp
4344
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/await_suspend_result.hpp
45+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/awaitable_sender.hpp
4446
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/basic_operation.hpp
4547
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/basic_receiver.hpp
4648
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/basic_sender.hpp
@@ -49,6 +51,7 @@ target_sources(
4951
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/callable.hpp
5052
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/check_type_alias_exist.hpp
5153
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/child_type.hpp
54+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/class_type.hpp
5255
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/common.hpp
5356
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/completion_domain.hpp
5457
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/completion_signature.hpp
@@ -64,6 +67,7 @@ target_sources(
6467
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/continues_on.hpp
6568
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_same_as.hpp
6669
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_tuple.hpp
70+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_type_list.hpp
6771
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decayed_typeof.hpp
6872
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/decays_to.hpp
6973
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/default_domain.hpp
@@ -97,6 +101,7 @@ target_sources(
97101
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/indirect_meta_apply.hpp
98102
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/inplace_stop_source.hpp
99103
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/into_variant.hpp
104+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/intrusive_stack.hpp
100105
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/is_awaitable.hpp
101106
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/is_awaiter.hpp
102107
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/join_env.hpp
@@ -138,6 +143,7 @@ target_sources(
138143
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender.hpp
139144
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_adaptor.hpp
140145
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_adaptor_closure.hpp
146+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_awaitable.hpp
141147
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_decompose.hpp
142148
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_for.hpp
143149
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/sender_in.hpp
@@ -149,6 +155,7 @@ target_sources(
149155
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/simple_counting_scope.hpp
150156
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/single_sender.hpp
151157
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/single_sender_value_type.hpp
158+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/split.hpp
152159
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/start.hpp
153160
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/starts_on.hpp
154161
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/state_type.hpp
@@ -165,6 +172,7 @@ target_sources(
165172
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/then.hpp
166173
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/transform_sender.hpp
167174
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/type_list.hpp
175+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/unspecified_promise.hpp
168176
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/unstoppable_token.hpp
169177
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/valid_completion_for.hpp
170178
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/valid_completion_signatures.hpp
@@ -174,32 +182,33 @@ target_sources(
174182
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/when_all.hpp
175183
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/when_all_with_variant.hpp
176184
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/with_await_transform.hpp
185+
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/with_awaitable_senders.hpp
177186
${PROJECT_SOURCE_DIR}/include/beman/execution26/detail/write_env.hpp
178187
)
179188

180189
# cmake-format: off
181-
get_property(DETAIL_HEADER_FILES TARGET ${TARGET_LIBRARY} PROPERTY HEADER_SET_${TARGET_LIBRARY}_detail_headers)
190+
get_property(DETAIL_HEADER_FILES TARGET ${TARGET_NAME} PROPERTY HEADER_SET_${TARGET_NAME}_detail_headers)
182191
source_group("Header Files\\detail" FILES ${DETAIL_HEADER_FILES})
183192

184-
set_target_properties(${TARGET_LIBRARY} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)
193+
set_target_properties(${TARGET_NAME} PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)
185194

186-
target_compile_features(${TARGET_LIBRARY} PUBLIC
195+
target_compile_features(${TARGET_NAME} PUBLIC
187196
"$<$<COMPILE_FEATURES:cxx_std_26>:cxx_std_26>"
188197
"$<$<NOT:$<COMPILE_FEATURES:cxx_std_26>>:cxx_std_23>"
189198
)
190199

191200
install(
192-
TARGETS ${TARGET_LIBRARY}
201+
TARGETS ${TARGET_NAME}
193202
EXPORT ${TARGETS_EXPORT_NAME}1
194203
ARCHIVE DESTINATION lib/$<CONFIG>
195-
FILE_SET ${TARGET_LIBRARY}_public_headers
196-
FILE_SET ${TARGET_LIBRARY}_detail_headers
204+
FILE_SET ${TARGET_NAME}_public_headers
205+
FILE_SET ${TARGET_NAME}_detail_headers
197206
)
198207
# cmake-format: on
199208

200209
install(
201210
EXPORT ${TARGETS_EXPORT_NAME}1
202211
FILE ${TARGETS_EXPORT_NAME}.cmake
203212
DESTINATION "${INSTALL_CONFIGDIR}"
204-
NAMESPACE ${TARGET_LIBRARY}::
213+
NAMESPACE ${TARGET_NAMESPACE}::
205214
)

tests/beman/execution26/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ remove_definitions(-DNDEBUG) # NOTE: we want ASSERT statements in Release too! C
124124
foreach(test ${execution_tests})
125125
set(TEST_EXE ${TARGET_PREFIX}.${test})
126126
add_executable(${TEST_EXE} ${test}.cpp)
127-
target_link_libraries(${TEST_EXE} PRIVATE beman_execution26::beman_execution26)
127+
target_link_libraries(${TEST_EXE} PRIVATE beman::execution26)
128128
add_test(NAME ${TEST_EXE} COMMAND $<TARGET_FILE:${TEST_EXE}>)
129129
endforeach()
130130

0 commit comments

Comments
 (0)