Skip to content

Commit 4943d21

Browse files
committed
misc: Rename CMake project from byte-span to ByteSpan
1 parent e052fdb commit 4943d21

8 files changed

Lines changed: 47 additions & 47 deletions

File tree

BUILDING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ cmake --install build --config Release
6565
This project exports a CMake package to be used with the [`find_package`][3]
6666
command of CMake:
6767

68-
* Package name: `byte-span`
69-
* Target name: `byte-span::byte-span`
68+
* Package name: `ByteSpan`
69+
* Target name: `ByteSpan::ByteSpan`
7070

7171
Example usage:
7272

7373
```cmake
74-
find_package(byte-span REQUIRED)
74+
find_package(ByteSpan REQUIRED)
7575
# Declare the imported target as a build requirement using PRIVATE, where
7676
# project_target is a target created in the consuming project
7777
target_link_libraries(
7878
project_target PRIVATE
79-
byte-span::byte-span
79+
ByteSpan::ByteSpan
8080
)
8181
```
8282

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ cmake_minimum_required(VERSION 3.14)
33
include(cmake/prelude.cmake)
44

55
project(
6-
byte-span
6+
ByteSpan
77
VERSION 0.1.0
88
DESCRIPTION "Lightweight view class for efficient handling of byte data"
9-
HOMEPAGE_URL "https://github.com/range3/byte-span"
9+
HOMEPAGE_URL "https://github.com/range3/ByteSpan"
1010
LANGUAGES CXX
1111
)
1212

@@ -15,21 +15,21 @@ include(cmake/variables.cmake)
1515

1616
# ---- Declare library ----
1717

18-
add_library(byte-span_byte-span INTERFACE)
19-
add_library(byte-span::byte-span ALIAS byte-span_byte-span)
18+
add_library(ByteSpan_ByteSpan INTERFACE)
19+
add_library(ByteSpan::ByteSpan ALIAS ByteSpan_ByteSpan)
2020

2121
set_property(
22-
TARGET byte-span_byte-span PROPERTY
23-
EXPORT_NAME byte-span
22+
TARGET ByteSpan_ByteSpan PROPERTY
23+
EXPORT_NAME ByteSpan
2424
)
2525

2626
target_include_directories(
27-
byte-span_byte-span ${warning_guard}
27+
ByteSpan_ByteSpan ${warning_guard}
2828
INTERFACE
2929
"\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
3030
)
3131

32-
target_compile_features(byte-span_byte-span INTERFACE cxx_std_20)
32+
target_compile_features(ByteSpan_ByteSpan INTERFACE cxx_std_20)
3333

3434
# ---- Install rules ----
3535

@@ -39,12 +39,12 @@ endif()
3939

4040
# ---- Developer mode ----
4141

42-
if(NOT byte-span_DEVELOPER_MODE)
42+
if(NOT ByteSpan_DEVELOPER_MODE)
4343
return()
4444
elseif(NOT PROJECT_IS_TOP_LEVEL)
4545
message(
4646
AUTHOR_WARNING
47-
"Developer mode is intended for developers of byte-span"
47+
"Developer mode is intended for developers of ByteSpan"
4848
)
4949
endif()
5050

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"name": "dev-mode",
1111
"hidden": true,
1212
"cacheVariables": {
13-
"byte-span_DEVELOPER_MODE": "ON",
13+
"ByteSpan_DEVELOPER_MODE": "ON",
1414
"VCPKG_MANIFEST_FEATURES": "test"
1515
}
1616
},

HACKING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ guide.
99
## Developer mode
1010

1111
Build system targets that are only useful for developers of this project are
12-
hidden if the `byte-span_DEVELOPER_MODE` option is disabled. Enabling this
12+
hidden if the `ByteSpan_DEVELOPER_MODE` option is disabled. Enabling this
1313
option makes tests and other developer targets and options available. Not
1414
enabling this option means that you are a consumer of this project and thus you
1515
have no need for these targets and options.
@@ -23,7 +23,7 @@ the project. As a developer, you are recommended to always have the [latest
2323
CMake version][2] installed to make use of the latest Quality-of-Life
2424
additions.
2525

26-
You have a few options to pass `byte-span_DEVELOPER_MODE` to the configure
26+
You have a few options to pass `ByteSpan_DEVELOPER_MODE` to the configure
2727
command, but this project prefers to use presets.
2828

2929
As a developer, you should create a `CMakeUserPresets.json` file at the root of

cmake/install-config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ include(CMakeFindDependencyMacro)
22
find_dependency(fmt)
33

44
if(fmt_FOUND)
5-
include("${CMAKE_CURRENT_LIST_DIR}/byte-spanTargets.cmake")
5+
include("${CMAKE_CURRENT_LIST_DIR}/ByteSpanTargets.cmake")
66
endif()

cmake/install-rules.cmake

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if(PROJECT_IS_TOP_LEVEL)
22
set(
3-
CMAKE_INSTALL_INCLUDEDIR "include/byte-span-${PROJECT_VERSION}"
3+
CMAKE_INSTALL_INCLUDEDIR "include/ByteSpan-${PROJECT_VERSION}"
44
CACHE STRING ""
55
)
66
set_property(CACHE CMAKE_INSTALL_INCLUDEDIR PROPERTY TYPE PATH)
@@ -13,17 +13,17 @@ include(CMakePackageConfigHelpers)
1313
include(GNUInstallDirs)
1414

1515
# find_package(<package>) call for consumers to find this project
16-
set(package byte-span)
16+
set(package ByteSpan)
1717

