Fix rpm manifest
[platform/core/appfw/app2sd.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(app2ext C)
3
4 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
5 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall -Werror")
6
7 INCLUDE(FindPkgConfig)
8 pkg_check_modules(app2ext_libpkgs REQUIRED dlog glib-2.0)
9
10 FOREACH(flag ${app2ext_libpkgs_CFLAGS})
11         SET(APP2EXT_CFLAGS "${APP2EXT_CFLAGS} ${flag}")
12 ENDFOREACH(flag)
13 SET(CMAKE_C_FLAGS "${EXTRA_CFLAGS} ${APP2EXT_CFLAGS}")
14
15 ADD_DEFINITIONS("-DLIBPREFIX=\"${LIB_INSTALL_DIR}\"")
16
17 # Local include directories
18 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc)
19
20 # build app2ext library
21 SET(APP2EXT "app2ext")
22 AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src APP2EXT_SRCS)
23
24 ADD_LIBRARY(${APP2EXT} SHARED ${APP2EXT_SRCS})
25 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES SOVERSION ${MAJORVER})
26 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES VERSION ${FULLVER})
27 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES COMPILE_FLAGS ${CFLAGS} "-fPIC -fstack-protector-strong")
28 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES LINK_FLAGS "-Wl,--as-needed,-z,relro")
29 TARGET_LINK_LIBRARIES(${APP2EXT} ${app2ext_libpkgs_LDFLAGS})
30
31 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/app2sd.pc.in ${CMAKE_BINARY_DIR}/app2sd.pc @ONLY)
32
33 INSTALL(TARGETS ${APP2EXT} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
34 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/app2sd.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
35 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/inc/ DESTINATION include)
36
37 ADD_SUBDIRECTORY(plugin/app2sd)
38 ADD_SUBDIRECTORY(test)