-
Notifications
You must be signed in to change notification settings - Fork 17
Feature/export config package #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
ClausKlein
wants to merge
15
commits into
bemanproject:main
from
ClausKlein:feature/export-config-package
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
83c9a98
Add verify to build presets
steve-downey c429662
Export cmake config package
ClausKlein 73fde6b
Add find-package-test
ClausKlein e530c3f
Restructure cmake preset
ClausKlein aa94639
Trigger find-packge-test
ClausKlein 72f4370
Test to find installed package on CI too
ClausKlein b29852d
Add missing Debug build type for CI
ClausKlein b70856b
Setup that test depends on all
ClausKlein 405286d
Use cmake workflow preset on CI
ClausKlein 37b2991
Use right toolchain for preset name
ClausKlein c0f2538
It seems clang-17 builds only with -std=c++20 ?
ClausKlein be88ef6
Merge branch 'main' into feature/export-config-package
ClausKlein fb64c34
Fix merge problems
ClausKlein 0302fc1
Merge branch 'main' into feature/export-config-package
ClausKlein 0505f9c
Validate and format json files too
ClausKlein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| --- | ||
| Language: Json | ||
| IndentWidth: 2 | ||
| --- | ||
| Language: Cpp | ||
| AccessModifierOffset: -2 | ||
| AlignAfterOpenBracket: Align | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,15 +2,20 @@ | |
| # | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| cmake_minimum_required(VERSION 3.27) | ||
| set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE) | ||
|
|
||
| project(beman_optional26 VERSION 0.0.0 LANGUAGES CXX) | ||
| cmake_minimum_required(VERSION 3.29...3.31) | ||
|
|
||
| project(beman_optional26 VERSION 0.0.1 LANGUAGES CXX) | ||
|
|
||
| # Includes | ||
| include(CTest) | ||
| include(FetchContent) | ||
| include(CPack) | ||
| include(GNUInstallDirs) | ||
| include(CMakePackageConfigHelpers) | ||
|
|
||
| set(TARGETS_EXPORT_NAME ${CMAKE_PROJECT_NAME}Targets) | ||
| set(TARGET_PACKAGE_NAME ${PROJECT_NAME}) | ||
| set(TARGETS_EXPORT_NAME ${TARGET_PACKAGE_NAME}-targets) | ||
| set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${TARGET_PACKAGE_NAME}) | ||
|
|
||
| option( | ||
| OPTIONAL26_ENABLE_TESTING | ||
|
|
@@ -20,6 +25,8 @@ option( | |
|
|
||
| # Build the tests if enabled via the option OPTIONAL26_ENABLE_TESTING | ||
| if(OPTIONAL26_ENABLE_TESTING) | ||
| include(FetchContent) | ||
|
|
||
| # Fetch GoogleTest | ||
| FetchContent_Declare( | ||
| googletest | ||
|
|
@@ -29,12 +36,15 @@ if(OPTIONAL26_ENABLE_TESTING) | |
| e39786088138f2749d64e9e90e0f9902daa77c40 # release-1.15.0 | ||
| ) | ||
| FetchContent_MakeAvailable(googletest) | ||
|
|
||
| enable_testing() | ||
| endif() | ||
|
|
||
| set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ON) | ||
|
|
||
| # Create the library target and named header set for beman_optional26 | ||
| add_library(beman_optional26 INTERFACE) | ||
| add_library(Beman::Optional26::beman_optional26 ALIAS beman_optional26) | ||
| target_sources( | ||
| beman_optional26 | ||
| PUBLIC FILE_SET beman_optional26_headers TYPE HEADERS BASE_DIRS include | ||
|
|
@@ -59,23 +69,24 @@ add_subdirectory(include/beman/optional26) | |
|
|
||
| add_subdirectory(examples) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: examples should be optional with an |
||
|
|
||
| include(CMakePackageConfigHelpers) | ||
| # install | ||
| write_basic_package_version_file( | ||
| ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-config-version.cmake | ||
| VERSION ${PROJECT_VERSION} | ||
| COMPATIBILITY AnyNewerVersion | ||
| ) | ||
|
|
||
| # This will be used to replace @PACKAGE_cmakeModulesDir@ | ||
| set(cmakeModulesDir cmake/beman) | ||
| configure_package_config_file( | ||
| cmake/Config.cmake.in | ||
| BemanOptional26Config.cmake | ||
| INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman/optional26/ | ||
| PATH_VARS cmakeModulesDir | ||
| NO_SET_AND_CHECK_MACRO | ||
| NO_CHECK_REQUIRED_COMPONENTS_MACRO | ||
| ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-config.cmake | ||
| INSTALL_DESTINATION ${INSTALL_CONFIGDIR} | ||
| ) | ||
|
|
||
| install( | ||
| FILES ${CMAKE_CURRENT_BINARY_DIR}/BemanOptional26Config.cmake | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/beman/optional26/ | ||
| COMPONENT beman_optional26_development | ||
| FILES | ||
| ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-config.cmake | ||
| ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-config-version.cmake | ||
| DESTINATION ${INSTALL_CONFIGDIR} | ||
| ) | ||
|
|
||
| # Coverage | ||
|
|
@@ -87,4 +98,5 @@ add_custom_target( | |
| COMMENT "Running gcovr to process coverage results" | ||
| COMMAND mkdir -p coverage | ||
| COMMAND gcovr --config gcovr.cfg . | ||
| DEPENDS test | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.