Modify the cmake file to use pkgconfig
authorhb.min <hb.min@samsung.com>
Tue, 8 Oct 2013 07:17:04 +0000 (16:17 +0900)
committerhb.min <hb.min@samsung.com>
Tue, 8 Oct 2013 07:17:04 +0000 (16:17 +0900)
Change-Id: I1502617bed02ce5dd7c8a389e688f0fa6e51394b
Signed-off-by: hb.min <hb.min@samsung.com>
CMakeLists.txt

index 7bbd851..2bef2dd 100755 (executable)
@@ -7,20 +7,23 @@ 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/osp
-       /usr/include/osp/app
-       /usr/include/osp/base
-       /usr/include/osp/io
-       /usr/include/chromium
-       /usr/include/osp/security
-       /usr/include/osp/server
-       /usr/include
-       /usr/include/vconf
        inc
        )
 
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+       osp-appfw-server
+       chromium
+       glib-2.0
+       osp-appfw
+       vconf
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
 SET (${this_target}_SOURCE_FILES
        src/SecurityService.cpp
        src/SecurityServiceEntry.cpp
@@ -54,10 +57,8 @@ ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES})
 
 TARGET_LINK_LIBRARIES(${this_target} -Xlinker --no-undefined -Xlinker --as-needed -pie)
 TARGET_LINK_LIBRARIES(${this_target} -Xlinker --version-script=${CMAKE_CURRENT_SOURCE_DIR}/system-service-export.ver)
-TARGET_LINK_LIBRARIES(${this_target} -L/usr/lib/osp -losp-appfw -lchromium)
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-appfw-server")
-TARGET_LINK_LIBRARIES(${this_target} "-lvconf" )
 TARGET_LINK_LIBRARIES(${this_target} "-ldl" )
+TARGET_LINK_LIBRARIES(${this_target} ${pkgs_LDFLAGS})
 
 ## Copy additional info
 INSTALL(TARGETS ${this_target} DESTINATION ../usr/apps/${APPID}/bin)