docopt.cpp
docopt.cpp copied to clipboard
Add CMake imported target for docopt library
This PR writes the CMake config-file package using CMakePackageConfigHelpers and exports the target as a Docopt::docopt
imported target.
This allows developers to install and use the library without necessarily requiring root
permission by:
- Installing docopt with
-DCMAKE_INSTALL_PREFIX="${HOME}/wherever"
- then using with
-DCMAKE_PREFIX_PATH="${HOME}/wherever"
and linking to imported targetDocopt::docopt
.
Keeping in mind the newly released FetchContent and find_package() integration, also add an alias target so that Docopt::docopt
can be linked to regardless of whether the build uses a prebuilt package or fetches the sources.
added missing newline to docopt-config.cmake.in
.
@jaredgrubb : if you could take a look? I will be submitting packaging to Buildroot soonish.