1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
2 PROJECT(CommonAppInstaller)
3 SET(PREFIX "${CMAKE_INSTALL_PREFIX}")
4 SET(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
5 SET(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
6 SET(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share")
7 SET(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include")
9 SET(VERSION "${VERSION_MAJOR}.1.0")
11 IF(NOT CMAKE_BUILD_TYPE)
12 SET(CMAKE_BUILD_TYPE "Release")
13 ENDIF(NOT CMAKE_BUILD_TYPE)
16 SET(CMAKE_C_FLAGS_PROFILING "-O2")
17 SET(CMAKE_CXX_FLAGS_PROFILING "-O2 -std=c++11")
18 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
19 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++11 -g")
20 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
21 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++11 -g")
22 SET(CMAKE_CXX_FLAGS_CCOV "-O0 -std=c++11 -g --coverage")
25 SET(TARGET_LIBNAME_COMMON "app-installers")
26 SET(TARGET_PKGDIR_TOOL "pkgdir-tool")
27 SET(TARGET_PKG_INSTALL_MANIFEST "pkg-install-manifest")
29 ADD_DEFINITIONS("-Wall")
30 ADD_DEFINITIONS("-Wextra")
31 ADD_DEFINITIONS("-fPIE")
32 ADD_DEFINITIONS("-fPIC")
34 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
35 INCLUDE(FindPkgConfig)
36 INCLUDE(ApplyPkgConfig)
38 # Find all needed packages once
39 PKG_CHECK_MODULES(PKGMGR_DEPS REQUIRED pkgmgr)
40 PKG_CHECK_MODULES(PKGMGR_INSTALLER_DEPS REQUIRED pkgmgr-installer)
41 PKG_CHECK_MODULES(MINIZIP_DEPS REQUIRED minizip)
42 PKG_CHECK_MODULES(ZLIB_DEPS REQUIRED zlib)
43 PKG_CHECK_MODULES(TZPLATFORM_CONFIG_DEPS REQUIRED libtzplatform-config)
44 PKG_CHECK_MODULES(SECURITY_MANAGER_DEPS REQUIRED security-manager)
45 PKG_CHECK_MODULES(DELTA_MANIFEST_HANDLERS_DEPS REQUIRED delta-manifest-handlers)
46 PKG_CHECK_MODULES(TPK_MANIFEST_HANDLERS_DEPS REQUIRED tpk-manifest-handlers)
47 PKG_CHECK_MODULES(MANIFEST_PARSER_UTILS_DEPS REQUIRED manifest-parser-utils)
48 PKG_CHECK_MODULES(CERT_SVC_DEPS_VCORE_DEPS REQUIRED cert-svc-vcore)
49 PKG_CHECK_MODULES(PKGMGR_PARSER_DEPS REQUIRED pkgmgr-parser)
50 PKG_CHECK_MODULES(PKGMGR_INFO_DEPS REQUIRED pkgmgr-info)
51 PKG_CHECK_MODULES(LIBXML_DEPS REQUIRED libxml-2.0)
52 PKG_CHECK_MODULES(PRIVILEGE_CHECKER_DEPS REQUIRED capi-security-privilege-manager)
53 PKG_CHECK_MODULES(APPMANAGER_DEPS REQUIRED capi-appfw-app-manager)
55 FIND_PACKAGE(Boost REQUIRED COMPONENTS system filesystem regex program_options)
56 FIND_PACKAGE(GTest REQUIRED)