--- /dev/null
+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)
--- /dev/null
+# 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