When importing nmos-cpp into a project using conan and CMake the following error occurs when configuring the project CMake cache.
CMake Error at cmake/NmosCppDependencies.cmake:267 (target_link_libraries):
The link interface of target "DNSSD" contains:
Avahi::compat-libdns_sd
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Call Stack (most recent call first):
CMakeLists.txt:21 (include)
I have been able to fix/work-around the issue by removing the avahi folder in .conan/data and manually installing the earliest revision of Avahi by doing:
conan install avahi/0.8@#045ad530d68fcb08ffda15df2ad838ed
The issue seems to be that the find_package(Avahi) (cmake/NmosCppDependencies.cpp:262) is finding the conan installed version of avahi, and it is not using the customised "third_party/cmake/FindAvahi.cmake". It is the custom file that defines the target "Avahi::compat-libdns_sd" and since that file is not being used, the target is not defined.
This docker file Dockerfile.txt can be used to reproduce the error using the command "docker build . -t nmos-cpp-conan" (assuming Dockerfile is in current folder and .txt extension removed). Note that both zlib and openssl need to be explicitly defined in the conanfile.txt in order to fix version incompatibilities.
When importing nmos-cpp into a project using conan and CMake the following error occurs when configuring the project CMake cache.
I have been able to fix/work-around the issue by removing the avahi folder in .conan/data and manually installing the earliest revision of Avahi by doing:
conan install avahi/0.8@#045ad530d68fcb08ffda15df2ad838ed
The issue seems to be that the find_package(Avahi) (cmake/NmosCppDependencies.cpp:262) is finding the conan installed version of avahi, and it is not using the customised "third_party/cmake/FindAvahi.cmake". It is the custom file that defines the target "Avahi::compat-libdns_sd" and since that file is not being used, the target is not defined.
This docker file Dockerfile.txt can be used to reproduce the error using the command "docker build . -t nmos-cpp-conan" (assuming Dockerfile is in current folder and .txt extension removed). Note that both zlib and openssl need to be explicitly defined in the conanfile.txt in order to fix version incompatibilities.