ee0bb053d87e7bdbbd2f33a3464021fc7f7b9bff
[apps/agl-service-homescreen.git] / conf.d / cmake / config.cmake
1 ###########################################################################
2 # Copyright 2015-2020 IoT.bzh
3 # Copyright (C) 2020 Konsulko Group
4 #
5 # author: Marec Frédéric <frederic.marec@iot.bzh>
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 ###########################################################################
19
20 # Project Info
21 # ------------------
22 set(PROJECT_NAME "agl-service-homescreen")
23 set(API_NAME "homescreen")
24 set(PROJECT_PRETTY_NAME "HomeScreen Service")
25 set(PROJECT_DESCRIPTION "HomeScreen Binding Service")
26 set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-homescreen")
27 set(PROJECT_ICON "icon.svg")
28 set(PROJECT_AUTHOR "TOYOTA")
29 set(PROJECT_AUTHOR_EMAIL "")
30 set(PROJECT_VERSION "0.1")
31 set(PROJECT_LICENSE "APL2.0")
32 set(PROJECT_LANGUAGES,"CXX")
33
34 # Which directories inspect to find CMakeLists.txt target files
35 # set(PROJECT_SRC_DIR_PATTERN "*")
36
37 # Where are stored the project configuration files
38 # relative to the root project directory
39 set(PROJECT_CMAKE_CONF_DIR "conf.d")
40
41 # Compilation Mode (DEBUG, RELEASE, COVERAGE or PROFILING)
42 # ----------------------------------
43 set(BUILD_TYPE "RELEASE")
44 #set(USE_EFENCE 1)
45
46 # Kernel selection if needed. You can choose between a
47 # mandatory version to impose a minimal version.
48 # Or check Kernel minimal version and just print a Warning
49 # about missing features and define a preprocessor variable
50 # to be used as preprocessor condition in code to disable
51 # incompatibles features. Preprocessor define is named
52 # KERNEL_MINIMAL_VERSION_OK.
53 #
54 # NOTE*** FOR NOW IT CHECKS KERNEL Yocto environment and
55 # Yocto SDK Kernel version.
56 # -----------------------------------------------
57 #set (kernel_mandatory_version 4.8)
58 #set (kernel_minimal_version 4.8)
59
60 # Compiler selection if needed. Impose a minimal version.
61 # -----------------------------------------------
62 set (gcc_minimal_version 4.9)
63
64 # PKG_CONFIG required packages
65 # -----------------------------
66 set (PKG_REQUIRED_LIST
67         json-c
68         afb-daemon
69 )
70
71 # You can also consider to include libsystemd
72 # -----------------------------------
73 #list (APPEND PKG_REQUIRED_LIST libsystemd>=222)
74
75 # Prefix path where will be installed the files
76 # Default: /usr/local (need root permission to write in)
77 # ------------------------------------------------------
78 #set(INSTALL_PREFIX /opt/AGL CACHE PATH "INSTALL PREFIX PATH")
79
80 # Customize link option
81 # -----------------------------
82 list (APPEND link_libraries -pthread)
83
84 # Compilation options definition
85 # Use CMake generator expressions to specify only for a specific language
86 # Values are prefilled with default options that is currently used.
87 # Either separate options with ";", or each options must be quoted separately
88 # DO NOT PUT ALL OPTION QUOTED AT ONCE , COMPILATION COULD FAILED !
89 # ----------------------------------------------------------------------------
90 #set(COMPILE_OPTIONS
91 # -Wall
92 # -Wextra
93 # -Wconversion
94 # -Wno-unused-parameter
95 # -Wno-sign-compare
96 # -Wno-sign-conversion
97 # -Werror=maybe-uninitialized
98 # -Werror=implicit-function-declaration
99 # -ffunction-sections
100 # -fdata-sections
101 # -fPIC
102 # CACHE STRING "Compilation flags")
103 #set(C_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C language.")
104 #set(CXX_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C++ language.")
105 #set(PROFILING_COMPILE_OPTIONS
106 # -g
107 # -O0
108 # -pg
109 # -Wp,-U_FORTIFY_SOURCE
110 # CACHE STRING "Compilation flags for PROFILING build type.")
111 #set(DEBUG_COMPILE_OPTIONS
112 # -g
113 # -ggdb
114 # CACHE STRING "Compilation flags for DEBUG build type.")
115 #set(COVERAGE_COMPILE_OPTIONS
116 # -g
117 # -O0
118 # --coverage
119 # CACHE STRING "Compilation flags for COVERAGE build type.")
120 #set(RELEASE_COMPILE_OPTIONS
121 # -O2
122 # -pipe
123 # -D_FORTIFY_SOURCE=2
124 # -fstack-protector-strong
125 # -Wformat -Wformat-security
126 # -Werror=format-security
127 # -feliminate-unused-debug-types
128 # -Wl,-O1
129 # -Wl,--hash-style=gnu
130 # -Wl,--as-needed
131 # -fstack-protector-strong
132 # -Wl,-z,relro,-z,now
133 # CACHE STRING "Compilation flags for RELEASE build type.")
134
135 # Location for config.xml.in template file.
136 #
137 # If you keep them commented then it will build with a default minimal widget
138 # template which is very simple and it is highly probable that it will not suit
139 # to your app.
140 # -----------------------------------------
141 set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in)
142
143 # Mandatory widget Mimetype specification of the main unit
144 # --------------------------------------------------------------------------
145 # Choose between :
146 #- text/html : HTML application,
147 #       content.src designates the home page of the application
148 #
149 #- application/vnd.agl.native : AGL compatible native,
150 #       content.src designates the relative path of the binary.
151 #
152 # - application/vnd.agl.service: AGL service, content.src is not used.
153 #
154 #- ***application/x-executable***: Native application,
155 #       content.src designates the relative path of the binary.
156 #       For such application, only security setup is made.
157 #
158 set(WIDGET_TYPE application/vnd.agl.service)
159
160 # Mandatory Widget entry point file of the main unit
161 # --------------------------------------------------------------
162 # This is the file that will be executed, loaded,
163 # at launch time by the application framework.
164 #
165 set(WIDGET_ENTRY_POINT lib/homescreen-binding.so)
166
167 # Optional dependencies order
168 # ---------------------------
169 #set(EXTRA_DEPENDENCIES_ORDER)
170
171 # Optional Extra global include path
172 # -----------------------------------
173 #set(EXTRA_INCLUDE_DIRS)
174
175 # Optional extra libraries
176 # -------------------------
177 #set(EXTRA_LINK_LIBRARIES)
178
179 # Optional force binding Linking flag
180 # ------------------------------------
181 # set(BINDINGS_LINK_FLAG LinkOptions )
182
183 # Optional force package prefix generation, like widget
184 # -----------------------------------------------------
185 # set(PKG_PREFIX DestinationPath)
186
187 # Optional Application Framework security token
188 # and port use for remote debugging.
189 #------------------------------------------------------------
190 set(AFB_TOKEN   ""     CACHE PATH "Default binder security token")
191 set(AFB_REMPORT "1234" CACHE PATH "Default binder listening port")
192
193 # Print a helper message when every thing is finished
194 # ----------------------------------------------------
195 set(CLOSING_MESSAGE "Typical binding launch: cd ${CMAKE_BINARY_DIR}/package \\&\\& afb-daemon --port=${AFB_REMPORT} --workdir=. --ldpaths=lib --roothttp=htdocs  --token=\"${AFB_TOKEN}\" --tracereq=common --verbose")
196 set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")
197
198 # Optional schema validator about now only XML, LUA and JSON
199 # are supported
200 #------------------------------------------------------------
201 #set(LUA_CHECKER "luac" "-p" CACHE STRING "LUA compiler")
202 #set(XML_CHECKER "xmllint" CACHE STRING "XML linter")
203 #set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter")
204
205 include(CMakeAfbTemplates)