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