Fix app2sd library path
[platform/core/appfw/app-installers.git] / src / common / CMakeLists.txt
index bc4f8ec..2ad5f8b 100644 (file)
@@ -1,84 +1,37 @@
 # Target - sources
-SET(SRCS
-  app_installer.cc
-  backup_paths.cc
-  certificate_validation.cc
-  installer_context.cc
-  shared_dirs.cc
-  plugins/plugin_factory.cc
-  plugins/plugin_manager.cc
-  plugins/plugin_list_parser.cc
-  plugins/plugin_xml_parser.cc
-  plugins/plugin_factory.cc
-  plugins/plugin.cc
-  plugins/types/category_plugin.cc
-  plugins/types/metadata_plugin.cc
-  plugins/types/tag_plugin.cc
-  pkgmgr_interface.cc
-  pkgmgr_registration.cc
-  pkgmgr_signal.cc
-  rds_parser.cc
-  recovery_file.cc
-  request.cc
-  security_registration.cc
-  step/backup/step_backup_icons.cc
-  step/backup/step_backup_manifest.cc
-  step/backup/step_copy_backup.cc
-  step/configuration/step_configure.cc
-  step/configuration/step_fail.cc
-  step/configuration/step_parse_manifest.cc
-  step/filesystem/step_clear_data.cc
-  step/filesystem/step_copy.cc
-  step/filesystem/step_copy_storage_directories.cc
-  step/filesystem/step_copy_tep.cc
-  step/filesystem/step_create_icons.cc
-  step/filesystem/step_create_per_user_storage_directories.cc
-  step/filesystem/step_create_storage_directories.cc
-  step/filesystem/step_delta_patch.cc
-  step/filesystem/step_recover_files.cc
-  step/filesystem/step_recover_icons.cc
-  step/filesystem/step_recover_manifest.cc
-  step/filesystem/step_recover_storage_directories.cc
-  step/filesystem/step_remove_files.cc
-  step/filesystem/step_remove_icons.cc
-  step/filesystem/step_remove_per_user_storage_directories.cc
-  step/filesystem/step_remove_temporary_directory.cc
-  step/filesystem/step_unzip.cc
-  step/pkgmgr/step_check_blacklist.cc
-  step/pkgmgr/step_check_removable.cc
-  step/pkgmgr/step_kill_apps.cc
-  step/pkgmgr/step_recover_application.cc
-  step/pkgmgr/step_register_app.cc
-  step/pkgmgr/step_remove_manifest.cc
-  step/pkgmgr/step_run_parser_plugins.cc
-  step/pkgmgr/step_unregister_app.cc
-  step/pkgmgr/step_update_app.cc
-  step/pkgmgr/step_update_tep.cc
-  step/rds/step_rds_modify.cc
-  step/rds/step_rds_parse.cc
-  step/recovery/step_open_recovery_file.cc
-  step/recovery/step_recovery.cc
-  step/security/step_check_background_category.cc
-  step/security/step_check_old_certificate.cc
-  step/security/step_check_signature.cc
-  step/security/step_privilege_compatibility.cc
-  step/security/step_recover_security.cc
-  step/security/step_register_security.cc
-  step/security/step_revoke_security.cc
-  step/security/step_rollback_deinstallation_security.cc
-  step/security/step_rollback_installation_security.cc
-  step/security/step_update_security.cc
-  tzip_interface.cc
-  utils/base64.cc
-  utils/file_util.cc
-  utils/subprocess.cc
-)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} COMMON_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/backup COMMON_STEP_BACKUP_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/configuration COMMON_STEP_CONFIGURATION_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/filesystem COMMON_STEP_FILESYSTEM_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/mount COMMON_STEP_MOUNT_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/pkgmgr COMMON_STEP_PKGMGR_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/rds COMMON_STEP_RDS_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/recovery COMMON_STEP_RECOVERY_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/step/security COMMON_STEP_SECURITY_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/plugins COMMON_PLUGINS_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/plugins/types COMMON_PLUGINS_TYPES_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/utils COMMON_UTILS_SRCS)
+AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/installer COMMON_INSTALLER_SRCS)
 # Target - definition
