Skip to content

Commit c654109

Browse files
committed
Add an alias library to Cmake
Lets people building in-tree to link against the same target as people using find_package.
1 parent 3da5577 commit c654109

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ find_package(ZLIB QUIET)
1919
include(GNUInstallDirs)
2020

2121
add_library(${PROJECT_NAME} INTERFACE)
22+
# Lets you address the target with httplib::httplib
23+
# Only useful if building in-tree, versus using it from an installation.
24+
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
2225

2326
# Might be missing some, but this list is somewhat comprehensive
2427
target_compile_features(${PROJECT_NAME} INTERFACE

0 commit comments

Comments
 (0)