adds dummy files for client library
authorJeonghoon Park <jh1979.park@samsung.com>
Tue, 17 Apr 2018 08:35:35 +0000 (17:35 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Tue, 17 Apr 2018 08:35:35 +0000 (17:35 +0900)
lib/CMakeLists.txt [new file with mode: 0644]
lib/include/things-service-lib.h [new file with mode: 0644]
lib/libthings-service.pc.in [new file with mode: 0644]
lib/src/things-service-lib.c [new file with mode: 0644]

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..bf1cdae
--- /dev/null
@@ -0,0 +1,53 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(CMAKE_VERBOSE_MAKEFILE 0)
+SET(LIB libthings-service)
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(LIB_TTS_PKGS REQUIRED
+       glib-2.0
+       dlog
+)
+
+FOREACH (flag ${LIB_TTS_PKGS_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Winline -g")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${INSTALL_LIB_DIR}")
+
+FILE(GLOB LIB_TTS_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
+INCLUDE_DIRECTORIES(${INCLUDE_DIR})
+
+ADD_LIBRARY(${LIB} SHARED ${LIB_TTS_SOURCE})
+TARGET_LINK_LIBRARIES(${LIB} ${LIB_TTS_LDFLAGS})
+
+SET_TARGET_PROPERTIES(${LIB}
+       PROPERTIES
+       VERSION ${FULL_VER}
+       SOVERSION ${MAJOR_VER}
+       CLEAN_DIRECT_OUTPUT 1
+)
+INSTALL(TARGETS ${LIB} DESTINATION ${INSTALL_LIB_DIR})
+
+INSTALL(
+       DIRECTORY ${INCLUDE_DIR}/ DESTINATION ${INSTALL_INC_DIR}
+       FILES_MATCHING
+       PATTERN "*_private.h" EXCLUDE
+       PATTERN "*.h"
+)
+
+# pkg-config file
+SET(PC_DENPS "") # add package name here if you have exposed lib in your library.
+SET(PC_NAME ${LIB})
+SET(PC_REQUIRED ${PC_DENPS})
+SET(PC_LDFLAGS -l${LIB})
+
+CONFIGURE_FILE(
+       ${LIB}.pc.in
+       ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc
+       @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${LIB}.pc DESTINATION ${INSTALL_LIB_DIR}/pkgconfig)
diff --git a/lib/include/things-service-lib.h b/lib/include/things-service-lib.h
new file mode 100644 (file)
index 0000000..b7c6afc
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef __TT_SERVICE_LIB_H__
+#define __TT_SERVICE_LIB_H__
+
+int test_API(void);
+
+#endif /* __TT_SERVICE_LIB_H__ */
diff --git a/lib/libthings-service.pc.in b/lib/libthings-service.pc.in
new file mode 100644 (file)
index 0000000..e2fdda2
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@INSTALL_LIB_DIR@
+includedir=@INSTALL_INC_DIR@
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
\ No newline at end of file
diff --git a/lib/src/things-service-lib.c b/lib/src/things-service-lib.c
new file mode 100644 (file)
index 0000000..bd3ee6c
--- /dev/null
@@ -0,0 +1,6 @@
+#include <glib.h>
+
+int test_API(void)
+{
+       return 0;
+}
\ No newline at end of file