-
Notifications
You must be signed in to change notification settings - Fork 19
add support for FILE_SET HEADERS #31
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
Open
ClausKlein
wants to merge
7
commits into
TheLartians:master
Choose a base branch
from
ClausKlein:feature/test-fileset-headers
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f8e45a8
add support for FILE_SET HEADERS
ClausKlein 29c7f17
fix clang-format
ClausKlein a059986
Update used CPM.cmake version
ClausKlein 4231832
Update README.md too
ClausKlein 3098d49
cmake-format all files again
ClausKlein 43741c1
Final cleanup
ClausKlein 2729bbc
Fix typo with codespell
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 |
|---|---|---|
|
|
@@ -60,3 +60,4 @@ parse: | |
| CPACK: 1 | ||
| RUNTIME_DESTINATION: 1 | ||
| DEPENDENCIES: + | ||
| HEADER_SETS: + | ||
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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| /build | ||
| .*.swp | ||
| build/ | ||
| /out | ||
| /.vs | ||
| /.cache | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| cmake_minimum_required(VERSION 3.14...3.22) | ||
| cmake_minimum_required(VERSION 3.24...3.31) | ||
|
|
||
| project( | ||
| dependency | ||
|
|
||
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,28 +1,49 @@ | ||
| cmake_minimum_required(VERSION 3.14...3.22) | ||
| cmake_minimum_required(VERSION 3.24...3.31) | ||
|
|
||
| project( | ||
| header_only | ||
| VERSION 1.0 | ||
| VERSION 1.0.0.0 | ||
| LANGUAGES CXX | ||
| DESCRIPTION "A header only dependency for testing PackageProject.cmake" | ||
| ) | ||
|
|
||
| add_library(${PROJECT_NAME} INTERFACE) | ||
| add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../.. PackageProject) | ||
|
|
||
| target_include_directories( | ||
| dependency PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:include/${PROJECT_NAME}-${PROJECT_VERSION}> | ||
| ) | ||
| # supported in CMake 3.23 and newer | ||
| set(CMAKE_VERIFY_INTERFACE_HEADER_SETS ON) | ||
|
|
||
| add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../.. PackageProject) | ||
| add_library(header_only INTERFACE) | ||
|
|
||
| string(TOLOWER ${PROJECT_NAME}/version.h VERSION_HEADER_LOCATION) | ||
| string(TOUPPER ${PROJECT_NAME} UPPERCASE_PROJECT_NAME) | ||
| set(${UPPERCASE_PROJECT_NAME}_VERSION \"${PROJECT_VERSION}\") | ||
| configure_file(${PACKAGE_PROJECT_ROOT_PATH}/version.h.in ${VERSION_HEADER_LOCATION} @ONLY) | ||
|
|
||
| if(CMAKE_VERIFY_INTERFACE_HEADER_SETS) | ||
| target_sources( | ||
| header_only | ||
| PUBLIC FILE_SET | ||
| HEADERS | ||
| BASE_DIRS | ||
| include | ||
| ${PROJECT_BINARY_DIR} | ||
| FILES | ||
| include/header_only/adder.h | ||
| ${PROJECT_BINARY_DIR}/${VERSION_HEADER_LOCATION} | ||
| ) | ||
| else() | ||
| target_include_directories( | ||
| header_only INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:include> | ||
| ) | ||
| endif() | ||
|
|
||
| packageProject( | ||
| NAME ${PROJECT_NAME} | ||
| VERSION ${PROJECT_VERSION} | ||
| BINARY_DIR ${PROJECT_BINARY_DIR} | ||
| INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include | ||
| INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} | ||
| VERSION_HEADER "${PROJECT_NAME}/version.h" | ||
| INCLUDE_DESTINATION include | ||
| DEPENDENCIES "" | ||
| CPACK "${TEST_CPACK}" | ||
| HEADER_SETS HEADERS | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| cmake_minimum_required(VERSION 3.14) | ||
| cmake_minimum_required(VERSION 3.24...3.31) | ||
|
|
||
| project(StyleCheck) | ||
|
|
||
|
|
||
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 |
|---|---|---|
| @@ -1,21 +1,24 @@ | ||
| set(CPM_DOWNLOAD_VERSION 0.35.0) | ||
| # SPDX - License - Identifier : MIT | ||
| # | ||
| # SPDX - FileCopyrightText : Copyright(c) 2019 - 2023 Lars Melchior and contributors | ||
|
|
||
| set(CPM_DOWNLOAD_VERSION 0.40.6) | ||
| set(CPM_HASH_SUM "3440292907e35353bf0761049d3680e9ed0031443c8ebeb9cbb6a421c4550ec1") | ||
|
|
||
| if(CPM_SOURCE_CACHE) | ||
| # Expand relative path. This is important if the provided path contains a tilde (~) | ||
| get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE) | ||
| set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
| elseif(DEFINED ENV{CPM_SOURCE_CACHE}) | ||
| set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
| elseif(DEFINED $ENV{CPM_SOURCE_CACHE}) | ||
| set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/" "CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
| else() | ||
| set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
| endif() | ||
|
|
||
| if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) | ||
| message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") | ||
| file(DOWNLOAD | ||
| https://github.com/TheLartians/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
| ${CPM_DOWNLOAD_LOCATION} | ||
| ) | ||
| endif() | ||
| # Expand relative path.This is important if the provided path contains a tilde(~) | ||
| get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) | ||
|
|
||
| file(DOWNLOAD | ||
| https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
| ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
| ) | ||
|
|
||
| include(${CPM_DOWNLOAD_LOCATION}) |
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.