Minor improvements
[src/app-framework-main.git] / CMakeLists.txt
1 ###########################################################################
2 # Copyright 2015 IoT.bzh
3 #
4 # author: José Bollo <jose.bollo@iot.bzh>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ###########################################################################
18
19 project(afm-main C)
20
21 cmake_minimum_required(VERSION 2.8)
22
23 include(GNUInstallDirs)
24
25 set(PROJECT_NAME "AFM Main")
26 set(PROJECT_PRETTY_NAME "Application Framework Main")
27 set(PROJECT_DESCRIPTION "Secured Application framework")
28 set(PROJECT_VERSION "1.0")
29
30
31 set(USE_LIBZIP     ON  CACHE BOOL "should try to use libzip?")
32 set(USE_SIMULATION ON  CACHE BOOL "if set simulates security manager")
33 set(USE_SDK        OFF CACHE BOOL "if set, avoids installating system runtime files")
34
35 set(afm_name                "afm" CACHE STRING "Name for application framework user")
36 set(afm_confdir             "${CMAKE_INSTALL_FULL_SYSCONFDIR}/${afm_name}" CACHE STRING "Directory for configuration files")
37 set(afm_datadir             "${CMAKE_INSTALL_FULL_DATADIR}/${afm_name}" CACHE STRING "Root directory for installions")
38 set(afm_appdir              "${afm_datadir}/applications" CACHE STRING "Directory for installing applications")
39 set(afm_icondir             "${afm_datadir}/icons" CACHE STRING "Directory for installing icons")
40 set(afm_prefix              "urn:AGL:" CACHE STRING "Prefix for uniform resource name")
41 set(afm_prefix_binding      "${afm_prefix}binding:" CACHE STRING "URN for bindings")
42 set(afm_user_appdir         "app-data" CACHE STRING "User subdirectory for applications")
43 set(wgtpkg_trusted_cert_dir "${afm_confdir}/certs" CACHE STRING "Path to internal certificates")
44
45 add_definitions(
46         -DFWK_CONFIG_DIR="${afm_confdir}"
47         -DFWK_PREFIX="${afm_prefix}"
48         -DFWK_PREFIX_BINDING="${afm_prefix_binding}"
49         -DFWK_ICON_DIR="${afm_icondir}"
50         -DFWK_APP_DIR="${afm_appdir}"
51         -DFWK_USER_APP_DIR="${afm_user_appdir}"
52         -DWGTPKG_TRUSTED_CERT_DIR="${wgtpkg_trusted_cert_dir}"
53         -DFWK_LAUNCH_CONF="${afm_confdir}/afm-launch.conf"
54 )
55
56 add_subdirectory(src)
57 add_subdirectory(conf)
58 add_subdirectory(scripts)
59 add_subdirectory(certs)
60
61