Allow using cppcodec as a CMake dependency #76
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
need more info
need verification for fix
not so hard
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-tplgy/cppcodec!76
Loading…
Reference in a new issue
No description provided.
Delete branch "modern-cmake"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A continuation/refinement of PR #73, which does not get updates as the author wasn't the submitter of the PR. This PR I can change and hopefully merge.
This makes CMakeLists.txt suitable for inclusion into a
parent CMake project via
add_subdirectory()command,and defines the
cppcodectarget asINTERFACElibrary.Use it in a
target_link_libraries()command as dependencyin order to add cppcodec's include directories to your target.
The minimum CMake requirement is now 3.13, picking up various
improvements to
INTERFACElibrary targets and avoiding anyconfusion around CMake policy CMP0076, a behavior changed in 3.13.
The CMake build will now build tests, examples and tools if built
stand-alone, but exclude them if built as part of another project.
This can be customized via
CPPCODEC_BUILD_{TESTING,EXAMPLES,TOOLS}CMake definitions for a given build.
Fixes #60
Fixes #61
This commit is based on changes by Quintz Gábor (@quiga on GitHub),
but modified and extended in a number of ways.
Thanks also to Aditya Gupta (@adi-g15), anonymous @ghuser404
and Kingsley Chen (@kingsamchen) for keeping this issue on
my radar and providing valuable feedback.
Includes an extra commit for standard CMake formatting with gersemi. The main commit changes only lines with semantic differences.
this works wonderfully, I am looking forward to it being merged
Works fine as a git submodule, with
add_subdirectoryinCMakeLists.txtnow :DThanks for implementing this 😅
I'm using it via CMake's fetchcontent: