1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 SET(fw_name "capi-network-serial")
6 SET(CMAKE_INSTALL_PREFIX /usr)
7 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
10 INCLUDE_DIRECTORIES(${INC_DIR})
12 SET(dependents "dlog glib-2.0 capi-base-common dbus-glib-1")
13 SET(pc_dependents "capi-base-common")
15 INCLUDE(FindPkgConfig)
16 pkg_check_modules(${fw_name} REQUIRED ${dependents})
17 FOREACH(flag ${${fw_name}_CFLAGS})
18 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
21 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
22 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
24 IF("${ARCH}" STREQUAL "arm")
25 ADD_DEFINITIONS("-DTARGET")
26 ENDIF("${ARCH}" STREQUAL "arm")
28 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
29 ADD_DEFINITIONS("-DTIZEN_DEBUG")
31 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
33 aux_source_directory(src SOURCES)
34 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
36 TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
38 SET_TARGET_PROPERTIES(${fw_name}
45 INSTALL(TARGETS ${fw_name} DESTINATION ${LIB_INSTALL_DIR})
47 DIRECTORY ${INC_DIR}/ DESTINATION include/network
49 PATTERN "*_private.h" EXCLUDE
50 PATTERN "${INC_DIR}/*.h"
53 SET(PC_NAME ${fw_name})
54 SET(PC_REQUIRED ${pc_dependents})
55 SET(PC_LDFLAGS -l${fw_name})
58 capi-network-serial.pc.in
59 ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
62 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)