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)
11 INCLUDE(FindPkgConfig)
12 pkg_check_modules(pkgs REQUIRED dlog)
14 FOREACH(flag ${pkgs_CFLAGS})
15 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
18 pkg_check_modules(libpkgs REQUIRED dlog)
20 FOREACH(flag ${libpkgs_CFLAGS})
21 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
24 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
26 ### Local include directories
27 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/inc ${CMAKE_SOURCE_DIR}/src)
29 ## build app2ext library
30 SET(app2ext_dir "${CMAKE_SOURCE_DIR}")
31 SET(app2ext_inc_dir "${app2ext_dir}/inc")
32 SET(app2ext_src_dir "${app2ext_dir}/src")
33 SET(APP2EXT "app2ext")
34 SET(libapp2ext_SOURCES ${app2ext_src_dir}/app2ext_interface.c)
35 SET(libapp2ext_LDFLAGS " -L/usr/lib -module -avoid-version -ldl ")
36 SET(libapp2ext_CFLAGS " ${CFLAGS} -fPIC -I${app2ext_inc_dir} ")
38 ADD_LIBRARY(${APP2EXT} SHARED ${libapp2ext_SOURCES})
39 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES SOVERSION ${VERSION_MAJOR})
40 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES VERSION ${VERSION})
41 SET_TARGET_PROPERTIES(${APP2EXT} PROPERTIES COMPILE_FLAGS "${libapp2ext_CFLAGS}")
42 TARGET_LINK_LIBRARIES(${APP2EXT} ${libpkgs_LDFLAGS})
44 SET(CMAKE_INSTALL_PREFIX "/usr")
45 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
48 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/app2sd.pc.in ${CMAKE_BINARY_DIR}/app2sd.pc @ONLY)
50 INSTALL(TARGETS ${APP2EXT} DESTINATION lib COMPONENT RuntimeLibraries)
51 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/app2sd.pc DESTINATION lib/pkgconfig)
52 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/inc/app2ext_interface.h DESTINATION include)