It is currently not possible to build STATIC and SHARED libraries at the same time with CMake.
CMake Error at CMakeLists.txt:106 (add_library):
add_library cannot create ALIAS target "llhttp::llhttp" because another
target with the same name already exists.
You have add_library(llhttp::llhttp ALIAS llhttp_shared) twice in CMakeLists.txt.
Also it would be nice if the IMPORTED target in CMake could be llhttp:llhttp as an alias in addition to existing llhttp::llhttp_shared and llhttp::llhttp_static.
Currently we use this to detect it.
find_package(llhttp REQUIRED)
if(TARGET llhttp::llhttp_shared)
add_library(llhttp::llhttp ALIAS llhttp::llhttp_shared)
elseif(TARGET llhttp::llhttp_static)
add_library(llhttp::llhttp ALIAS llhttp::llhttp_static)
else()
message(FATAL_ERROR "TARGET of llhttp not found")
endif()
add_library(OurLibrary)
...
target_link_libraries(OurLibrary llhttp::llhttp)
It is currently not possible to build STATIC and SHARED libraries at the same time with CMake.
You have
add_library(llhttp::llhttp ALIAS llhttp_shared)twice in CMakeLists.txt.Also it would be nice if the
IMPORTEDtarget in CMake could bellhttp:llhttpas an alias in addition to existingllhttp::llhttp_sharedandllhttp::llhttp_static.Currently we use this to detect it.