Skip to content

Commit

Permalink
Use Servus instead of Lunchbox, update CMake/common and generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Dumusc committed May 29, 2015
1 parent 6b145f7 commit 8f2608c
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .gitexternals
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- mode: cmake -*-
# CMake/common https://github.com/Eyescale/CMake.git 561da51
# CMake/common https://github.com/Eyescale/CMake.git a9c3537
2 changes: 1 addition & 1 deletion .gitsubprojects
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- mode: cmake -*-
git_subproject(Lunchbox https://github.com/Eyescale/Lunchbox.git 83ac6b6)
git_subproject(Servus https://github.com/HBPVIS/Servus d910737)
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq autoconf || /bin/true
- sudo apt-get install -qq automake || /bin/true
- sudo apt-get install -qq avahi-daemon || /bin/true
- sudo apt-get install -qq clang || /bin/true
- sudo apt-get install -qq clang-format-3.5 || /bin/true
- sudo apt-get install -qq cmake || /bin/true
Expand All @@ -30,6 +31,7 @@ before_install:
- sudo apt-get install -qq git-review || /bin/true
- sudo apt-get install -qq git-svn || /bin/true
- sudo apt-get install -qq lcov || /bin/true
- sudo apt-get install -qq libavahi-client-dev || /bin/true
- sudo apt-get install -qq libboost-date-time-dev || /bin/true
- sudo apt-get install -qq libboost-program-options-dev || /bin/true
- sudo apt-get install -qq libboost-serialization-dev || /bin/true
Expand Down
5 changes: 2 additions & 3 deletions CMake/Deflect.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

set(DEFLECT_PACKAGE_VERSION 0.4)
set(DEFLECT_PACKAGE_VERSION 0.5)
set(DEFLECT_REPO_URL https://github.com/BlueBrain/Deflect.git)

set(QT5CONCURRENT_CMAKE_INCLUDE "BEFORE SYSTEM")
set(DEFLECT_DEPENDS REQUIRED Boost LibJpegTurbo Qt5Concurrent Qt5Core Qt5Network
Qt5Widgets
OPTIONAL GLUT Lunchbox OpenGL)
OPTIONAL GLUT Servus OpenGL)
set(DEFLECT_BOOST_COMPONENTS "date_time program_options unit_test_framework serialization system thread")
set(DEFLECT_DEB_DEPENDS libjpeg-turbo8-dev libturbojpeg freeglut3-dev
libboost-test-dev libboost-date-time-dev libboost-program-options-dev
Expand Down
50 changes: 25 additions & 25 deletions CMake/FindPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ common_package(Qt5Core REQUIRED )
common_package(Qt5Network REQUIRED )
common_package(Qt5Widgets REQUIRED )
common_package(GLUT )
common_package(Servus 1.0 )
common_package(OpenGL )
common_package(Lunchbox )

if(EXISTS ${PROJECT_SOURCE_DIR}/CMake/FindPackagesPost.cmake)
include(${PROJECT_SOURCE_DIR}/CMake/FindPackagesPost.cmake)
Expand Down Expand Up @@ -220,6 +220,28 @@ if(GLUT_name)
endif()
endif()

if(SERVUS_FOUND)
set(Servus_name SERVUS)
set(Servus_FOUND TRUE)
elseif(Servus_FOUND)
set(Servus_name Servus)
set(SERVUS_FOUND TRUE)
endif()
if(Servus_name)
list(APPEND FIND_PACKAGES_DEFINES DEFLECT_USE_SERVUS)
if(NOT COMMON_LIBRARY_TYPE MATCHES "SHARED")
list(APPEND DEFLECT_DEPENDENT_LIBRARIES Servus)
endif()
set(FIND_PACKAGES_FOUND "${FIND_PACKAGES_FOUND} Servus")
link_directories(${${Servus_name}_LIBRARY_DIRS})
if(NOT "${${Servus_name}_INCLUDE_DIRS}" MATCHES "-NOTFOUND")
include_directories(${${Servus_name}_INCLUDE_DIRS})
endif()
if(NOT "${${Servus_name}_INCLUDE_DIR}" MATCHES "-NOTFOUND")
include_directories(${${Servus_name}_INCLUDE_DIR})
endif()
endif()

if(OPENGL_FOUND)
set(OpenGL_name OPENGL)
set(OpenGL_FOUND TRUE)
Expand All @@ -242,31 +264,9 @@ if(OpenGL_name)
endif()
endif()

if(LUNCHBOX_FOUND)
set(Lunchbox_name LUNCHBOX)
set(Lunchbox_FOUND TRUE)
elseif(Lunchbox_FOUND)
set(Lunchbox_name Lunchbox)
set(LUNCHBOX_FOUND TRUE)
endif()
if(Lunchbox_name)
list(APPEND FIND_PACKAGES_DEFINES DEFLECT_USE_LUNCHBOX)
if(NOT COMMON_LIBRARY_TYPE MATCHES "SHARED")
list(APPEND DEFLECT_DEPENDENT_LIBRARIES Lunchbox)
endif()
set(FIND_PACKAGES_FOUND "${FIND_PACKAGES_FOUND} Lunchbox")
link_directories(${${Lunchbox_name}_LIBRARY_DIRS})
if(NOT "${${Lunchbox_name}_INCLUDE_DIRS}" MATCHES "-NOTFOUND")
include_directories(${${Lunchbox_name}_INCLUDE_DIRS})
endif()
if(NOT "${${Lunchbox_name}_INCLUDE_DIR}" MATCHES "-NOTFOUND")
include_directories(${${Lunchbox_name}_INCLUDE_DIR})
endif()
endif()

set(DEFLECT_BUILD_DEBS autoconf;automake;cmake;doxygen;freeglut3-dev;git;git-review;libboost-date-time-dev;libboost-program-options-dev;libboost-serialization-dev;libboost-system-dev;libboost-test-dev;libboost-thread-dev;libjpeg-turbo8-dev;libturbojpeg;pkg-config;subversion)
set(DEFLECT_BUILD_DEBS autoconf;automake;avahi-daemon;cmake;doxygen;freeglut3-dev;git;git-review;libavahi-client-dev;libboost-date-time-dev;libboost-program-options-dev;libboost-serialization-dev;libboost-system-dev;libboost-test-dev;libboost-thread-dev;libjpeg-turbo8-dev;libturbojpeg;pkg-config;subversion)

set(DEFLECT_DEPENDS Boost;LibJpegTurbo;Qt5Concurrent;Qt5Core;Qt5Network;Qt5Widgets;GLUT;Lunchbox;OpenGL)
set(DEFLECT_DEPENDS Boost;LibJpegTurbo;Qt5Concurrent;Qt5Core;Qt5Network;Qt5Widgets;GLUT;Servus;OpenGL)

# Write defines.h and options.cmake
if(NOT PROJECT_INCLUDE_NAME)
Expand Down
13 changes: 10 additions & 3 deletions CMake/GitExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# update target to bump the tag to the master revision by
# recreating .gitexternals.
# * Provides function
# git_external(<directory> <giturl> <gittag> [NO_UPDATE, VERBOSE]
# git_external(<directory> <giturl> <gittag> [VERBOSE]
# [RESET <files>])
# which will check out directory in CMAKE_SOURCE_DIR (if relative)
# or in the given absolute path using the given repository and tag
Expand All @@ -29,7 +29,9 @@
# repositories, pointing to github.com/<user>/<project>. Defaults to user
# name or GIT_EXTERNAL_USER environment variable.

find_package(Git)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
if(NOT GIT_EXECUTABLE)
return()
endif()
Expand Down Expand Up @@ -81,7 +83,7 @@ function(GIT_EXTERNAL DIR REPO TAG)
if(NOT EXISTS "${DIR}")
message(STATUS "git clone ${REPO} ${DIR}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" clone "${REPO}" "${DIR}"
COMMAND "${GIT_EXECUTABLE}" clone --recursive "${REPO}" "${DIR}"
RESULT_VARIABLE nok ERROR_VARIABLE error
WORKING_DIRECTORY "${GIT_EXTERNAL_DIR}")
if(nok)
Expand Down Expand Up @@ -259,6 +261,11 @@ endif()")
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}")
add_dependencies(flatten_git_external
flatten_git_external_${GIT_EXTERNAL_NAME})

foreach(_target flatten_git_external_${GIT_EXTERNAL_NAME} flatten_git_external update_git_external_${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} update_git_external update)
set_target_properties(${_target} PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER "git")
endforeach()
endif()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion CMake/depends.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
config.bluebrain https://github.com/BlueBrain/config.git master
config.bluebrain https://github.com/BlueBrain/config.git master
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ set(VERSION_ABI 1)

set(DEFLECT_DESCRIPTION
"The client library to write applications for DisplayCluster")
set(DEFLECT_ISSUES_URL "https://github.com/BlueBrain/Deflect/issues")
set(DEFLECT_PACKAGE_URL "https://github.com/BlueBrain/Deflect/releases")
set(DEFLECT_DEPENDENT_LIBRARIES Boost)

include(Common)
Expand Down
1 change: 1 addition & 0 deletions apps/DesktopStreamer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ install(TARGETS ${DESKTOPSTREAMER_APP_NAME}
BUNDLE DESTINATION . COMPONENT desktopstreamer
)

set(CPACK_PACKAGE_LICENSE "LGPL")
include(CPackConfig)
10 changes: 5 additions & 5 deletions apps/DesktopStreamer/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MainWindow::MainWindow()
, y_(0)
, width_(0)
, height_(0)
#ifdef DEFLECT_USE_LUNCHBOX
#ifdef DEFLECT_USE_SERVUS
, servus_( deflect::NetworkListener::serviceName )
#endif
{
Expand Down Expand Up @@ -169,8 +169,8 @@ void MainWindow::setupUI()
// Update timer
connect(&updateTimer_, SIGNAL(timeout()), this, SLOT(update()));

#ifdef DEFLECT_USE_LUNCHBOX
servus_.beginBrowsing( lunchbox::Servus::IF_ALL );
#ifdef DEFLECT_USE_SERVUS
servus_.beginBrowsing( servus::Servus::IF_ALL );
connect( &browseTimer_, SIGNAL( timeout( )), this, SLOT( updateServus( )));
browseTimer_.start( SERVUS_BROWSE_DELAY );
#endif
Expand Down Expand Up @@ -317,7 +317,7 @@ void MainWindow::processStreamEvents()
}
}

#ifdef DEFLECT_USE_LUNCHBOX
#ifdef DEFLECT_USE_SERVUS
void MainWindow::updateServus()
{
if( hostnameLineEdit_.text() != DEFAULT_HOST_ADDRESS )
Expand All @@ -327,7 +327,7 @@ void MainWindow::updateServus()
}

servus_.browse( 0 );
const lunchbox::Strings& hosts = servus_.getInstances();
const servus::Strings& hosts = servus_.getInstances();
if( hosts.empty( ))
return;

Expand Down
10 changes: 5 additions & 5 deletions apps/DesktopStreamer/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#ifdef __APPLE__
# include "AppNapSuspender.h"
#endif
#ifdef DEFLECT_USE_LUNCHBOX
# include <lunchbox/servus.h>
#ifdef DEFLECT_USE_SERVUS
# include <servus/servus.h>
#endif

namespace deflect
Expand Down Expand Up @@ -73,7 +73,7 @@ private slots:
void showDesktopSelectionWindow(bool set);

void update();
#ifdef DEFLECT_USE_LUNCHBOX
#ifdef DEFLECT_USE_SERVUS
void updateServus();
#endif

Expand Down Expand Up @@ -119,9 +119,9 @@ private slots:
#ifdef __APPLE__
AppNapSuspender napSuspender_;
#endif
#ifdef DEFLECT_USE_LUNCHBOX
#ifdef DEFLECT_USE_SERVUS
QTimer browseTimer_;
lunchbox::Servus servus_;
servus::Servus servus_;
#endif

void setupUI();
Expand Down
4 changes: 2 additions & 2 deletions deflect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ if(DEFLECT_USE_LIBJPEGTURBO)
list(APPEND DEFLECT_LINK_LIBRARIES ${LibJpegTurbo_LIBRARIES})
endif()

if(DEFLECT_USE_LUNCHBOX)
list(APPEND DEFLECT_LINK_LIBRARIES ${LUNCHBOX_LIBRARIES})
if(DEFLECT_USE_SERVUS)
list(APPEND DEFLECT_LINK_LIBRARIES ${SERVUS_LIBRARIES})
endif()

common_library(Deflect)
12 changes: 6 additions & 6 deletions deflect/NetworkListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#include "PixelStreamDispatcher.h"
#include "CommandHandler.h"

#ifdef DEFLECT_USE_LUNCHBOX
# include <lunchbox/servus.h>
#ifdef DEFLECT_USE_SERVUS
# include <servus/servus.h>
# include <boost/lexical_cast.hpp>
#endif

Expand All @@ -61,15 +61,15 @@ class NetworkListener
{
public:
NetworkListener()
#ifdef DEFLECT_USE_LUNCHBOX
#ifdef DEFLECT_USE_SERVUS
: servus( deflect::NetworkListener::serviceName )
#endif
{}

PixelStreamDispatcher pixelStreamDispatcher;
CommandHandler commandHandler;
#ifdef DEFLECT_USE_LUNCHBOX
lunchbox::Servus servus;
#ifdef DEFLECT_USE_SERVUS
servus::Servus servus;
#endif
};
}
Expand All @@ -83,7 +83,7 @@ NetworkListener::NetworkListener( const int port )
const QString err = QString("could not listen on port: %1").arg(port);
throw std::runtime_error(err.toStdString());
}
#ifdef DEFLECT_USE_LUNCHBOX
#ifdef DEFLECT_USE_SERVUS
_impl->servus.announce( port, boost::lexical_cast< std::string >( port ));
#endif
}
Expand Down

0 comments on commit 8f2608c

Please sign in to comment.