1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(bt-service-api C)
5 ../include/bt-internal-types.c
38 bluetooth-telephony-api.h
39 bluetooth-media-control.h
43 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
44 SET(EXEC_PREFIX "\${prefix}")
45 SET(LIBDIR ${CMAKE_LIB_DIR})
46 SET(INCLUDEDIR "\${prefix}/include")
48 SET(VERSION ${VERSION_MAJOR}.0.0)
50 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
51 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
52 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
54 INCLUDE(FindPkgConfig)
68 INCLUDE(FindPkgConfig)
69 pkg_check_modules(packages REQUIRED ${PKG_MODULES})
71 FOREACH(flag ${packages_CFLAGS})
72 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
75 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
76 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g ")
78 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
80 FIND_PROGRAM(UNAME NAMES uname)
81 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
82 IF("${ARCH}" STREQUAL "arm")
83 ADD_DEFINITIONS("-DTARGET")
84 MESSAGE("add -DTARGET")
85 ENDIF("${ARCH}" STREQUAL "arm")
87 #ADD_DEFINITIONS("-DTIZEN_FEATURE_BT_HPS")
88 ADD_DEFINITIONS("-DTIZEN_FEATURE_BT_DPM")
90 FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal)
91 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${CMAKE_CURRENT_SOURCE_DIR}/marshal.list --header > ${CMAKE_CURRENT_SOURCE_DIR}/include/marshal.h")
92 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${CMAKE_CURRENT_SOURCE_DIR}/marshal.list --body > ${CMAKE_CURRENT_SOURCE_DIR}/marshal.c")
94 ADD_LIBRARY(bluetooth-api SHARED ${SRCS})
95 SET_TARGET_PROPERTIES(bluetooth-api PROPERTIES SOVERSION ${VERSION_MAJOR})
96 SET_TARGET_PROPERTIES(bluetooth-api PROPERTIES VERSION ${VERSION})
97 TARGET_LINK_LIBRARIES(bluetooth-api ${packages_LDFLAGS})
98 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-api.pc.in ${CMAKE_CURRENT_BINARY_DIR}/bluetooth-api.pc @ONLY)
99 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bluetooth-api.pc DESTINATION ${LIBDIR}/pkgconfig)
100 INSTALL(TARGETS bluetooth-api DESTINATION ${LIBDIR} COMPONENT RuntimeLibraries)
102 FOREACH(hfile ${HEADERS})
103 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/${hfile} DESTINATION include/bt-service)