Jan Kundrát | d9d26a9 | 2018-02-22 12:49:21 +0100 | [diff] [blame] | 1 | project(netconf-cli LANGUAGES CXX) |
| 2 | cmake_minimum_required(VERSION 3.0) |
Jan Kundrát | 763db1e | 2018-05-25 15:43:51 +0200 | [diff] [blame] | 3 | set(CMAKE_CXX_STANDARD 17) |
Jan Kundrát | d9d26a9 | 2018-02-22 12:49:21 +0100 | [diff] [blame] | 4 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
Jan Kundrát | d47f655 | 2018-03-02 13:40:11 +0100 | [diff] [blame] | 5 | |
| 6 | include(GNUInstallDirs) |
| 7 | |
| 8 | # Set a default build type if none was specified. This was shamelessly stolen |
| 9 | # from VTK's cmake setup because these guys produce both CMake and a project that |
| 10 | # manipulates this variable, and the web is full of posts where people say that |
| 11 | # it is apparently evil to just set the build type in a way an earlier version of |
| 12 | # this patch did. Oh, and the location of this check/update matters, apparently. |
| 13 | # |
| 14 | # Yes, this is just plain crazy. |
| 15 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) |
| 16 | message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") |
| 17 | set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) |
| 18 | # Set the possible values of build type for cmake-gui |
| 19 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") |
| 20 | endif() |
| 21 | |
| 22 | # -Werror is not a default for sanity reasons (one cannot know what warnings a future compiler |
| 23 | # might bring along), but it's a default in debug mode. The idea is that developers should care |
| 24 | # about a warning-free build, and that this is easier than messing with yet another configure option. |
| 25 | set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_FLAGS_DEBUG}") |
| 26 | |
| 27 | # I don't want to duplicate the compiler's optimizations |
| 28 | set(CMAKE_CXX_FLAGS "-O2 ${CMAKE_CXX_FLAGS}") |
| 29 | |
| 30 | # Build warnings are useful tools (and this project should be warning-free anyway), enable them on all |
| 31 | # configurations. They are warnings, not errors. |
Jan Kundrát | fb83190 | 2018-05-26 18:58:52 +0200 | [diff] [blame] | 32 | set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Woverloaded-virtual ${CMAKE_CXX_FLAGS}") |
| 33 | |
| 34 | if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| 35 | set(CMAKE_CXX_FLAGS "-Wsuggest-override ${CMAKE_CXX_FLAGS}") |
| 36 | endif() |
Jan Kundrát | d47f655 | 2018-03-02 13:40:11 +0100 | [diff] [blame] | 37 | |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 38 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") |
| 39 | |
| 40 | add_custom_target(git-version-cmake-ide |
| 41 | cmake/ProjectGitVersion.cmake |
| 42 | cmake/ProjectGitVersionRunner.cmake |
| 43 | ) |
| 44 | include(cmake/ProjectGitVersion.cmake) |
| 45 | prepare_git_version(NETCONF_CLI_VERSION "0.0") |
| 46 | |
Jan Kundrát | 608818b | 2018-03-02 13:43:53 +0100 | [diff] [blame] | 47 | find_package(Doxygen) |
| 48 | option(WITH_DOCS "Create and install internal documentation (needs Doxygen)" ${DOXYGEN_FOUND}) |
| 49 | |
Jan Kundrát | d47f655 | 2018-03-02 13:40:11 +0100 | [diff] [blame] | 50 | find_package(docopt REQUIRED) |
Jan Kundrát | 03caee8 | 2018-03-08 14:16:56 +0100 | [diff] [blame] | 51 | find_package(Boost REQUIRED) |
Jan Kundrát | 8d8efe8 | 2019-10-18 10:21:36 +0200 | [diff] [blame] | 52 | find_library(REPLXX_LIBRARY NAMES replxx replxx-d REQUIRED) |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 53 | find_path(REPLXX_PATH replxx.hxx) |
| 54 | if("${REPLXX_PATH}" STREQUAL REPLXX_PATH-NOTFOUND) |
| 55 | message(FATAL_ERROR "Cannot find the \"replxx.hxx\" include file for the replxx library.") |
| 56 | endif() |
Jan Kundrát | 608818b | 2018-03-02 13:43:53 +0100 | [diff] [blame] | 57 | |
Jan Kundrát | e05448a | 2018-06-13 15:54:33 +0200 | [diff] [blame] | 58 | find_package(PkgConfig) |
| 59 | pkg_check_modules(LIBYANG REQUIRED libyang-cpp>=0.15.111) |
Jan Kundrát | bd17836 | 2019-02-05 19:00:04 +0100 | [diff] [blame] | 60 | # TODO: bump to 0.7.8 once it is tagged |
| 61 | pkg_check_modules(SYSREPO REQUIRED libSysrepo-cpp>=0.7.7) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 62 | pkg_check_modules(LIBNETCONF2 REQUIRED libnetconf2>=0.12.47) |
Jan Kundrát | e05448a | 2018-06-13 15:54:33 +0200 | [diff] [blame] | 63 | |
Václav Kubernát | b96eef7 | 2018-05-04 19:10:22 +0200 | [diff] [blame] | 64 | # we don't need filename tracking, and we prefer to use header-only Boost |
| 65 | add_definitions(-DBOOST_SPIRIT_X3_NO_FILESYSTEM) |
| 66 | |
Jan Kundrát | 578347c | 2018-08-09 15:02:06 +0200 | [diff] [blame] | 67 | add_library(schemas STATIC |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 68 | src/static_schema.cpp |
Václav Kubernát | 48fc383 | 2018-05-28 14:21:22 +0200 | [diff] [blame] | 69 | src/schema.cpp |
Jan Kundrát | 578347c | 2018-08-09 15:02:06 +0200 | [diff] [blame] | 70 | ) |
| 71 | target_link_libraries(schemas PUBLIC Boost::boost) |
| 72 | |
Václav Kubernát | e7a9fa3 | 2018-08-22 13:56:35 +0200 | [diff] [blame] | 73 | add_library(datastoreaccess STATIC |
| 74 | src/datastore_access.cpp |
| 75 | ) |
| 76 | target_link_libraries(datastoreaccess PUBLIC Boost::boost) |
| 77 | |
Václav Kubernát | 80aacc0 | 2018-08-22 17:41:54 +0200 | [diff] [blame] | 78 | add_library(sysrepoaccess STATIC |
| 79 | src/sysrepo_access.cpp |
| 80 | ) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 81 | |
Václav Kubernát | 80aacc0 | 2018-08-22 17:41:54 +0200 | [diff] [blame] | 82 | target_link_libraries(sysrepoaccess datastoreaccess ${SYSREPO_LIBRARIES}) |
| 83 | link_directories(${SYSREPO_LIBRARY_DIRS}) |
| 84 | target_include_directories(sysrepoaccess SYSTEM PRIVATE ${SYSREPO_INCLUDE_DIRS}) |
| 85 | |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 86 | add_library(netconfaccess STATIC |
| 87 | src/netconf-client.cpp |
| 88 | src/netconf_access.cpp |
| 89 | ) |
| 90 | |
| 91 | target_link_libraries(netconfaccess datastoreaccess ${LIBNETCONF2_LIBRARIES}) |
| 92 | link_directories(${LIBNETCONF2_LIBRARY_DIRS}) |
| 93 | target_include_directories(netconfaccess SYSTEM PRIVATE ${LIBNETCONF2_INCLUDE_DIRS}) |
| 94 | |
Václav Kubernát | 0d4db44 | 2018-07-18 17:18:43 +0200 | [diff] [blame] | 95 | add_library(yangschema STATIC |
| 96 | src/yang_schema.cpp |
| 97 | ) |
| 98 | target_link_libraries(yangschema ${LIBYANG_LIBRARIES}) |
| 99 | # Ensure that this doesn't override Boost's -isystem -- see the log for details. |
| 100 | target_include_directories(yangschema SYSTEM PRIVATE ${LIBYANG_INCLUDEDIR}) |
| 101 | link_directories(${LIBYANG_LIBRARY_DIRS}) |
| 102 | |
Jan Kundrát | 578347c | 2018-08-09 15:02:06 +0200 | [diff] [blame] | 103 | add_library(parser STATIC |
Václav Kubernát | 48fc383 | 2018-05-28 14:21:22 +0200 | [diff] [blame] | 104 | src/parser.cpp |
Václav Kubernát | 24df80e | 2018-06-06 15:18:03 +0200 | [diff] [blame] | 105 | src/ast_commands.cpp |
| 106 | src/ast_path.cpp |
Václav Kubernát | 94938b7 | 2018-05-04 15:12:24 +0200 | [diff] [blame] | 107 | src/utils.cpp |
Václav Kubernát | 195eeea | 2018-05-18 13:52:36 +0200 | [diff] [blame] | 108 | src/parser_context.cpp |
Václav Kubernát | 96344a1 | 2018-05-28 16:33:39 +0200 | [diff] [blame] | 109 | src/interpreter.cpp |
Václav Kubernát | 329c6c3 | 2019-02-06 16:41:53 +0100 | [diff] [blame] | 110 | src/ast_handlers.cpp |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 111 | ) |
Jan Kundrát | 578347c | 2018-08-09 15:02:06 +0200 | [diff] [blame] | 112 | target_link_libraries(parser schemas) |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 113 | |
Václav Kubernát | 7310938 | 2018-09-14 19:52:03 +0200 | [diff] [blame] | 114 | |
| 115 | add_library(sysreposubscription STATIC |
| 116 | tests/mock/sysrepo_subscription.cpp |
| 117 | ) |
| 118 | |
| 119 | target_link_libraries(sysreposubscription ${SYSREPO_LIBRARIES}) |
| 120 | link_directories(${SYSREPO_LIBRARY_DIRS}) |
| 121 | target_include_directories(sysreposubscription SYSTEM PRIVATE ${SYSREPO_INCLUDE_DIRS}) |
| 122 | |
Jan Kundrát | cc4c1f2 | 2018-08-09 15:00:03 +0200 | [diff] [blame] | 123 | add_executable(netconf-cli |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 124 | src/main.cpp |
| 125 | ) |
Václav Kubernát | a395d33 | 2019-02-13 16:49:20 +0100 | [diff] [blame] | 126 | target_include_directories(netconf-cli PRIVATE ${REPLXX_PATH}) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 127 | target_link_libraries(netconf-cli netconfaccess sysrepoaccess yangschema docopt parser ${REPLXX_LIBRARY}) |
Václav Kubernát | 2b68461 | 2018-08-09 18:55:24 +0200 | [diff] [blame] | 128 | if(CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+") |
| 129 | target_link_libraries(netconf-cli c++experimental) |
| 130 | else() |
| 131 | target_link_libraries(netconf-cli stdc++fs) |
| 132 | endif() |
| 133 | |
Jan Kundrát | dc2b072 | 2018-03-02 14:13:37 +0100 | [diff] [blame] | 134 | add_dependencies(netconf-cli target-NETCONF_CLI_VERSION) |
| 135 | target_include_directories(netconf-cli PRIVATE ${PROJECT_BINARY_DIR}) |
| 136 | |
Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 137 | include(CTest) |
| 138 | if(BUILD_TESTING) |
| 139 | enable_testing() |
Jan Kundrát | c381e63 | 2019-03-14 13:39:11 +0100 | [diff] [blame] | 140 | find_package(trompeloeil 33 REQUIRED) |
Jan Kundrát | a33cf08 | 2019-03-28 11:55:57 +0100 | [diff] [blame] | 141 | find_package(doctest 2.3.1 REQUIRED) |
Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 142 | |
Jan Kundrát | a33cf08 | 2019-03-28 11:55:57 +0100 | [diff] [blame] | 143 | add_library(DoctestIntegration STATIC |
| 144 | tests/doctest_integration.cpp |
| 145 | tests/trompeloeil_doctest.h |
Jan Kundrát | c381e63 | 2019-03-14 13:39:11 +0100 | [diff] [blame] | 146 | tests/wait-a-bit-longer.cpp |
Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 147 | ) |
Jan Kundrát | a33cf08 | 2019-03-28 11:55:57 +0100 | [diff] [blame] | 148 | target_include_directories(DoctestIntegration PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/ ${CMAKE_CURRENT_SOURCE_DIR}/src/) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 149 | target_link_libraries(DoctestIntegration doctest::doctest trompeloeil) |
Jan Kundrát | a33cf08 | 2019-03-28 11:55:57 +0100 | [diff] [blame] | 150 | target_compile_definitions(DoctestIntegration PUBLIC DOCTEST_CONFIG_SUPER_FAST_ASSERTS) |
Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 151 | |
Václav Kubernát | 7310938 | 2018-09-14 19:52:03 +0200 | [diff] [blame] | 152 | if (NOT SYSREPOCTL_EXECUTABLE) |
| 153 | find_program(SYSREPOCTL_EXECUTABLE sysrepoctl) |
| 154 | endif() |
| 155 | if (NOT SYSREPOCTL_EXECUTABLE) |
| 156 | message(FATAL_ERROR "Unable to find sysrepoctl, set SYSREPOCTL_EXECUTABLE manually.") |
| 157 | endif() |
| 158 | |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 159 | if (NOT SYSREPOCFG_EXECUTABLE) |
| 160 | find_program(SYSREPOCFG_EXECUTABLE sysrepocfg) |
| 161 | endif() |
| 162 | if (NOT SYSREPOCFG_EXECUTABLE) |
| 163 | message(FATAL_ERROR "Unable to find sysrepocfg, set SYSREPOCFG_EXECUTABLE manually.") |
| 164 | endif() |
Václav Kubernát | 7310938 | 2018-09-14 19:52:03 +0200 | [diff] [blame] | 165 | |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 166 | if (NOT SYSREPOD_EXECUTABLE) |
| 167 | find_program(SYSREPOD_EXECUTABLE sysrepod) |
| 168 | endif() |
| 169 | if (NOT SYSREPOD_EXECUTABLE) |
| 170 | message(FATAL_ERROR "Unable to find sysrepod, set SYSREPOD_EXECUTABLE manually.") |
| 171 | endif() |
| 172 | |
| 173 | if (NOT SYSREPO_PLUGIND_EXECUTABLE) |
| 174 | find_program(SYSREPO_PLUGIND_EXECUTABLE sysrepo-plugind) |
| 175 | endif() |
| 176 | if (NOT SYSREPO_PLUGIND_EXECUTABLE) |
| 177 | message(FATAL_ERROR "Unable to find sysrepo-plugind, set SYSREPO_EXECUTABLE manually.") |
| 178 | endif() |
| 179 | |
| 180 | if (NOT NETOPEER2_EXECUTABLE) |
| 181 | find_program(NETOPEER2_EXECUTABLE netopeer2-server) |
| 182 | endif() |
| 183 | if (NOT NETOPEER2_EXECUTABLE) |
| 184 | message(FATAL_ERROR "Unable to find netopeer2-server, set NETOPEER2_EXECUTABLE manually.") |
| 185 | endif() |
| 186 | |
Jan Kundrát | e323627 | 2019-09-27 09:45:26 +0200 | [diff] [blame] | 187 | if (NOT FAKEROOT_EXECUTABLE) |
| 188 | find_program(FAKEROOT_EXECUTABLE fakeroot) |
| 189 | endif() |
| 190 | if (NOT FAKEROOT_EXECUTABLE) |
| 191 | message(FATAL_ERROR "Unable to find fakeroot, set FAKEROOT_EXECUTABLE manually.") |
| 192 | endif() |
| 193 | |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 194 | set(NETOPEER_SOCKET_PATH "${CMAKE_CURRENT_BINARY_DIR}/netopeer2-server.sock") |
| 195 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/start_daemons.sh.in ${CMAKE_CURRENT_BINARY_DIR}/start_daemons.sh @ONLY) |
| 196 | configure_file(${CMAKE_CURRENT_SOURCE_DIR}/netopeer_vars.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/netopeer_vars.hpp @ONLY) |
| 197 | |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 198 | function(cli_test name) |
| 199 | if (${ARGC} GREATER 1) # this is how CMake does optional arguments |
| 200 | add_executable(test_${name} |
| 201 | tests/${ARGV1} |
| 202 | ) |
| 203 | else() |
| 204 | add_executable(test_${name} |
| 205 | tests/${name}.cpp |
| 206 | ) |
Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 207 | endif() |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 208 | target_link_libraries(test_${name} DoctestIntegration parser) |
| 209 | if(NOT CMAKE_CROSSCOMPILING) |
| 210 | add_test(test_${name} test_${name}) |
| 211 | endif() |
| 212 | target_include_directories(test_${name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) |
Jan Kundrát | cc4c1f2 | 2018-08-09 15:00:03 +0200 | [diff] [blame] | 213 | endfunction() |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 214 | |
| 215 | function(datastore_test name fname model_path) |
| 216 | cli_test(${name} ${fname}) |
| 217 | target_link_libraries(test_${name} sysreposubscription) |
| 218 | add_test(NAME test_${name}_init COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/sysrepoctl-manage-module.sh ${SYSREPOCTL_EXECUTABLE} ${SYSREPOCFG_EXECUTABLE} install ${model_path}) |
| 219 | add_test(NAME test_${name}_cleanup COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tests/sysrepoctl-manage-module.sh ${SYSREPOCTL_EXECUTABLE} ${SYSREPOCFG_EXECUTABLE} uninstall ${model_path}) |
| 220 | set_tests_properties(test_${name}_init PROPERTIES FIXTURES_SETUP ${name}-setup) |
| 221 | set_tests_properties(test_${name} PROPERTIES FIXTURES_REQUIRED ${name}-setup RESOURCE_LOCK sysrepo) |
| 222 | set_tests_properties(test_${name}_cleanup PROPERTIES FIXTURES_CLEANUP ${name}-setup) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 223 | target_compile_definitions(test_${name} PRIVATE ${name}_BACKEND) |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 224 | endfunction() |
| 225 | |
Václav Kubernát | d666296 | 2018-03-22 17:41:33 +0100 | [diff] [blame] | 226 | cli_test(cd) |
Václav Kubernát | 11afac7 | 2018-07-18 14:59:53 +0200 | [diff] [blame] | 227 | cli_test(ls) |
Václav Kubernát | b61336d | 2018-05-28 17:35:03 +0200 | [diff] [blame] | 228 | cli_test(presence_containers) |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 229 | cli_test(leaf_editing) |
Václav Kubernát | 0d4db44 | 2018-07-18 17:18:43 +0200 | [diff] [blame] | 230 | cli_test(yang) |
| 231 | target_link_libraries(test_yang yangschema) |
Václav Kubernát | 4108e0d | 2018-10-29 13:32:22 +0100 | [diff] [blame] | 232 | cli_test(utils) |
| 233 | cli_test(path_completion) |
Václav Kubernát | 5727242 | 2019-02-08 12:48:24 +0100 | [diff] [blame] | 234 | cli_test(command_completion) |
Václav Kubernát | 989b5de | 2019-02-20 16:28:35 +0100 | [diff] [blame] | 235 | cli_test(enum_completion) |
Václav Kubernát | f5f64f0 | 2019-03-19 17:15:47 +0100 | [diff] [blame] | 236 | cli_test(list_manipulation) |
Václav Kubernát | 1446fe1 | 2019-10-02 19:32:51 +0200 | [diff] [blame] | 237 | cli_test(parser_methods) |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 238 | datastore_test(sysrepo sysrepo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/example-schema.yang) |
Václav Kubernát | 9456b5c | 2019-10-02 21:14:52 +0200 | [diff] [blame] | 239 | target_link_libraries(test_sysrepo sysrepoaccess yangschema parser) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 240 | datastore_test(netconf sysrepo.cpp ${CMAKE_CURRENT_SOURCE_DIR}/example-schema.yang) |
Jan Kundrát | e323627 | 2019-09-27 09:45:26 +0200 | [diff] [blame] | 241 | add_test(NAME start_daemons COMMAND ${FAKEROOT_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/start_daemons.sh) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 242 | add_test(NAME setup_netopeer COMMAND ${SYSREPOCFG_EXECUTABLE} ietf-netconf-server -i ${CMAKE_CURRENT_SOURCE_DIR}/netopeer-test-config --datastore=startup --format=xml) |
| 243 | add_test(NAME kill_daemons COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/kill_daemons.sh) |
Václav Kubernát | af1e125 | 2019-10-09 18:12:44 +0200 | [diff] [blame] | 244 | set_tests_properties(test_sysrepo_init PROPERTIES DEPENDS start_daemons) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 245 | set_tests_properties(start_daemons PROPERTIES DEPENDS setup_netopeer) |
Václav Kubernát | af1e125 | 2019-10-09 18:12:44 +0200 | [diff] [blame] | 246 | set_tests_properties(test_netconf_init PROPERTIES DEPENDS test_sysrepo_cleanup) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 247 | set_tests_properties(test_netconf_cleanup PROPERTIES DEPENDS kill_daemons) |
| 248 | set_tests_properties(kill_daemons PROPERTIES DEPENDS test_netconf) |
| 249 | |
Václav Kubernát | 8832481 | 2019-06-26 17:36:29 +0200 | [diff] [blame] | 250 | target_include_directories(test_sysrepo PRIVATE ${PROJECT_SOURCE_DIR}/tests/mock) |
Václav Kubernát | c31bd60 | 2019-03-07 11:44:48 +0100 | [diff] [blame] | 251 | target_link_libraries(test_netconf sysreposubscription netconfaccess yangschema parser) |
| 252 | target_include_directories(test_netconf PRIVATE ${PROJECT_SOURCE_DIR}/tests/mock) |
Jan Kundrát | 5c80521 | 2018-03-02 13:57:12 +0100 | [diff] [blame] | 253 | endif() |
| 254 | |
Jan Kundrát | 608818b | 2018-03-02 13:43:53 +0100 | [diff] [blame] | 255 | if(WITH_DOCS) |
| 256 | set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) |
| 257 | set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) |
| 258 | configure_file(${doxyfile_in} ${doxyfile} @ONLY) |
| 259 | add_custom_target(doc |
| 260 | COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} |
| 261 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} |
| 262 | COMMENT "Generating API documentation with Doxygen" |
| 263 | VERBATIM |
| 264 | SOURCES ${doxyfile_in} |
| 265 | ) |
| 266 | endif() |
Jan Kundrát | 10f4990 | 2018-05-22 17:01:45 +0200 | [diff] [blame] | 267 | |
| 268 | install(TARGETS |
| 269 | netconf-cli |
| 270 | RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/) |