Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ add_subdirectory(apps)
add_subdirectory(tests)

set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libavahi-client3, avahi-daemon")
set(SERVUS_PACKAGE_DEB_DEPENDS)
if (avahi-client_FOUND)
list(APPEND SERVUS_PACKAGE_DEB_DEPENDS libavahi-client3 avahi-daemon)
endif()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be unconditional, otherwise catch-22

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get your point. This variable is set for packaging after configuration. If avahi was not present at configuration time you don't want to add it a as package dependency.
This is not to be confused with SERVUS_DEB_DEPENDS, which lists these packages unconditionally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I confused it with DEB_PACKAGES.

include(CommonCPack)

set(COMMON_PROJECT_DOMAIN eu.humanbrainproject)
Expand Down
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# git master

* [80](https://github.com/HBPVis/Servus/pull/80):
Failsafe when Servus implementation can't be created and fallback to dummy.
* [77](https://github.com/HBPVis/Servus/pull/77):
Add test driver implementation for Servus
* [76](https://github.com/HBPVis/Servus/pull/76):
Expand Down
15 changes: 12 additions & 3 deletions servus/servus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,21 @@ std::unique_ptr<Servus::Impl> _chooseImplementation(const std::string& name)
{
if (name == TEST_DRIVER)
return std::unique_ptr<Servus::Impl>(new test::Servus);
try
{
#ifdef SERVUS_USE_DNSSD
return std::unique_ptr<Servus::Impl>(new dnssd::Servus(name));
return std::unique_ptr<Servus::Impl>(new dnssd::Servus(name));
#elif defined(SERVUS_USE_AVAHI_CLIENT)
return std::unique_ptr<Servus::Impl>(new avahi::Servus(name));
return std::unique_ptr<Servus::Impl>(new avahi::Servus(name));
#endif
return std::unique_ptr<Servus::Impl>(new none::Servus(name));
return std::unique_ptr<Servus::Impl>(new none::Servus(name));
}
catch (const std::runtime_error& error)
{
std::cerr << "Error starting Servus client: " << error.what()
<< std::endl;
return std::unique_ptr<Servus::Impl>(new servus::none::Servus(name));
}
}
}

Expand Down