b421dab631581939f69bba2ac1eb00160f56359d
[platform/core/convergence/service-adaptor.git] / client / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(sal-client)
3
4 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
5
6 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
7         SET(CMAKE_BUILD_TYPE "Debug")
8 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
9
10 MESSAGE("")
11 MESSAGE(">>> current directory: ${CMAKE_CURRENT_SOURCE_DIR}")
12 MESSAGE(">>> Build type: ${CMAKE_BUILD_TYPE}")
13
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")
17
18 ##########################################################
19 # Define Service Adaptor CLIENT
20 ##########################################################
21
22 SET(CLIENT-LIB "sal-client")
23 SET(CLIENT-SRCS
24         ${CMAKE_SOURCE_DIR}/client/sal_core_api.c
25 )
26
27 INCLUDE_DIRECTORIES(
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
35 )
36
37 INCLUDE(FindPkgConfig)
38 pkg_check_modules(client_pkgs REQUIRED dlog glib-2.0)
39
40 FOREACH(flag ${client_pkgs_CFLAGS})
41         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
42 ENDFOREACH(flag)
43
44 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
45
46 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
47
48 ADD_LIBRARY(${CLIENT-LIB} SHARED ${CLIENT-SRCS})
49
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})
53
54 INSTALL(TARGETS ${CLIENT-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
55
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
61 )
62
63 INSTALL(FILES ${SAL-CLIENT-HEADERS} DESTINATION include/service-adaptor)