Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.25)

set(CMAKE_CXX_STANDARD 23)
cmake_minimum_required(VERSION 3.30...4.3)

project(
beman.cstring_view # CMake Project Name, which is also the name of the top-level
Expand All @@ -26,20 +24,31 @@ option(
${PROJECT_IS_TOP_LEVEL}
)

option(
BEMAN_CSTRING_VIEW_INSTALL_CONFIG_FILE_PACKAGE
"Enable creating and installing a CMake config-file package. Default: ${PROJECT_IS_TOP_LEVEL}. Values: { ON, OFF }."
${PROJECT_IS_TOP_LEVEL}
# for find of beman-install-library
include(infra/cmake/beman-install-library.cmake)

add_library(beman.cstring_view INTERFACE)
add_library(beman::cstring_view ALIAS beman.cstring_view)

target_sources(
beman.cstring_view
PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
Comment on lines +34 to +35
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
beman.cstring_view
PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
beman.cstring_view
PUBLIC FILE_SET HEADERS BASE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"

)

set_target_properties(
beman.cstring_view
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
Comment on lines +39 to +40
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
beman.cstring_view
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}
beman.cstring_view
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ${PROJECT_IS_TOP_LEVEL}

)

include(CTest)
add_subdirectory(include/beman/cstring_view)

add_subdirectory(src/beman/cstring_view)
beman_install_library(beman.cstring_view TARGETS beman.cstring_view)

if(BEMAN_CSTRING_VIEW_BUILD_TESTS)
add_subdirectory(tests/beman/cstring_view)
enable_testing()
add_subdirectory(tests/beman/cstring_view)
Comment on lines +48 to +49
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
enable_testing()
add_subdirectory(tests/beman/cstring_view)
enable_testing()
add_subdirectory(tests/beman/cstring_view)

endif()

if(BEMAN_CSTRING_VIEW_BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(examples)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pre-commit] reported by reviewdog 🐶

Suggested change
add_subdirectory(examples)
add_subdirectory(examples)

endif()
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "./infra/cmake/use-fetch-content.cmake"
}
Expand Down
Loading
Loading