cmake: switch the dependencies variable to list, from space separated string 89/59889/2
authorMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 19 Feb 2016 07:37:27 +0000 (16:37 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 19 Feb 2016 07:38:06 +0000 (23:38 -0800)
Change-Id: Ic503d5f361902314af83c23e8edb939d343cb23c
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
CMakeLists.txt
src/CMakeLists.txt

index b5e59aa..ff1cbd9 100644 (file)
@@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES(
 ADD_DEFINITIONS(-O2 -Wall -fPIC -fvisibility=hidden -Wl,--as-needed)
 
 # Base Dependency
-SET(dependencies "libcontext-shared libcontext-server")
+SET(dependencies libcontext-shared libcontext-server)
 
 # Profiles
 IF("${PROFILE}" STREQUAL "mobile")
@@ -46,6 +46,10 @@ SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${MAJORVER})
 SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${FULLVER})
 
 # Package Config
+FOREACH(item IN LISTS dependencies)
+       SET(deps_str "${deps_str} ${item}")
+ENDFOREACH(item)
+
 SET(VERSION ${FULLVER})
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(PC_NAME ${PROJECT_NAME})
@@ -54,7 +58,7 @@ SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/context-serv
 SET(PC_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
 SET(PC_CFLAGS "-I\${includedir}/context-service")
 SET(PC_LDFLAGS "-l${target}")
-SET(PC_REQUIRED "${dependencies}")
+SET(PC_REQUIRED "${deps_str}")
 
 CONFIGURE_FILE(
        ${PROJECT_NAME}.pc.in
index 9d45a9a..ed647fd 100644 (file)
@@ -18,12 +18,7 @@ add_provider(custom)
 
 
 LIST(REMOVE_DUPLICATES deps_collected)
-FOREACH(item IN LISTS deps_collected)
-       SET(deps_filtered "${deps_filtered} ${item}")
-ENDFOREACH(item)
-
-STRING(STRIP "${deps_filtered}" deps_filtered)
 
 SET(sources ${sources} ${srcs_collected} PARENT_SCOPE)
-SET(dependencies "${dependencies} ${deps_filtered}" PARENT_SCOPE)
+SET(dependencies ${dependencies} ${deps_collected} PARENT_SCOPE)
 SET(compile_defs ${compile_defs} ${cdef_collected} PARENT_SCOPE)