-
Notifications
You must be signed in to change notification settings - Fork 19
Install sets #73
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
Merged
Merged
Install sets #73
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # include/beman/optional26/CMakeLists.txt -*-cmake-*- | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| target_sources( | ||
| beman_optional26 | ||
| PUBLIC | ||
| FILE_SET beman_optional26_headers | ||
| TYPE HEADERS | ||
| FILES | ||
| optional.hpp | ||
| detail/iterator.hpp | ||
| detail/stl_interfaces/config.hpp | ||
| detail/stl_interfaces/fwd.hpp | ||
| detail/stl_interfaces/iterator_interface.hpp | ||
| ) |
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,40 +1,26 @@ | ||
| # cmake-format: off | ||
| # src/beman/optional26/CMakeLists.txt -*-makefile-*- | ||
| # src/beman/optional26/CMakeLists.txt -*-cmake-*- | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| # cmake-format: on | ||
|
|
||
| add_library(beman_optional26 STATIC optional.cpp detail/iterator.cpp) | ||
|
|
||
| include(GNUInstallDirs) | ||
| include_directories(${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
||
| target_include_directories( | ||
| beman_optional26 | ||
| PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../include> | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../src/> | ||
| $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}> | ||
| ) | ||
| # Ensure that optional and iterator get compiled at least once | ||
| target_sources(beman_optional26 PUBLIC optional.cpp detail/iterator.cpp) | ||
|
|
||
| # The library is empty -- exclude it | ||
| install( | ||
| TARGETS beman_optional26 | ||
| EXPORT ${TARGETS_EXPORT_NAME} | ||
| DESTINATION | ||
| ${CMAKE_INSTALL_LIBDIR} | ||
| ARCHIVE | ||
| DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| COMPONENT beman_optional26_library | ||
| EXCLUDE_FROM_ALL | ||
| ) | ||
|
|
||
| string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_LOWER_PROJECT_NAME) | ||
|
|
||
| install( | ||
| DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME} | ||
| FILES_MATCHING | ||
| PATTERN "*.hpp" | ||
| TARGETS beman_optional26 | ||
| FILE_SET beman_optional26_headers | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| COMPONENT beman_optional26_development | ||
| ) | ||
|
|
||
| target_link_libraries(beman_optional26) | ||
|
|
||
| # Tests | ||
| if(BUILD_TESTING) | ||
| if(OPTIONAL26_ENABLE_TESTING) | ||
| add_subdirectory(tests) | ||
| endif() |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remind me why BUILD_TESTING is not enough/OK ?
The Beman Standard specify to have
BUILD_TESTING.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't compose. Best practice for Cmake is to prefix options with the project they apply to, and to default the value to true for a top level project.
Patten documented in Professional CMake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that it's the best practice from CMake docs, but I would expect to first make a PR in the Beman Standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fortunately, it's a recommendation, but I'll PR that, now that I've seen it. But since this actually breaks trying to compose this into another beman project, it would be nice to fix it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeffGarland should we make it a requirement?