Modify CMake file for using pkgconfig
authorHyunwoo Kim <hwlove.kim@samsung.com>
Mon, 9 Sep 2013 02:32:33 +0000 (11:32 +0900)
committerHyunwoo Kim <hwlove.kim@samsung.com>
Mon, 9 Sep 2013 02:32:44 +0000 (11:32 +0900)
Change-Id: I74a640e7587c2b12d25fd4fc6182eb7f754fb2e8
Signed-off-by: Hyunwoo Kim <hwlove.kim@samsung.com>
CMakeLists.txt

index 5734e7a..944471b 100755 (executable)
@@ -2,10 +2,14 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 SET (this_target osp-secure-element)
 
+INCLUDE(FindPkgConfig)
+pkg_check_modules(${this_target} REQUIRED osp-appfw smartcard-service smartcard-service-common)
+
 SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)
 
 INCLUDE_DIRECTORIES(
        ${SLP_INCLUDE_DIRS}
+       ${${this_target}_INCLUDE_DIRS}}
        inc
        src
        src/inc
@@ -61,9 +65,7 @@ ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
 ## SET LINKER FLAGS
 SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
 
-TARGET_LINK_LIBRARIES(${this_target} "-lsmartcard-service" )
-TARGET_LINK_LIBRARIES(${this_target} "-lsmartcard-service-common" )
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" )
+TARGET_LINK_LIBRARIES(${this_target} ${${this_target}_LDFLAGS} ${${this_target}_LIBRARIES} )
 
 SET_TARGET_PROPERTIES(${this_target} 
        PROPERTIES