I want to build my project using libwebsockets with mbedtls. I have used FetchContent_Declare() and FetchContent_GetProperties() along with add_subdirectory() to pull in the repos and now I'm stuck in the configuration phase with the following errors:
CMake Error in build/_deps/libwebsockets-src/CMakeLists.txt:
export called with target "websockets" which requires target "mbedtls" that
is not in any export set.
CMake Error in build/_deps/libwebsockets-src/CMakeLists.txt:
export called with target "websockets" which requires target "mbedcrypto"
that is not in any export set.
CMake Error in build/_deps/libwebsockets-src/CMakeLists.txt:
export called with target "websockets" which requires target "mbedx509"
that is not in any export set.
I've had a look at the mbedtls code and confirmed that they in fact ARE in the MbedTLSTargets
export set:
set(target_libraries ${mbedcrypto_target} ${mbedx509_target} ${mbedtls_target})
# ...
foreach(target IN LISTS target_libraries)
# ...
install(
TARGETS ${target}
EXPORT MbedTLSTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
endforeach(target)
I don't understand how those export informations are not propagated to the upstream consumer (libwebsockets
). Do I specifically have to redeclare the export rules for those targets in my main project?