Updated Spec file for enabling debug macro
[platform/framework/native/common-service.git] / CMakeLists.txt
old mode 100755 (executable)
new mode 100644 (file)
index 1843966..ba903d1
@@ -7,34 +7,39 @@ 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
        inc
+       src/messaging
+       src/system
+       src/ui
+       /usr/include/osp/ui
        )
 
 SET (${this_target}_SOURCE_FILES
-       src/FApp_PackageManagerStub.cpp
-       src/FUi_UiManagerStub.cpp
        src/CommonService.cpp
        src/CommonServiceEntry.cpp
-       src/FSys_DeviceManagerStub.cpp
-       src/FSys_DeviceManagerServiceIpcEventForAsync.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)
+
 ## SET EXTRA COMPILER FLAGS
 SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -fPIE -Wall -pthread -g3" )
 #SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -fstack-protector -Wstack-protector" )
@@ -51,19 +56,45 @@ SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 SET(CMAKE_INSTALL_RPATH "/usr/lib/osp-server")
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
 
-## Create Library
+## Create Executable
 ADD_EXECUTABLE (${this_target} ${${this_target}_SOURCE_FILES})
 
+## Create Shared Library
+SET(STATIC_LIBS messaging_service system_service ui_service)
+
+SET_TARGET_PROPERTIES(${this_target} PROPERTIES LINK_INTERFACE_LIBRARIES "")
+
+ADD_DEPENDENCIES(${this_target} ${STATIC_LIBS})
+
+MACRO(OSP_ADD_OBJS_IN_ARCHIVE archives)
+       SET(LINK_OBJECTS_IN_ARCHIVE)
+       FOREACH(archive ${ARGV})
+               SET(LINK_OBJECTS_IN_ARCHIVE "${LINK_OBJECTS_IN_ARCHIVE} -l${archive}")
+       ENDFOREACH(archive)
+       SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--whole-archive ${LINK_OBJECTS_IN_ARCHIVE} -Wl,-no-whole-archive")
+ENDMACRO(OSP_ADD_OBJS_IN_ARCHIVE)
+
+OSP_ADD_OBJS_IN_ARCHIVE(${STATIC_LIBS})
+
+SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed")
+
+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} "-lmsg_mapi" )
 TARGET_LINK_LIBRARIES(${this_target} "-lutilX" )
 TARGET_LINK_LIBRARIES(${this_target} "-lecore_x" )
-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} "-ltapi" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-system-info" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-wifi" )
+TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib -lkies_alarm")
 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)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/global_res/opt/usr/etc/system_info_cache.ini DESTINATION ../opt/usr/etc)
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/ DESTINATION ../usr/apps/${APPID}/data)
-
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/global_res/opt/etc/smack/accesses.d/osp-common-service.native DESTINATION ../etc/smack/accesses.d)