1 ###########################################################################
2 # Copyright 2015 IoT.bzh
4 # author: José Bollo <jose.bollo@iot.bzh>
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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 ###########################################################################
19 cmake_minimum_required(VERSION 2.8)
21 include(FindPkgConfig)
23 pkg_check_modules(EXTRAS REQUIRED
27 xmlsec1 xmlsec1-openssl
32 add_compile_options(${EXTRAS_CFLAGS})
33 include_directories(${EXTRAS_INCLUDE_DIRS})
34 link_libraries(${EXTRAS_LIBRARIES})
36 ###########################################################################
38 include_directories(simulation)
40 ###########################################################################
42 add_compile_options(-Wall -Wno-pointer-sign)
43 add_compile_options(-ffunction-sections -fdata-sections)
44 add_compile_options(-fPIC)
45 add_compile_options(-Wl,--gc-sections)
47 set(CMAKE_C_FLAGS_PROFILING "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE")
48 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
49 set(CMAKE_C_FLAGS_RELEASE "-g -O2")
50 set(CMAKE_C_FLAGS_CCOV "-g -O2 --coverage")
52 ###########################################################################
88 add_executable(wgtpkg-sign wgtpkg-sign.c)
89 target_link_libraries(wgtpkg-sign wgtpkg utils)
91 add_executable(wgtpkg-pack wgtpkg-pack.c)
92 target_link_libraries(wgtpkg-pack wgtpkg utils)
94 add_executable(wgtpkg-info wgtpkg-info.c)
95 target_link_libraries(wgtpkg-info wgtpkg wgt utils)
97 add_executable(wgtpkg-installer wgtpkg-installer.c)
98 target_link_libraries(wgtpkg-installer wgtpkg wgt secwrp utils)
100 add_executable(afm-user-daemon afm-user-daemon.c)
101 target_link_libraries(afm-user-daemon afm secwrp wgt utils)
103 add_executable(afm-system-daemon afm-system-daemon.c)
104 target_link_libraries(afm-system-daemon wgtpkg afm secwrp wgt utils)
106 install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
107 install(TARGETS afm-user-daemon DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
108 install(TARGETS afm-system-daemon DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})