Skip to content

Commit 1ea7bd5

Browse files
committed
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`.
1 parent a820d38 commit 1ea7bd5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ConfigPackageLocation}/docopt-confi
114114
install(EXPORT ${export_name}
115115
DESTINATION "${CMAKE_INSTALL_LIBDIR}/${ConfigPackageLocation}"
116116
NAMESPACE Docopt::)
117+
add_library(Docopt::docopt ALIAS docopt)
117118

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

0 commit comments

Comments
 (0)