blob: 76a79ae2a178018436d28e0fdc3ec80970b2d91a [file] [log] [blame]
Tomáš Pecka5123e002020-06-05 15:29:21 +02001project(velia LANGUAGES CXX)
Tomáš Peckaa06d74d2020-06-14 18:18:13 +02002cmake_minimum_required(VERSION 3.15)
Tomáš Pecka5123e002020-06-05 15:29:21 +02003
4# Build options
5set(CMAKE_CXX_STANDARD 17)
6set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
8set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_FLAGS_DEBUG}")
9set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Woverloaded-virtual ${CMAKE_CXX_FLAGS}")
10if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
11 set(CMAKE_CXX_FLAGS "-Wsuggest-override ${CMAKE_CXX_FLAGS}")
12endif()
13
Tomáš Pecka5d4cf2a2020-07-13 13:19:41 +020014if(CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+" AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
15 set(STD_FILESYSTEM_LIBRARY c++fs)
16elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
17 set(STD_FILESYSTEM_LIBRARY stdc++fs)
18endif()
19
20
Tomáš Pecka5123e002020-06-05 15:29:21 +020021add_custom_target(velia-version-cmake-ide
22 cmake/ProjectGitVersion.cmake
23 cmake/ProjectGitVersionRunner.cmake
24 )
25include(cmake/ProjectGitVersion.cmake)
26prepare_git_version(VELIA_VERSION "0.0")
27
28find_package(Doxygen)
29option(WITH_DOCS "Create and install internal documentation (needs Doxygen)" ${DOXYGEN_FOUND})
30
Václav Kubernátd386aba2021-01-19 10:03:28 +010031find_package(Boost REQUIRED COMPONENTS filesystem)
Tomáš Peckaa193c032020-06-22 17:33:31 +020032find_package(docopt REQUIRED)
Tomáš Pecka5123e002020-06-05 15:29:21 +020033find_package(spdlog REQUIRED)
Tomáš Pecka0a2e8902020-06-09 21:11:20 +020034find_package(sdbus-c++ REQUIRED)
Tomáš Peckaa4336812020-07-24 15:32:58 +020035find_package(PkgConfig)
36
37pkg_check_modules(SYSTEMD REQUIRED IMPORTED_TARGET libsystemd)
Tomáš Pecka1f42cfe2020-10-21 18:38:27 +020038if(${SYSTEMD_VERSION} VERSION_EQUAL 245)
39 message(FATAL_ERROR "Systemd 245 has a bug affecting DBus method calls using sdbus-c++. Please see https://github.com/Kistler-Group/sdbus-cpp/issues/106.")
40endif()
Tomáš Pecka5123e002020-06-05 15:29:21 +020041
Jan Kundrátcf65a202021-01-19 09:37:14 +010042pkg_check_modules(SYSREPO REQUIRED sysrepo-cpp>=1.4.100 IMPORTED_TARGET sysrepo)
43pkg_check_modules(LIBYANG REQUIRED libyang-cpp>=1.0.209 IMPORTED_TARGET libyang)
Tomáš Pecka98ad18d2020-11-13 15:39:55 +010044
Tomáš Peckac927d662020-07-13 11:16:16 +020045include(GNUInstallDirs)
46
Tomáš Pecka261c8862020-11-05 11:23:08 +010047include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
48
Tomáš Pecka73a13cc2020-11-17 11:12:19 +010049set(YANG_SRCS
Tomáš Pecka9a02c3f2021-01-21 15:27:22 +010050 yang/czechlight-system@2021-01-13.yang
Tomáš Pecka73a13cc2020-11-17 11:12:19 +010051 yang/iana-hardware@2018-03-13.yang
Tomáš Pecka73a13cc2020-11-17 11:12:19 +010052 yang/ietf-hardware@2018-03-13.yang
Tomáš Peckaf98ce032021-01-14 13:35:00 +010053 yang/iana-crypt-hash@2014-08-06.yang
54 yang/ietf-inet-types@2013-07-15.yang
55 yang/ietf-netconf-acm@2018-02-14.yang
56 yang/ietf-system@2014-08-06.yang
57 yang/ietf-yang-types@2013-07-15.yang
Václav Kubernát637fe802021-01-22 02:43:18 +010058 yang/ietf-access-control-list@2019-03-04.yang
Václav Kubernát457d1ad2021-01-22 02:43:18 +010059 yang/czechlight-firewall@2021-01-25.yang
Tomáš Pecka73a13cc2020-11-17 11:12:19 +010060 )
61
Tomáš Pecka5123e002020-06-05 15:29:21 +020062# Targets
Tomáš Pecka261c8862020-11-05 11:23:08 +010063# - utils
Tomáš Peckabd828862020-06-15 15:53:35 +020064add_library(velia-utils STATIC
Tomáš Peckaa193c032020-06-22 17:33:31 +020065 src/utils/exceptions.cpp
Tomáš Pecka261c8862020-11-05 11:23:08 +010066 src/utils/exceptions.h
Tomáš Pecka491f4f22020-11-05 15:44:00 +010067 src/utils/io.cpp
68 src/utils/io.h
Tomáš Peckaa4336812020-07-24 15:32:58 +020069 src/utils/journal.cpp
Tomáš Pecka261c8862020-11-05 11:23:08 +010070 src/utils/journal.h
71 src/utils/log.h
72 src/utils/log-fwd.h
Tomáš Pecka5123e002020-06-05 15:29:21 +020073 src/utils/log-init.cpp
Tomáš Pecka261c8862020-11-05 11:23:08 +010074 src/utils/log-init.h
Tomáš Peckaba2dc312021-01-23 22:29:11 +010075 src/utils/sysrepo.cpp
76 src/utils/sysrepo.h
Tomáš Pecka339bc672020-11-11 15:59:03 +010077 src/utils/time.cpp
78 src/utils/time.h
Tomáš Peckad0337072021-01-25 19:57:00 +010079 src/utils/waitUntilSignalled.cpp
80 src/utils/waitUntilSignalled.h
Tomáš Pecka5123e002020-06-05 15:29:21 +020081 )
Tomáš Peckaf02671e2021-01-13 09:09:48 +010082target_link_libraries(velia-utils PUBLIC spdlog::spdlog PRIVATE PkgConfig::SYSTEMD PkgConfig::SYSREPO)
Tomáš Peckaa4336812020-07-24 15:32:58 +020083
Tomáš Pecka261c8862020-11-05 11:23:08 +010084# - health
85add_library(velia-health STATIC
86 src/health/inputs/AbstractInput.cpp
87 src/health/inputs/DbusSemaphoreInput.cpp
88 src/health/inputs/DbusSystemdInput.cpp
89 src/health/manager/AbstractManager.cpp
90 src/health/manager/StateManager.cpp
91 src/health/outputs/LedSysfsDriver.cpp
92 src/health/outputs/callables.cpp
93 src/health/State.cpp
Tomáš Pecka74b885f2020-06-06 20:02:41 +020094 )
Tomáš Pecka261c8862020-11-05 11:23:08 +010095target_link_libraries(velia-health
96 PUBLIC
97 velia-utils
98 Boost::boost
99 SDBusCpp::sdbus-c++
100 ${STD_FILESYSTEM_LIBRARY}
101 )
Tomáš Pecka74b885f2020-06-06 20:02:41 +0200102
Tomáš Pecka491f4f22020-11-05 15:44:00 +0100103# - ietf-hardware
104add_library(velia-ietf-hardware STATIC
105 src/ietf-hardware/sysfs/EMMC.cpp
106 src/ietf-hardware/sysfs/EMMC.h
Tomáš Pecka9b1c9672020-11-11 15:24:06 +0100107 src/ietf-hardware/sysfs/HWMon.cpp
108 src/ietf-hardware/sysfs/HWMon.h
Tomáš Pecka339bc672020-11-11 15:59:03 +0100109 src/ietf-hardware/IETFHardware.cpp
110 src/ietf-hardware/IETFHardware.h
Tomáš Pecka491f4f22020-11-05 15:44:00 +0100111 )
112target_link_libraries(velia-ietf-hardware
113 PUBLIC
114 velia-utils
115 ${STD_FILESYSTEM_LIBRARY}
Tomáš Pecka9b1c9672020-11-11 15:24:06 +0100116 Boost::boost
Tomáš Pecka491f4f22020-11-05 15:44:00 +0100117 )
Tomáš Pecka491f4f22020-11-05 15:44:00 +0100118
Tomáš Pecka98ad18d2020-11-13 15:39:55 +0100119add_library(velia-ietf-hardware-sysrepo STATIC
Tomáš Pecka98ad18d2020-11-13 15:39:55 +0100120 src/ietf-hardware/sysrepo/Sysrepo.cpp
121 src/ietf-hardware/sysrepo/Sysrepo.h
122 )
123target_link_libraries(velia-ietf-hardware-sysrepo
124 PUBLIC
125 velia-utils
126 PkgConfig::SYSREPO
127 PkgConfig::LIBYANG
128 )
Tomáš Pecka5123e002020-06-05 15:29:21 +0200129
Tomáš Pecka292bc9c2021-01-11 22:03:11 +0100130# - ietf-system
131add_library(velia-system STATIC
Tomáš Pecka991e4d52021-01-11 10:03:14 +0100132 src/system/RAUC.cpp
133 src/system/RAUC.h
Tomáš Peckaf976c5b2021-01-23 21:19:52 +0100134 src/system/IETFSystem.cpp
135 src/system/IETFSystem.h
Tomáš Pecka292bc9c2021-01-11 22:03:11 +0100136 )
137target_link_libraries(velia-system
138 PUBLIC
139 velia-utils
140 PkgConfig::SYSREPO
141 PkgConfig::LIBYANG
Václav Kubernát6dd52c82021-01-21 08:38:42 +0100142 SDBusCpp::sdbus-c++
Tomáš Pecka292bc9c2021-01-11 22:03:11 +0100143 )
144
Václav Kubernátd386aba2021-01-19 10:03:28 +0100145# - firewall
146add_library(velia-firewall STATIC
147 src/firewall/Firewall.cpp
148 )
149target_link_libraries(velia-firewall
150 PUBLIC
151 velia-utils
152 PkgConfig::SYSREPO
153 PRIVATE
154 PkgConfig::LIBYANG
155 )
156
157
Tomáš Pecka625b7a12021-01-23 20:55:51 +0100158# - daemons
Tomáš Peckad03044f2020-11-12 14:33:10 +0100159add_executable(veliad
160 src/main.cpp
161 src/Factory.cpp
162 src/Factory.h
163 )
164target_link_libraries(veliad
165 PUBLIC
166 velia-health
167 velia-ietf-hardware
168 velia-ietf-hardware-sysrepo
169 docopt
170 )
171add_dependencies(veliad target-VELIA_VERSION)
172target_include_directories(veliad PUBLIC ${CMAKE_BINARY_DIR})
173
Tomáš Pecka625b7a12021-01-23 20:55:51 +0100174add_executable(veliad-system
175 src/main-system.cpp
176 )
177target_link_libraries(veliad-system
178 PUBLIC
179 velia-system
180 docopt
181 )
182add_dependencies(veliad-system target-VELIA_VERSION)
183target_include_directories(veliad-system PUBLIC ${CMAKE_BINARY_DIR})
184
Václav Kubernátd386aba2021-01-19 10:03:28 +0100185add_executable(veliad-firewall
186 src/main-firewall.cpp
187 )
188target_link_libraries(veliad-firewall
189 PUBLIC
190 velia-firewall
191 velia-utils
192 Boost::filesystem
193 docopt
194 )
195add_dependencies(veliad-firewall target-VELIA_VERSION)
196target_include_directories(veliad-firewall PUBLIC ${CMAKE_BINARY_DIR})
197
Tomáš Pecka5123e002020-06-05 15:29:21 +0200198# Testing
Tomáš Peckaa06d74d2020-06-14 18:18:13 +0200199include(CTest)
Tomáš Pecka5123e002020-06-05 15:29:21 +0200200if(BUILD_TESTING)
Tomáš Pecka5123e002020-06-05 15:29:21 +0200201 find_package(trompeloeil 33 REQUIRED)
202 find_package(doctest 2.3.1 REQUIRED)
203
Tomáš Peckaefd88432020-06-17 15:31:39 +0200204 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tests/configure.cmake.h.in ${CMAKE_CURRENT_BINARY_DIR}/tests/configure.cmake.h)
205
Tomáš Pecka5123e002020-06-05 15:29:21 +0200206 add_library(DoctestIntegration STATIC
Tomáš Pecka261c8862020-11-05 11:23:08 +0100207 tests/doctest_integration.cpp
208 tests/trompeloeil_doctest.h
209 tests/wait-a-bit-longer.cpp
210 )
Tomáš Pecka5123e002020-06-05 15:29:21 +0200211 target_link_libraries(DoctestIntegration doctest::doctest trompeloeil spdlog::spdlog)
Tomáš Pecka261c8862020-11-05 11:23:08 +0100212 target_include_directories(DoctestIntegration PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/)
Tomáš Pecka5123e002020-06-05 15:29:21 +0200213 target_compile_definitions(DoctestIntegration PUBLIC DOCTEST_CONFIG_SUPER_FAST_ASSERTS)
214
Tomáš Pecka0a2e8902020-06-09 21:11:20 +0200215 add_library(DbusTesting STATIC
Tomáš Pecka991e4d52021-01-11 10:03:14 +0100216 tests/dbus-helpers/dbus_rauc_server.cpp
217 tests/dbus-helpers/dbus_rauc_server.h
Tomáš Pecka0a2e8902020-06-09 21:11:20 +0200218 tests/dbus-helpers/dbus_semaphore_server.cpp
Tomáš Pecka261c8862020-11-05 11:23:08 +0100219 tests/dbus-helpers/dbus_semaphore_server.h
Tomáš Peckaccd80c32020-06-22 14:44:32 +0200220 tests/dbus-helpers/dbus_systemd_server.cpp
Tomáš Pecka261c8862020-11-05 11:23:08 +0100221 tests/dbus-helpers/dbus_systemd_server.h
222 )
223 target_link_libraries(DbusTesting
224 PUBLIC
225 velia-utils
226 SDBusCpp::sdbus-c++
227 )
Tomáš Pecka0a2e8902020-06-09 21:11:20 +0200228
Tomáš Pecka9b1c9672020-11-11 15:24:06 +0100229 add_library(FsTestUtils STATIC
230 tests/fs-helpers/FileInjector.cpp
231 tests/fs-helpers/FileInjector.h
232 tests/fs-helpers/utils.cpp
233 tests/fs-helpers/utils.h
234 )
235 target_link_libraries(FsTestUtils
236 PUBLIC
237 ${STD_FILESYSTEM_LIBRARY}
238 )
239
Tomáš Pecka5123e002020-06-05 15:29:21 +0200240 function(velia_test name)
Tomáš Pecka261c8862020-11-05 11:23:08 +0100241 add_executable(test-${name} ${CMAKE_SOURCE_DIR}/tests/${name}.cpp)
242 target_link_libraries(test-${name} DoctestIntegration ${ARGN})
243 target_include_directories(test-${name}
244 PUBLIC
245 ${CMAKE_CURRENT_SOURCE_DIR}
246 PRIVATE
247 ${CMAKE_BINARY_DIR}
248 )
Tomáš Pecka5123e002020-06-05 15:29:21 +0200249
250 if(NOT CMAKE_CROSSCOMPILING)
Tomáš Pecka261c8862020-11-05 11:23:08 +0100251 add_test(test-${name} test-${name})
Tomáš Pecka5123e002020-06-05 15:29:21 +0200252 endif()
Tomáš Pecka5123e002020-06-05 15:29:21 +0200253 endfunction()
Tomáš Pecka5123e002020-06-05 15:29:21 +0200254
Tomáš Pecka98ad18d2020-11-13 15:39:55 +0100255 find_program(SYSREPOCTL sysrepoctl)
256 find_program(SYSREPOCFG sysrepocfg)
257
258 set(sysrepo_previous_fixture_name UNDEFINED)
259 function(sysrepo_fixture_env name)
260 set(test_name_init sysrepo:prep:${name})
261 set(test_name_cleanup sysrepo:clean:${name})
262 set(fixture_name sysrepo:env:${name})
263
264 add_test(NAME ${test_name_init} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/sysrepoctl-manage-module.sh ${SYSREPOCTL} ${SYSREPOCFG} prepare ${ARGN})
265 set_tests_properties(${test_name_init} PROPERTIES FIXTURES_SETUP ${fixture_name} RESOURCE_LOCK sysrepo)
266 add_test(NAME ${test_name_cleanup} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/sysrepoctl-manage-module.sh ${SYSREPOCTL} ${SYSREPOCFG} uninstall ${ARGN})
267 set_tests_properties(${test_name_cleanup} PROPERTIES FIXTURES_CLEANUP ${fixture_name} RESOURCE_LOCK sysrepo)
268
269 if (sysrepo_previous_fixture_name)
270 set_tests_properties(${test_name_init} PROPERTIES DEPENDS sysrepo:clean:${sysrepo_previous_fixture_name})
271 endif ()
272
273 set(sysrepo_previous_fixture_name ${name} PARENT_SCOPE)
274 endfunction()
275
Tomáš Pecka261c8862020-11-05 11:23:08 +0100276 velia_test(health_state-manager velia-health)
277 velia_test(health_input-semaphore velia-health DbusTesting)
278 velia_test(health_input-systemd velia-health DbusTesting)
279 velia_test(health_output-led velia-health)
Tomáš Pecka491f4f22020-11-05 15:44:00 +0100280
Tomáš Pecka991e4d52021-01-11 10:03:14 +0100281 velia_test(system_rauc velia-system DbusTesting)
282
Tomáš Pecka9b1c9672020-11-11 15:24:06 +0100283 velia_test(hardware_emmc velia-ietf-hardware FsTestUtils)
284 velia_test(hardware_hwmon velia-ietf-hardware FsTestUtils)
Tomáš Pecka83b62e12020-12-16 14:50:49 +0100285
Tomáš Pecka292bc9c2021-01-11 22:03:11 +0100286 sysrepo_fixture_env(sysrepo-ietf-system YANG ${CMAKE_CURRENT_SOURCE_DIR}/yang/ietf-system@2014-08-06.yang)
Tomáš Peckaf976c5b2021-01-23 21:19:52 +0100287 velia_test(sysrepo_system-ietfsystem velia-system DbusTesting)
Tomáš Pecka292bc9c2021-01-11 22:03:11 +0100288 set_tests_properties(
Tomáš Peckaf976c5b2021-01-23 21:19:52 +0100289 test-sysrepo_system-ietfsystem
Tomáš Pecka292bc9c2021-01-11 22:03:11 +0100290 PROPERTIES FIXTURES_REQUIRED sysrepo:env:sysrepo-ietf-system
291 RESOURCE_LOCK sysrepo
292 )
293
Tomáš Pecka83b62e12020-12-16 14:50:49 +0100294 sysrepo_fixture_env(sysrepo-ietf-hardware YANG ${CMAKE_CURRENT_SOURCE_DIR}/yang/iana-hardware@2018-03-13.yang YANG ${CMAKE_CURRENT_SOURCE_DIR}/yang/ietf-hardware@2018-03-13.yang FEATURE hardware-sensor)
Tomáš Pecka98ad18d2020-11-13 15:39:55 +0100295 velia_test(hardware_ietf-hardware velia-ietf-hardware velia-ietf-hardware-sysrepo)
Tomáš Pecka98ad18d2020-11-13 15:39:55 +0100296 set_tests_properties(
297 test-hardware_ietf-hardware
Tomáš Pecka83b62e12020-12-16 14:50:49 +0100298 PROPERTIES FIXTURES_REQUIRED sysrepo:env:sysrepo-ietf-hardware
Tomáš Pecka55f64f82020-12-10 19:03:30 +0100299 RESOURCE_LOCK sysrepo
300 )
301
302 velia_test(sysrepo_two-daemons velia-ietf-hardware-sysrepo)
Tomáš Pecka83b62e12020-12-16 14:50:49 +0100303 # ctest dance for sysrepo_two-daemons: compile daemon, create a fixture for test, add the test into the fixture
Tomáš Pecka55f64f82020-12-10 19:03:30 +0100304 add_executable(test-sysrepo_test_merge-daemon ${CMAKE_SOURCE_DIR}/tests/sysrepo_two-daemons_daemon.cpp)
305 target_link_libraries(test-sysrepo_test_merge-daemon PkgConfig::SYSREPO PkgConfig::LIBYANG)
306
307 add_test(NAME sysrepo_test_merge-start COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/sysrepo_two-daemons_control.sh start)
308 add_test(NAME sysrepo_test_merge-stop COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/sysrepo_two-daemons_control.sh stop)
309 set_tests_properties(sysrepo_test_merge-start PROPERTIES FIXTURES_SETUP sysrepo:two-daemons RESOURCE_LOCK sysrepo)
310 set_tests_properties(sysrepo_test_merge-stop PROPERTIES FIXTURES_CLEANUP sysrepo:two-daemons RESOURCE_LOCK sysrepo)
Tomáš Pecka55f64f82020-12-10 19:03:30 +0100311
312 set_tests_properties(
313 test-sysrepo_two-daemons
314 PROPERTIES
315 FIXTURES_REQUIRED "sysrepo:two-daemons;sysrepo:env:sysrepo-ietf-hardware"
Tomáš Pecka98ad18d2020-11-13 15:39:55 +0100316 RESOURCE_LOCK sysrepo
317 )
Tomáš Pecka83b62e12020-12-16 14:50:49 +0100318 # ensure we run two-daemons merge test and ietf-hardware test sequentially and don't cleanup before everything ends
319 set_tests_properties(sysrepo_test_merge-start PROPERTIES DEPENDS test-hardware_ietf-hardware)
320 set_tests_properties(sysrepo:clean:sysrepo-ietf-hardware PROPERTIES DEPENDS sysrepo_test_merge-stop)
321
Tomáš Pecka73a13cc2020-11-17 11:12:19 +0100322
323 find_program(YANGLINT_PATH yanglint)
324 if (NOT YANGLINT_PATH)
325 message(FATAL_ERROR "Cannot find libyang's yanglint")
326 endif()
327 foreach(yang_file ${YANG_SRCS})
328 add_test(NAME yang-tree:${yang_file} COMMAND ${YANGLINT_PATH} -f tree ${CMAKE_CURRENT_SOURCE_DIR}/${yang_file})
329 endforeach()
Václav Kubernátd386aba2021-01-19 10:03:28 +0100330
331 sysrepo_fixture_env(sysrepo-firewall
332 # Installing czechlight-firewall automatically installs ietf-access-control-list as implemented (not just
333 # imported) but I still need to install it myself to enable the features.
334 YANG ${CMAKE_CURRENT_SOURCE_DIR}/yang/ietf-access-control-list@2019-03-04.yang
335 FEATURE eth
336 FEATURE match-on-eth
337 FEATURE match-on-ipv4
338 FEATURE ipv4
339 FEATURE match-on-ipv6
340 FEATURE ipv6
341 FEATURE mixed-eth-ipv4-ipv6
342 YANG ${CMAKE_CURRENT_SOURCE_DIR}/yang/czechlight-firewall@2021-01-25.yang
343 )
344
345 velia_test(sysrepo-firewall velia-firewall)
346 set_tests_properties(
347 test-sysrepo-firewall
348 PROPERTIES FIXTURES_REQUIRED sysrepo:env:sysrepo-firewall
349 RESOURCE_LOCK sysrepo
350 )
Tomáš Pecka261c8862020-11-05 11:23:08 +0100351endif()
Tomáš Peckac927d662020-07-13 11:16:16 +0200352
Tomáš Pecka5123e002020-06-05 15:29:21 +0200353if(WITH_DOCS)
354 set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
355 set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
356 configure_file(${doxyfile_in} ${doxyfile} @ONLY)
357 add_custom_target(doc
358 COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
359 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
360 COMMENT "Generating API documentation with Doxygen"
361 VERBATIM
362 SOURCES ${doxyfile_in}
363 )
Tomáš Peckaa06d74d2020-06-14 18:18:13 +0200364endif()
Tomáš Pecka261c8862020-11-05 11:23:08 +0100365
Tomáš Pecka73a13cc2020-11-17 11:12:19 +0100366set(YANG_DIR ${CMAKE_INSTALL_PREFIX}/share/velia/yang)
367install(FILES ${YANG_SRCS} DESTINATION ${YANG_DIR})
Tomáš Pecka261c8862020-11-05 11:23:08 +0100368install(TARGETS veliad RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/)
Tomáš Pecka625b7a12021-01-23 20:55:51 +0100369install(TARGETS veliad-system RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/)