Skip to content

Commit

Permalink
Apply pre-commit run --all-files
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausKlein committed Nov 19, 2024
1 parent dc8858e commit 4bbbe4e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 48 deletions.
103 changes: 56 additions & 47 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ cmake_minimum_required(VERSION 3.25...3.31)
project(
beman_inplace_vector
VERSION 1.0.0
DESCRIPTION "A dynamically-resizable vector with fixed capacity and embedded storage"
DESCRIPTION
"A dynamically-resizable vector with fixed capacity and embedded storage"
LANGUAGES CXX
)

Expand All @@ -25,62 +26,70 @@ add_library(beman::beman_inplace_vector ALIAS beman_inplace_vector)

target_sources(
beman_inplace_vector
PUBLIC FILE_SET
inplace_vector_public_headers
TYPE
HEADERS
BASE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/include
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/include/beman/inplace_vector/inplace_vector.hpp"
PUBLIC
FILE_SET inplace_vector_public_headers
TYPE HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/include/beman/inplace_vector/inplace_vector.hpp"
)
set_target_properties(
beman_inplace_vector
PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON
)
set_target_properties(beman_inplace_vector PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)

block()
# copied from execution26:
set(TARGET_NAME beman_inplace_vector)
set(TARGET_NAMESPACE beman)
# set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME}) # FIXME: not used yet? CK
# set(TARGET_LIBRARY ${PROJECT_NAME})
# set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

# Install the InplaceVector library to the appropriate destination
install(
TARGETS beman_inplace_vector
EXPORT ${TARGETS_EXPORT_NAME}
FILE_SET inplace_vector_public_headers
# DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

if(EXISTS cmake/Config.cmake.in)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)

configure_package_config_file(
cmake/Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
# copied from execution26:
set(TARGET_NAME beman_inplace_vector)
set(TARGET_NAMESPACE beman)
# set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME}) # FIXME: not used yet? CK
# set(TARGET_LIBRARY ${PROJECT_NAME})
# set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY})
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config)
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

# Install the InplaceVector library to the appropriate destination
install(
TARGETS beman_inplace_vector
EXPORT ${TARGETS_EXPORT_NAME}
FILE_SET inplace_vector_public_headers
# DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake DESTINATION ${INSTALL_CONFIGDIR}
)

install(EXPORT ${TARGETS_EXPORT_NAME} FILE ${TARGETS_EXPORT_NAME}.cmake DESTINATION "${INSTALL_CONFIGDIR}"
if(EXISTS cmake/Config.cmake.in)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
VERSION ${CMAKE_PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)

configure_package_config_file(
cmake/Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}.cmake
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
DESTINATION ${INSTALL_CONFIGDIR}
)

install(
EXPORT ${TARGETS_EXPORT_NAME}
FILE ${TARGETS_EXPORT_NAME}.cmake
DESTINATION "${INSTALL_CONFIGDIR}"
NAMESPACE beman::
)
)

set(CPACK_GENERATOR TGZ)
include(CPack)

endif()
set(CPACK_GENERATOR TGZ)
include(CPack)
endif()
endblock()

if(INPLACE_VECTOR_BUILD_TESTING)
Expand Down
5 changes: 4 additions & 1 deletion src/beman/inplace_vector/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Tests
add_executable(beman.inplace_vector.test inplace_vector.test.cpp)

target_link_libraries(beman.inplace_vector.test PRIVATE beman::beman_inplace_vector)
target_link_libraries(
beman.inplace_vector.test
PRIVATE beman::beman_inplace_vector
)

add_test(NAME beman.inplace_vector.test COMMAND beman.inplace_vector.test)

0 comments on commit 4bbbe4e

Please sign in to comment.