diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e7603..f671647 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,6 @@ cmake_minimum_required(VERSION 3.23) -option(BUILD_TESTING "Build tests" ON) - project( beman.inplace_vector VERSION 1.0.0 @@ -15,9 +13,19 @@ project( LANGUAGES CXX ) +# [CMAKE.SKIP_TESTS] +option( + BEMAN_INPLACE_VECTOR_BUILD_TESTS + "Enable building tests and test infrastructure. Default: ON. Values: { ON, OFF }." + ${PROJECT_IS_TOP_LEVEL} +) + include(GNUInstallDirs) add_library(beman.inplace_vector INTERFACE) +# [CMAKE.LIBRARY_ALIAS] +add_library(beman::inplace_vector ALIAS beman.inplace_vector) + target_include_directories( beman.inplace_vector INTERFACE @@ -42,7 +50,7 @@ install( "${CMAKE_CURRENT_SOURCE_DIR}/include/beman/inplace_vector/inplace_vector.hpp" ) -if(BUILD_TESTING) +if(BEMAN_INPLACE_VECTOR_BUILD_TESTS) include(CTest) - add_subdirectory(src/beman/inplace_vector/tests) + add_subdirectory(tests/beman/inplace_vector) endif() diff --git a/README.md b/README.md index 0abe9a6..1ea97a3 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,11 @@ SPDX-License-Identifier: --> -# beman.inplace\_vector +# beman.inplace\_vector: Dynamically-resizable vector with fixed capacity ![Continuous Integration Tests](https://github.com/bemanproject/inplace_vector/actions/workflows/ci_tests.yml/badge.svg) ![Code Format](https://github.com/bemanproject/inplace_vector/actions/workflows/pre-commit.yml/badge.svg) -A dynamically-resizable vector with fixed capacity and embedded storage - ## Implements - [`inplace_vector` P0843R14](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) diff --git a/src/beman/inplace_vector/tests/CMakeLists.txt b/tests/beman/inplace_vector/CMakeLists.txt similarity index 100% rename from src/beman/inplace_vector/tests/CMakeLists.txt rename to tests/beman/inplace_vector/CMakeLists.txt diff --git a/src/beman/inplace_vector/tests/inplace_vector.test.cpp b/tests/beman/inplace_vector/inplace_vector.test.cpp similarity index 100% rename from src/beman/inplace_vector/tests/inplace_vector.test.cpp rename to tests/beman/inplace_vector/inplace_vector.test.cpp