Optionally support sig-c++-3.0
Fall back to sig-c++2.0 if not found Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
This commit is contained in:
@@ -4,10 +4,20 @@ project(i3ipc++)
|
||||
option(I3IPCpp_WITH_TESTS "Build unit tests executables" OFF)
|
||||
option(I3IPCpp_BUILD_EXAMPLES "Build example executables" OFF)
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(SIGCPP REQUIRED sigc++-2.0)
|
||||
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
|
||||
|
||||
file(GLOB_RECURSE SRC src/*.cpp)
|
||||
add_library(i3ipc++ ${SRC})
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
|
||||
pkg_check_modules(SIGCPP sigc++-3.0)
|
||||
if(SIGCPP_FOUND)
|
||||
target_compile_definitions(i3ipc++
|
||||
PUBLIC I3CPP_IPC_SIGCPP3=${SIGCPP_FOUND}
|
||||
)
|
||||
else()
|
||||
pkg_check_modules(SIGCPP REQUIRED sigc++-2.0)
|
||||
endif()
|
||||
|
||||
set(I3IPCpp_INCLUDE_DIRS
|
||||
${SIGCPP_INCLUDE_DIRS}
|
||||
@@ -31,8 +41,6 @@ set(I3IPCpp_LIBRARIES
|
||||
# set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -DDEBUG")
|
||||
# set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||
|
||||
file(GLOB_RECURSE SRC src/*.cpp)
|
||||
add_library(i3ipc++ ${SRC})
|
||||
|
||||
target_include_directories(i3ipc++
|
||||
PUBLIC
|
||||
|
||||
@@ -369,14 +369,21 @@ public:
|
||||
* Disconnect the event socket
|
||||
*/
|
||||
void disconnect_event_socket();
|
||||
|
||||
sigc::signal<void, const workspace_event_t&> signal_workspace_event; ///< Workspace event signal
|
||||
#ifdef I3CPP_IPC_SIGCPP3
|
||||
sigc::signal<void(const workspace_event_t&)> signal_workspace_event; ///< Workspace event signal
|
||||
sigc::signal<void()> signal_output_event; ///< Output event signal
|
||||
sigc::signal<void(const mode_t&)> signal_mode_event; ///< Output mode event signal
|
||||
sigc::signal<void(const window_event_t&)> signal_window_event; ///< Window event signal
|
||||
sigc::signal<void(const bar_config_t&)> signal_barconfig_update_event; ///< Barconfig update event signal
|
||||
sigc::signal<void(const binding_t&)> signal_binding_event; ///< Binding event signal
|
||||
sigc::signal<void(EventType, const std::shared_ptr<const buf_t>&)> signal_event; ///< i3 event signal @note Default handler routes event to signal according to type
|
||||
#else
|
||||
sigc::signal<void, const workspace_event_t&> signal_workspace_event; ///< Workspace event signal
|
||||
sigc::signal<void> signal_output_event; ///< Output event signal
|
||||
sigc::signal<void, const mode_t&> signal_mode_event; ///< Output mode event signal
|
||||
sigc::signal<void, const window_event_t&> signal_window_event; ///< Window event signal
|
||||
sigc::signal<void, const bar_config_t&> signal_barconfig_update_event; ///< Barconfig update event signal
|
||||
sigc::signal<void, const binding_t&> signal_binding_event; ///< Binding event signal
|
||||
sigc::signal<void, EventType, const std::shared_ptr<const buf_t>&> signal_event; ///< i3 event signal @note Default handler routes event to signal according to type
|
||||
#endif
|
||||
private:
|
||||
const int32_t m_main_socket;
|
||||
int32_t m_event_socket;
|
||||
|
||||
Reference in New Issue
Block a user