Use pkgconfig
authorHyunbin Lee <hyunbin.lee@samsung.com>
Wed, 16 Oct 2013 06:35:38 +0000 (15:35 +0900)
committerHyunbin Lee <hyunbin.lee@samsung.com>
Tue, 22 Oct 2013 11:48:15 +0000 (20:48 +0900)
Change-Id: I4849db2528fc8ac8716e51f27913c79adf3cee71
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
CMakeLists.txt
src/system/FSys_SettingService.h

index 6d78efb..bf926b0 100644 (file)
@@ -7,27 +7,11 @@ SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
 SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/output")
 
 INCLUDE_DIRECTORIES (
-       /usr/include/glib-2.0
-       /usr/lib/glib-2.0/include
-       /usr/include/ecore-1
-       /usr/include/eina-1
-       /usr/include/eina-1/eina
-       /usr/include/appfw
-       /usr/include/osp
-       /usr/include/osp/app
-       /usr/include/osp/base
-       /usr/include/osp/io
-       /usr/include/osp/system
-       /usr/include/osp/security
-       /usr/include/osp/ui
-       /usr/include/osp/server
-       /usr/include/chromium
-       /usr/include/osp/system-service/inc
-       /usr/include/osp/system-server/
        inc
        src/messaging
        src/system
        src/ui
+       /usr/include/osp/ui
        )
 
 SET (${this_target}_SOURCE_FILES
@@ -35,6 +19,23 @@ SET (${this_target}_SOURCE_FILES
        src/CommonServiceEntry.cpp
        )
 
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${this_target} REQUIRED
+       glib-2.0
+       ecore
+       eina
+       chromium
+       libsmack
+       capi-appfw-application
+       osp-appfw
+       osp-appfw-server
+       osp-system-server
+)
+
+FOREACH(flag ${${this_target}_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
 ADD_SUBDIRECTORY(src/messaging)
 ADD_SUBDIRECTORY(src/system)
 ADD_SUBDIRECTORY(src/ui)
@@ -80,21 +81,17 @@ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -
 TARGET_LINK_LIBRARIES( ${this_target} ${STATIC_LIBS})
 
 TARGET_LINK_LIBRARIES(${this_target} -Xlinker --no-undefined -Xlinker --as-needed -pie)
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -lchromium")
 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-uifw" )
 TARGET_LINK_LIBRARIES(${this_target} -L/usr/lib/osp -losp-messaging)
-TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-application" )
 TARGET_LINK_LIBRARIES(${this_target} "-lmsg_mapi" )
 TARGET_LINK_LIBRARIES(${this_target} "-lutilX" )
 TARGET_LINK_LIBRARIES(${this_target} "-lecore_x" )
 TARGET_LINK_LIBRARIES(${this_target} "-lSLP-tapi" )
 TARGET_LINK_LIBRARIES(${this_target} "-lcapi-system-info" )
 TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-wifi" )
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-appfw-server")
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-system-server")
 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib -lkies_alarm")
-TARGET_LINK_LIBRARIES(${this_target} "-lsmack" )
 TARGET_LINK_LIBRARIES(${this_target} "-ldl")
+TARGET_LINK_LIBRARIES(${this_target} ${${this_target}_LDFLAGS} ${${this_target}_LIBRARIES})
 
 INSTALL(TARGETS ${this_target} DESTINATION ../usr/apps/${APPID}/bin)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/manifest.xml DESTINATION ../usr/apps/${APPID}/info)
index 1262ec5..9b11ce2 100644 (file)
@@ -36,7 +36,7 @@
 #include <FApp_IAppEventListener.h>
 #include <FIo_IpcServer.h>
 #include <FIo_IIpcServerEventListener.h>
-#include <system-server/FSys_SettingInfo.h>
+#include <server/FSys_SettingInfo.h>
 
 namespace Tizen { namespace System
 {