1818
install(
1919
DIRECTORY include/
2020
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
21-
COMPONENT byte-span_Development
21+
COMPONENT ByteSpan_Development
2222
)
2323

2424
install(
25-
TARGETS byte-span_byte-span
26-
EXPORT byte-spanTargets
25+
TARGETS ByteSpan_ByteSpan
26+
EXPORT ByteSpanTargets
2727
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
2828
)
2929

@@ -35,30 +35,30 @@ write_basic_package_version_file(
3535

3636
# Allow package maintainers to freely override the path for the configs
3737
set(
38-
byte-span_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}"
38+
ByteSpan_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${package}"
3939
CACHE STRING "CMake package config location relative to the install prefix"
4040
)
41-
set_property(CACHE byte-span_INSTALL_CMAKEDIR PROPERTY TYPE PATH)
42-
mark_as_advanced(byte-span_INSTALL_CMAKEDIR)
41+
set_property(CACHE ByteSpan_INSTALL_CMAKEDIR PROPERTY TYPE PATH)
42+
mark_as_advanced(ByteSpan_INSTALL_CMAKEDIR)
4343

4444
install(
4545
FILES cmake/install-config.cmake
46-
DESTINATION "${byte-span_INSTALL_CMAKEDIR}"
46+
DESTINATION "${ByteSpan_INSTALL_CMAKEDIR}"
4747
RENAME "${package}Config.cmake"
48-
COMPONENT byte-span_Development
48+
COMPONENT ByteSpan_Development
4949
)
5050

5151
install(
5252
FILES "${PROJECT_BINARY_DIR}/${package}ConfigVersion.cmake"
53-
DESTINATION "${byte-span_INSTALL_CMAKEDIR}"
54-
COMPONENT byte-span_Development
53+
DESTINATION "${ByteSpan_INSTALL_CMAKEDIR}"
54+
COMPONENT ByteSpan_Development
5555
)
5656

5757
install(
58-
EXPORT byte-spanTargets
59-
NAMESPACE byte-span::
60-
DESTINATION "${byte-span_INSTALL_CMAKEDIR}"
61-
COMPONENT byte-span_Development
58+
EXPORT ByteSpanTargets
59+
NAMESPACE ByteSpan::
60+
DESTINATION "${ByteSpan_INSTALL_CMAKEDIR}"
61+
COMPONENT ByteSpan_Development
6262
)
6363

6464
if(PROJECT_IS_TOP_LEVEL)

cmake/variables.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# ---- Developer mode ----
22

33
# Developer mode enables targets and code paths in the CMake scripts that are
4-
# only relevant for the developer(s) of byte-span
4+
# only relevant for the developer(s) of ByteSpan
55
# Targets necessary to build the project must be provided unconditionally, so
66
# consumers can trivially build and package the project
77
if(PROJECT_IS_TOP_LEVEL)
8-
option(byte-span_DEVELOPER_MODE "Enable developer mode" OFF)
8+
option(ByteSpan_DEVELOPER_MODE "Enable developer mode" OFF)
99
endif()
1010

1111
# ---- Warning guard ----
@@ -17,12 +17,12 @@ endif()
1717
set(warning_guard "")
1818
if(NOT PROJECT_IS_TOP_LEVEL)
1919
option(
20-
byte-span_INCLUDES_WITH_SYSTEM
21-
"Use SYSTEM modifier for byte-span's includes, disabling warnings"
20+
ByteSpan_INCLUDES_WITH_SYSTEM
21+
"Use SYSTEM modifier for ByteSpan's includes, disabling warnings"
2222
ON
2323
)
24-
mark_as_advanced(byte-span_INCLUDES_WITH_SYSTEM)
25-
if(byte-span_INCLUDES_WITH_SYSTEM)
24+
mark_as_advanced(ByteSpan_INCLUDES_WITH_SYSTEM)
25+
if(ByteSpan_INCLUDES_WITH_SYSTEM)
2626
set(warning_guard SYSTEM)
2727
endif()
2828
endif()

test/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
cmake_minimum_required(VERSION 3.14)
22

3-
project(byte-spanTests LANGUAGES CXX)
3+
project(ByteSpanTests LANGUAGES CXX)
44

55
include(../cmake/project-is-top-level.cmake)
66
include(../cmake/folders.cmake)
77

88
# ---- Dependencies ----
99

1010
if(PROJECT_IS_TOP_LEVEL)
11-
find_package(byte-span REQUIRED)
11+
find_package(ByteSpan REQUIRED)
1212
enable_testing()
1313
endif()
1414

@@ -19,15 +19,15 @@ include(Catch)
1919
file(GLOB_RECURSE TEST_SOURCES CONFIGURE_DEPENDS
2020
"${CMAKE_CURRENT_SOURCE_DIR}/source/*_test.cpp")
2121

22-
add_executable(byte-span_test ${TEST_SOURCES})
22+
add_executable(ByteSpan_test ${TEST_SOURCES})
2323
target_link_libraries(
24-
byte-span_test PRIVATE
25-
byte-span::byte-span
24+
ByteSpan_test PRIVATE
25+
ByteSpan::ByteSpan
2626
Catch2::Catch2WithMain
2727
)
28-
target_compile_features(byte-span_test PRIVATE cxx_std_20)
28+
target_compile_features(ByteSpan_test PRIVATE cxx_std_20)
2929

30-
catch_discover_tests(byte-span_test)
30+
catch_discover_tests(ByteSpan_test)
3131

3232
# ---- End-of-file commands ----
3333

0 commit comments

Comments
 (0)