1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
6 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
7 SET(CMAKE_BUILD_TYPE "Debug")
8 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
11 MESSAGE(">>> current directory: ${CMAKE_CURRENT_SOURCE_DIR}")
12 MESSAGE(">>> Build type: ${CMAKE_BUILD_TYPE}")
14 SET(VISIBILITY "-DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\"")
15 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VISIBILITY} -fvisibility=hidden")
16 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--gc-sections")
18 ##########################################################
19 # Define Service Adaptor CLIENT
20 ##########################################################
22 SET(CLIENT-LIB "sal-client")
24 ${CMAKE_SOURCE_DIR}/client/sal_core_api.c
28 ${CMAKE_SOURCE_DIR}/include
29 ${CMAKE_SOURCE_DIR}/common
30 ${CMAKE_SOURCE_DIR}/common/ipc
31 ${CMAKE_SOURCE_DIR}/client
32 ${CMAKE_SOURCE_DIR}/adaptor/auth-adaptor
33 ${CMAKE_SOURCE_DIR}/adaptor/contact-adaptor
34 ${CMAKE_SOURCE_DIR}/adaptor/storage-adaptor
37 INCLUDE(FindPkgConfig)
38 pkg_check_modules(client_pkgs REQUIRED dlog glib-2.0)
40 FOREACH(flag ${client_pkgs_CFLAGS})
41 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
44 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
46 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
48 ADD_LIBRARY(${CLIENT-LIB} SHARED ${CLIENT-SRCS})
50 TARGET_LINK_LIBRARIES(${CLIENT-LIB} ${client_pkgs_LDFLAGS} sal-common)
51 SET_TARGET_PROPERTIES(${CLIENT-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
52 SET_TARGET_PROPERTIES(${CLIENT-LIB} PROPERTIES VERSION ${VERSION})
54 INSTALL(TARGETS ${CLIENT-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
56 SET(SAL-CLIENT-HEADERS
57 ${CMAKE_SOURCE_DIR}/include/service_adaptor.h
58 ${CMAKE_SOURCE_DIR}/include/service_adaptor_types.h
59 ${CMAKE_SOURCE_DIR}/include/service_adaptor_errors.h
60 ${CMAKE_SOURCE_DIR}/include/service_adaptor_internal.h
63 INSTALL(FILES ${SAL-CLIENT-HEADERS} DESTINATION include/service-adaptor)