Renamings
[src/app-framework-main.git] / src / 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 include(FindPkgConfig)
20
21 pkg_check_modules(EXTRAS REQUIRED
22         libzip>=0.11
23         libxml-2.0
24         openssl
25         xmlsec1 xmlsec1-openssl
26         json-c
27         dbus-1
28         )
29
30 add_compile_options(${EXTRAS_CFLAGS})
31 include_directories(${EXTRAS_INCLUDE_DIRS})
32 link_libraries(${EXTRAS_LIBRARIES})
33
34 ###########################################################################
35
36 include_directories(simulation)
37
38 ###########################################################################
39
40 add_compile_options(-Wall -Wno-pointer-sign)
41 add_compile_options(-ffunction-sections -fdata-sections)
42 add_compile_options(-fPIC)
43 add_compile_options(-Wl,--gc-sections)
44
45 set(CMAKE_C_FLAGS_PROFILING    "-g -O0 -pg -Wp,-U_FORTIFY_SOURCE")
46 set(CMAKE_C_FLAGS_DEBUG        "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
47 set(CMAKE_C_FLAGS_RELEASE      "-g -O2")
48 set(CMAKE_C_FLAGS_CCOV         "-g -O2 --coverage")
49
50 ###########################################################################
51
52 add_library(wgtpkg
53         wgtpkg-base64.c
54         wgtpkg-certs.c
55         wgtpkg-digsig.c
56         wgtpkg-files.c
57         wgtpkg-install.c
58         wgtpkg-permissions.c
59         wgtpkg-workdir.c
60         wgtpkg-xmlsec.c
61         wgtpkg-zip.c
62         )
63
64 add_library(utils
65         utils-dir.c
66         utils-jbus.c
67         verbose.c
68         )
69
70 add_library(wgt
71         wgt-config.c
72         wgt-info.c
73         wgt.c
74         )
75
76 add_library(secwrp
77         secmgr-wrap.c
78         )
79
80 add_library(afm
81         af-db.c
82         af-launch.c
83         af-run.c
84         )
85
86 add_executable(wgtpkg-sign wgtpkg-sign.c)
87 target_link_libraries(wgtpkg-sign wgtpkg utils)
88
89
90 add_executable(wgtpkg-pack wgtpkg-pack.c)
91 target_link_libraries(wgtpkg-pack wgtpkg utils)
92
93
94 add_executable(wgtpkg-info wgtpkg-info.c)
95 target_link_libraries(wgtpkg-info wgtpkg wgt utils)
96
97
98 add_executable(wgtpkg-installer wgtpkg-installer.c)
99 target_link_libraries(wgtpkg-installer wgtpkg wgt secwrp utils)
100
101
102 add_executable(afm-main-daemon afm-main-daemon.c)
103 target_link_libraries(afm-main-daemon afm secwrp wgt utils)
104
105 install(TARGETS wgtpkg-sign wgtpkg-pack wgtpkg-info wgtpkg-installer DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
106 install(TARGETS afm-main-daemon DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
107