Skip to content

Commit

Permalink
Add alias target with same Prefix as namespace
Browse files Browse the repository at this point in the history
With the alias, the `Docopt::docopt` target can be linked to regardless
of whether the consuming project uses `find_package` or
`add_subdirectory`.
  • Loading branch information
eaaltonen committed Oct 17, 2022
1 parent a820d38 commit 1ea7bd5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ConfigPackageLocation}/docopt-confi
install(EXPORT ${export_name}
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${ConfigPackageLocation}"
NAMESPACE Docopt::)
add_library(Docopt::docopt ALIAS docopt)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docopt.pc.in ${CMAKE_CURRENT_BINARY_DIR}/docopt.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/docopt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Expand Down

0 comments on commit 1ea7bd5

Please sign in to comment.