build(cmake)!: Add support for installation and usage as a library in other CMake projects; Add example project to test this use case.#65
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Previously, users of ystdlib needed to use it through
add_subdirectory. This PR updates ystdlib to allow installing selected ystdlib libraries and using them throughfind_package.When building ystdlib the user can define the CMake variable
ystdlib_LIBRARIESwith a semicolon separated list of ystdlib library names to build (if omitted all libraries are built). Then whencmake --installis run all built libraries will be installed and configured to work withfind_package.For
ystdlib_LIBRARIES, if a user lists a ystdlib library that depends on another ystdlib not listed that dependent library will be added to the list and built.This PR also adds an
examples/directory containing an example CMake project to:Support for using
COMPONENTSwithfind_packageto selectively depend on (installed) libraries is deferred to a future PR.This PR sets the minimum version of CMake to 3.23 to add support for
FILE_SETS.Checklist
breaking change.
Validation performed
Test cases still pass. Example builds and passes by manually running the following commands: