From 01ad9333d1c23303233d807e783052ebe3902769 Mon Sep 17 00:00:00 2001 From: Eero Aaltonen Date: Fri, 14 Oct 2022 17:52:45 +0300 Subject: [PATCH] Add alias target with same Prefix as namespace With the alias, the `Docopt::docopt` target can be linked to regardless of whether the consuming project uses `find_package` or `add_subdirectory`. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index da29dde..552e043 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)