1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(LIBDIR "\${prefix}/lib")
7 SET(INCLUDEDIR "\${prefix}/include")
9 SET(VERSION "${VERSION_MAJOR}.1")
11 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
13 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
15 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
16 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -Wall")
17 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,--as-needed")
18 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
20 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
22 #################################################################
23 # Build appcore-common Library
24 # ------------------------------
25 SET(APPCORE_COMMON "appcore-common")
26 SET(SRCS_common src/appcore.c src/appcore-i18n.c src/appcore-measure.c src/appcore-rotation.c)
29 ADD_DEFINITIONS("-DWAYLAND")
31 SET(SRCS_common ${SRCS_common} src/appcore-X.c)
34 SET(HEADERS_common appcore-common.h)
36 INCLUDE(FindPkgConfig)
37 SET(APPCORE_PKG_CHECK_MODULES "vconf sensor aul dlog")
40 pkg_check_modules(pkg_common REQUIRED ${APPCORE_PKG_CHECK_MODULES} ecore)
42 pkg_check_modules(pkg_common REQUIRED "${APPCORE_PKG_CHECK_MODULES} x11 ecore-x")
45 FOREACH(flag ${pkg_common_CFLAGS})
46 SET(EXTRA_CFLAGS_common "${EXTRA_CFLAGS_common} ${flag}")
49 ADD_LIBRARY(${APPCORE_COMMON} SHARED ${SRCS_common})
50 SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES SOVERSION ${VERSION_MAJOR})
51 SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES VERSION ${VERSION})
52 SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_common})
53 TARGET_LINK_LIBRARIES(${APPCORE_COMMON} ${pkg_common_LDFLAGS} "-ldl")
56 CONFIGURE_FILE(${APPCORE_COMMON}-wayland.pc.in ${APPCORE_COMMON}.pc @ONLY)
58 CONFIGURE_FILE(${APPCORE_COMMON}-x.pc.in ${APPCORE_COMMON}.pc @ONLY)
61 INSTALL(TARGETS ${APPCORE_COMMON} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
62 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_COMMON}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
63 FOREACH(hfile ${HEADERS_common})
64 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${hfile} DESTINATION include/appcore)
66 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/SLP_Appcore_PG.h DESTINATION include)
68 #################################################################
69 # Build appcore-efl Library
70 # ------------------------------
71 SET(APPCORE_EFL "appcore-efl")
72 SET(SRCS_efl src/appcore-efl.c)
73 SET(HEADERS_efl appcore-efl.h)
75 INCLUDE(FindPkgConfig)
76 SET(APPCORE_PKG_CHECK_MODULES2 "elementary dlog ecore gobject-2.0 glib-2.0 aul")
79 pkg_check_modules(pkg_efl REQUIRED ${APPCORE_PKG_CHECK_MODULES2})
81 pkg_check_modules(pkg_efl REQUIRED "${APPCORE_PKG_CHECK_MODULES2} ecore-x")
84 FOREACH(flag ${pkg_efl_CFLAGS})
85 SET(EXTRA_CFLAGS_efl "${EXTRA_CFLAGS_efl} ${flag}")
88 ADD_LIBRARY(${APPCORE_EFL} SHARED ${SRCS_efl})
89 SET_TARGET_PROPERTIES(${APPCORE_EFL} PROPERTIES SOVERSION ${VERSION_MAJOR})
90 SET_TARGET_PROPERTIES(${APPCORE_EFL} PROPERTIES VERSION ${VERSION})
91 SET_TARGET_PROPERTIES(${APPCORE_EFL} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_efl})
92 TARGET_LINK_LIBRARIES(${APPCORE_EFL} ${pkg_efl_LDFLAGS} ${APPCORE_COMMON})
94 CONFIGURE_FILE(${APPCORE_EFL}.pc.in ${APPCORE_EFL}.pc @ONLY)
96 INSTALL(TARGETS ${APPCORE_EFL} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
97 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_EFL}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
98 FOREACH(hfile ${HEADERS_efl})
99 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${hfile} DESTINATION include/appcore)