ADD_SUBDIRECTORY(plugins)
############################################################
-# installs the pkgconfig file
+# installs the pkgconfig files
CONFIGURE_FILE(afb-daemon.pc.in afb-daemon.pc @ONLY)
+CONFIGURE_FILE(afb-wsc.pc.in afb-wsc.pc @ONLY)
INSTALL(FILES
${CMAKE_CURRENT_BINARY_DIR}/afb-daemon.pc
+ ${CMAKE_CURRENT_BINARY_DIR}/afb-wsc.pc
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
--- /dev/null
+##
+## Copyright (C) 2016 "IoT.bzh"
+## Author: José Bollo <jose.bollo@iot.bzh>
+##
+## This file is part of afb-daemon project.
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+
+Name: @PROJECT_PRETTY_NAME@
+Description: @PROJECT_DESCRIPTION@
+Version: @PROJECT_VERSION@
+URL: @PROJECT_URL@
+
+Requires: json-c libsystemd
+Cflags: -I${includedir}
+Libs: -L${libdir} -lafbwsc
+
websock.c
)
+###########################################
+# build and install afb-daemon
+###########################################
ADD_EXECUTABLE(afb-daemon main.c)
TARGET_LINK_LIBRARIES(afb-daemon
afb-lib
INSTALL(TARGETS afb-daemon
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+###########################################
+# build and install libafbwsc
+###########################################
+ADD_LIBRARY(afbwsc SHARED afb-ws.c afb-ws-client.c afb-wsj1.c websock.c afb-common.c)
+TARGET_LINK_LIBRARIES(afbwsc
+ ${libsystemd_LIBRARIES}
+ -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export-afbwsc.map
+ -Wl,--as-needed
+ -Wl,--gc-sections
+)
+INSTALL(TARGETS afbwsc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+INSTALL(FILES afb-wsj1.h afb-ws-client.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/afb)
+
+###########################################
+# build and install afb-client-demo
+###########################################
ADD_EXECUTABLE(afb-client-demo afb-client-demo.c)
TARGET_LINK_LIBRARIES(afb-client-demo
- afb-lib
+ afbwsc
${link_libraries}
${libsystemd_LIBRARIES}
)
INSTALL(TARGETS afb-client-demo
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+
#include <systemd/sd-event.h>
-#include "afb-common.h"
+#include "afb-common.h" /* TODO: remove dependency to afb-common.h */
#include "afb-wsj1.h"
#include "afb-ws-client.h"
--- /dev/null
+{
+global:
+ afb_ws_client_connect_wsj1;
+ afb_wsj1_*;
+ afb_common_*;
+local:
+ *;
+};
+