1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 #SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
6 SET(VERSION "${VERSION_MAJOR}.4.2")
8 #Add your submodule directory name
9 ADD_SUBDIRECTORY(plugin/app2sd)
12 INCLUDE(FindPkgConfig)
13 pkg_check_modules(pkgs REQUIRED dlog)
15 FOREACH(flag ${pkgs_CFLAGS})
16 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
19 pkg_check_modules(libpkgs REQUIRED dlog)
21 FOREACH(flag ${libpkgs_CFLAGS})
22 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
25 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
27 ### Local include directories
28 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc
29 ${CMAKE_SOURCE_DIR}/common/inc)
31 ## build app2ext library
32 SET(app2ext_dir "${CMAKE_SOURCE_DIR}")
33 SET(app2ext_src_dir "${app2ext_dir}/src")
34 SET(APP2EXT "app2ext")
35 SET(libapp2ext_SOURCES
36 ${app2ext_src_dir}/app2ext_interface.c
37 ${CMAKE_SOURCE_DIR}/common/src/app2ext_utils.c)
38 SET(libapp2ext_LDFLAGS " -L${LIB_INSTALL_DIR} -module -avoid-version -ldl ")
39 SET(libapp2ext_CFLAGS " ${CFLAGS} -fPIC ")
41 ADD_DEFINITIONS("-DLIBPREFIX=\"${LIB_INSTALL_DIR}\"")
42 ADD_DEFINITIONS("-D_APPFW_FEATURE_APP2SD_DMCRYPT_ENCRYPTION")
44 ADD_LIBRARY(${APP2EXT} SHARED ${libapp2ext_SOURCES})
45 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES SOVERSION ${VERSION_MAJOR})
46 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES VERSION ${VERSION})
47 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES COMPILE_FLAGS "${libapp2ext_CFLAGS}")
48 TARGET_LINK_LIBRARIES(${APP2EXT} ${libpkgs_LDFLAGS})
50 SET(CMAKE_INSTALL_PREFIX "/usr")
51 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
53 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/app2sd.manifest.in ${CMAKE_BINARY_DIR}/app2sd.manifest @ONLY)
55 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/app2sd.pc.in ${CMAKE_BINARY_DIR}/app2sd.pc @ONLY)
57 INSTALL(TARGETS ${APP2EXT} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
58 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/app2sd.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
59 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/app2ext_interface.h DESTINATION include)
61 ADD_SUBDIRECTORY(test)