CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(bluetooth-hid-agent C)
+PROJECT(bluetooth-hid-agent C CXX)
SET(SRCS bluetooth-hid-agent.c bluetooth-hid-manager.c)
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_hid_agent_LDFLAGS})
+IF (BUILD_GTESTS)
+ # -fvisibility option should be "default" to call internal functions
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default -Werror -Wno-deprecated-declarations")
+
+ ADD_LIBRARY(hid-agent SHARED ${SRCS})
+ SET_TARGET_PROPERTIES(hid-agent
+ PROPERTIES
+ SOVERSION 0.1.0
+ CLEAN_DIRECT_OUTPUT 1)
+
+ TARGET_LINK_LIBRARIES(hid-agent ${pkgs_hid_agent_LDFLAGS})
+
+ INSTALL(TARGETS hid-agent DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
+ENDIF (BUILD_GTESTS)
+
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.hid_agent.service
DESTINATION share/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-hid-agent.conf DESTINATION /etc/dbus-1/system.d)