Skip to content

Commit e30fb97

Browse files
Add Alias library for Drogon with name matching installed target (#2456)
- When using the library as a downloaded package, either by using as a submodule or downloading the source, we can only link to it by using the project name which is "drogon" - We can add an Alias library with the same target name that is used when the project is installed. - This way the cmake "target_link_library" Command would always refer to the library by the same name which is "Drogon::Drogon" while also avoiding the pitfall of the default behaviour of the command just adding the the target name to the link arguments if the library isn't found. Co-authored-by: Mathew Benson <mathew@benson.co.ke>
1 parent 597e15c commit e30fb97

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ if (WIN32)
134134
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/mman-win32>)
135135
endif (WIN32)
136136

137+
add_library(Drogon::Drogon ALIAS ${PROJECT_NAME})
138+
137139
if(USE_SUBMODULE)
138140
add_subdirectory(trantor)
139141
target_link_libraries(${PROJECT_NAME} PUBLIC trantor)

0 commit comments

Comments
 (0)