Merge "packaging: spec cleanup" into tizen
[apps/core/preloaded/settings.git] / setting-profile / CMakeLists.txt
1 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
2 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/${SETTING_COMMON}/include)
3
4
5 INCLUDE(FindPkgConfig)
6 pkg_check_modules(pkgs_profile REQUIRED ecore ecore-file evas elementary utilX appcore-common appcore-efl haptic ui-gadget-1 capi-appfw-application vconf capi-media-player capi-media-sound-manager dlog svi devman capi-system-device feedback)
7
8 FOREACH(flag ${pkgs_profile_CFLAGS})
9         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
10 ENDFOREACH(flag)
11
12 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
13 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
14
15 IF("${ARCH}" STREQUAL "arm")
16         ADD_DEFINITIONS("-DTARGET")
17         MESSAGE("add -DTARGET")
18 ENDIF("${ARCH}" STREQUAL "arm")
19
20 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
21 ADD_DEFINITIONS("-DSLP_DEBUG")
22
23 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib")
24
25 ADD_LIBRARY(${SETTING_PROFILE_UG} SHARED
26         ./src/setting-profile.c
27         ./src/setting-profile-sound-main.c
28         )
29
30 TARGET_LINK_LIBRARIES(${SETTING_PROFILE_UG} -L${CMAKE_BINARY_DIR}/${SETTING_COMMON} -lsetting-common)
31 TARGET_LINK_LIBRARIES(${SETTING_PROFILE_UG} ${pkgs_profile_LDFLAGS})
32
33 INSTALL(TARGETS ${SETTING_PROFILE_UG} DESTINATION /usr/ug/lib)