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 target Docopt::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.
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:-DCMAKE_INSTALL_PREFIX="${HOME}/wherever"
-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.