Use pkgconfig tizen_2.2 2.2.1_release submit/tizen_2.2/20131107.061913
authorHyunbin Lee <hyunbin.lee@samsung.com>
Tue, 15 Oct 2013 11:05:52 +0000 (20:05 +0900)
committerHyunbin Lee <hyunbin.lee@samsung.com>
Tue, 15 Oct 2013 11:20:37 +0000 (20:20 +0900)
Change-Id: I2c64aa8ec2991489741e01acdbf98f8fd31c514f
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
CMakeLists.txt
packaging/osp-channel-service.spec

index 4ed2421..b206fba 100644 (file)
@@ -7,19 +7,7 @@ SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
 SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/output")
 
 INCLUDE_DIRECTORIES (
-       /usr/include
-       /usr/include/glib-2.0
-       /usr/lib/glib-2.0/include
-       /usr/include/libsoup-2.4
-       /usr/include/dlog
-       /usr/include/appfw
-       /usr/include/openssl
-       /usr/include/osp
-       /usr/include/osp/app
-       /usr/include/osp/base
-       /usr/include/osp/io
-       /usr/include/osp/server
-       /usr/include/chromium
+       ${${this_target}_INCLUDE_DIRS}
        inc
        )
 
@@ -33,6 +21,24 @@ SET (${this_target}_SOURCE_FILES
        src/IpcServer.cpp
        )
 
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${this_target} REQUIRED
+       glib-2.0
+       dlog
+       chromium
+       message-port
+       osp-appfw
+       osp-appfw-server
+       bundle
+       aul
+       pkgmgr-info
+       libsmack
+       )
+
+FOREACH(flag ${${this_target}_CFLAGS})
+       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
 ## SET EXTRA COMPILER FLAGS
 SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -fPIE -Wall -pthread -g3" )
 
@@ -52,19 +58,7 @@ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
 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} "-lbundle" )
-TARGET_LINK_LIBRARIES(${this_target} "-ldlog" )
-TARGET_LINK_LIBRARIES(${this_target} "-lglib-2.0" )
-TARGET_LINK_LIBRARIES(${this_target} "-lmessage-port" )
-TARGET_LINK_LIBRARIES(${this_target} "-lsmack" )
-TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
-TARGET_LINK_LIBRARIES(${this_target} "-lcrypto" )
-TARGET_LINK_LIBRARIES(${this_target} "-lsoup-2.4" )
-TARGET_LINK_LIBRARIES(${this_target} "-laul" )
-TARGET_LINK_LIBRARIES(${this_target} "-lpkgmgr-info" )
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-appfw-server")
+TARGET_LINK_LIBRARIES(${this_target} ${${this_target}_LDFLAGS} ${${this_target}_LIBRARIES})
 
 ## Cory additional info
 INSTALL(TARGETS ${this_target} DESTINATION ../usr/apps/${APPID}/bin)
@@ -72,4 +66,3 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/manifest.xml DESTINATION ../usr/apps/$
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ../usr/apps/${APPID})
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/ DESTINATION ../usr/apps/${APPID}/data FILES_MATCHING PATTERN "*.ini")
 
-
index 47f7b2f..ab5c8a1 100755 (executable)
@@ -18,7 +18,7 @@ BuildRequires:        pkgconfig(message-port)
 BuildRequires: pkgconfig(openssl)
 BuildRequires:  pkgconfig(aul)
 BuildRequires:  pkgconfig(pkgmgr-info)
-BuildRequires:  osp-appfw-internal-devel
+BuildRequires: pkgconfig(osp-appfw-server)
 BuildRequires:  hash-signer
 
 # runtime requires