Fix #1284, add export targets and package script #1313
Merged
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.
Checklist (Please check before submitting)
Describe the contribution
Adds optional "install" commands to CMake script, which is useful when building OSAL as a standalone software package. The public API and static libraries will be installed to the specified system location, and can then be used to compile and link external OSAL applications without the need for the original OSAL source or build trees.
Note this also installs the "osconfig.h" file as this does affect the binary formats of some items (i.e. size of items using OS_MAX_API_NAME and other similar structure members). The external application must be compiled using the same osconfig.h after installation.
Fixes #1284
Testing performed
Build OSAL with both CFE and standalone and run all tests (existing build)
Then run "make install" on standalone build to stage headers and library binaries to a build tree. Tested an external application to using
find_package(NasaOsal)
and building against the OSAL headers and binaries provided by that exported package.Expected behavior changes
Exports a CMake package containing targets that can be used by OTHER builds without necessarily having the full OSAL source tree integrated into that project.
System(s) tested on
Ubuntu 22.04
Additional context
This is necessary when developing standalone (non-CFE) software that still uses OSAL to provide portability to different systems and/or does any unit testing (the exported packages includes UT assert).
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.