-ADD_LIBRARY(${TARGET_LIBNAME_COMMON} SHARED ${SRCS})
+ADD_LIBRARY(${TARGET_LIBNAME_COMMON} SHARED
+       ${COMMON_SRCS}
+       ${COMMON_STEP_BACKUP_SRCS}
+       ${COMMON_STEP_CONFIGURATION_SRCS}
+       ${COMMON_STEP_FILESYSTEM_SRCS}
+       ${COMMON_STEP_MOUNT_SRCS}
+       ${COMMON_STEP_PKGMGR_SRCS}
+       ${COMMON_STEP_RDS_SRCS}
+       ${COMMON_STEP_RECOVERY_SRCS}
+       ${COMMON_STEP_SECURITY_SRCS}
+       ${COMMON_PLUGINS_SRCS}
+       ${COMMON_PLUGINS_TYPES_SRCS}
+       ${COMMON_UTILS_SRCS}
+       ${COMMON_INSTALLER_SRCS})
 # Target - includes
 TARGET_INCLUDE_DIRECTORIES(${TARGET_LIBNAME_COMMON} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../")
 # Target - deps
 APPLY_PKG_CONFIG(${TARGET_LIBNAME_COMMON} PUBLIC
+  AUL_DEPS
   PKGMGR_DEPS
   PKGMGR_INFO_DEPS
   PKGMGR_PARSER_DEPS
@@ -91,15 +44,22 @@ APPLY_PKG_CONFIG(${TARGET_LIBNAME_COMMON} PUBLIC
   MINIZIP_DEPS
   ZLIB_DEPS
   PRIVILEGE_CHECKER_DEPS
-  APPMANAGER_DEPS
   DELTA_MANIFEST_HANDLERS_DEPS
   TPK_MANIFEST_HANDLERS_DEPS
+  GDBUS_DEPS
+  GUM_DEPS
+  APP2SD_DEPS
+  CAPI_SYSTEM_INFO_DEPS
+  STORAGE_DEPS
+  LIBSYSTEMD_DEPS
+  TTRACE_DEPS
+  TRUST_ANCHOR_DEPS
   Boost
 )
 
 # Extra
-SET_TARGET_PROPERTIES(${TARGET_LIBNAME_COMMON} PROPERTIES VERSION ${VERSION})
-SET_TARGET_PROPERTIES(${TARGET_LIBNAME_COMMON} PROPERTIES SOVERSION ${VERSION_MAJOR})
+SET_TARGET_PROPERTIES(${TARGET_LIBNAME_COMMON} PROPERTIES VERSION ${FULLVER})
+SET_TARGET_PROPERTIES(${TARGET_LIBNAME_COMMON} PROPERTIES SOVERSION ${MAJORVER})
 
 # Install
 INSTALL(TARGETS ${TARGET_LIBNAME_COMMON} DESTINATION ${LIB_INSTALL_DIR})
@@ -109,10 +69,17 @@ INSTALL(TARGETS ${TARGET_LIBNAME_COMMON} DESTINATION ${LIB_INSTALL_DIR})
 SET(PLUGINS_LIST_FILE_NAME plugins_list.txt)
 SET(PLUGINS_LIST_FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/plugins/${PLUGINS_LIST_FILE_NAME})
 
-SET(PLUGINS_LIST_INSTALL_PATH ${SHAREDIR}/app-installers/)
-SET(PLUGINS_LIST_INSTALL_FILE_PATH ${PLUGINS_LIST_INSTALL_PATH}/${PLUGINS_LIST_FILE_NAME})
+SET(PLUGINS_LIST_INSTALL_PATH ${SHAREDIR}/parser-plugins)
 
-ADD_DEFINITIONS("-DPLUGINS_LIST_INSTALL_FILE_PATH=\"${PLUGINS_LIST_INSTALL_FILE_PATH}\"")
+ADD_DEFINITIONS("-DLIBDIR=\"${LIBDIR}\"")
+ADD_DEFINITIONS("-DPLUGINS_LIST_INSTALL_PATH=\"${PLUGINS_LIST_INSTALL_PATH}\"")
+IF(NOT DEFINED TIZEN_FULL_VERSION)
+  MESSAGE(FATAL_ERROR "TIZEN_FULL_VERSION MUST BE defined")
+ELSE(NOT DEFINED TIZEN_FULL_VERSION)
+  ADD_DEFINITIONS("-DTIZEN_FULL_VERSION=\"${TIZEN_FULL_VERSION}\"")
+ENDIF(NOT DEFINED TIZEN_FULL_VERSION)
+ADD_DEFINITIONS("-DUNPACKDIR=\"${UNPACKDIR}\"")
+ADD_DEFINITIONS("-DLOGDIR=\"${LOGDIR}\"")
 CONFIGURE_FILE(${PLUGINS_LIST_FILE_PATH}.in ${PLUGINS_LIST_FILE_PATH} @ONLY)
 INSTALL(FILES ${PLUGINS_LIST_FILE_PATH} DESTINATION ${PLUGINS_LIST_INSTALL_PATH}/)
 
@@ -121,3 +88,5 @@ CONFIGURE_FILE(app-installers.pc.in app-installers.pc @ONLY)
 INSTALL(FILES app-installers.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 INSTALL(DIRECTORY ./ DESTINATION ${INCLUDEDIR}/app-installers/common/
         FILES_MATCHING PATTERN "*.h")
+INSTALL(DIRECTORY ./installer/ DESTINATION ${INCLUDEDIR}/app-installers/common/
+        FILES_MATCHING PATTERN "*.h")