Radek Krejci | b0cd394 | 2017-04-07 13:31:30 +0200 | [diff] [blame] | 1 | cmake_minimum_required(VERSION 2.8.12) |
Radek Krejci | 6367963 | 2019-04-03 14:22:27 +0200 | [diff] [blame] | 2 | |
| 3 | # force out-of-source build |
| 4 | if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) |
| 5 | message(FATAL_ERROR "In-source build is not allowed. Please make a standalone build directory and run CMake from there. You may need to remove CMakeCache.txt.") |
| 6 | endif() |
| 7 | |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 8 | project(libyang C) |
| 9 | |
Jan Kundrát | 37df09e | 2016-11-04 15:42:08 +0100 | [diff] [blame] | 10 | include(GNUInstallDirs) |
Renato Westphal | 63836f7 | 2018-06-04 19:37:02 -0300 | [diff] [blame] | 11 | include(CheckSymbolExists) |
Jan Kundrát | 37df09e | 2016-11-04 15:42:08 +0100 | [diff] [blame] | 12 | |
Michal Vasko | e5cf992 | 2015-11-11 11:06:40 +0100 | [diff] [blame] | 13 | set(LIBYANG_DESCRIPTION "libyang is YANG data modelling language parser and toolkit written (and providing API) in C.") |
| 14 | |
Radek Krejci | b0cd394 | 2017-04-07 13:31:30 +0200 | [diff] [blame] | 15 | # Correct RPATH usage on OS X |
| 16 | set(CMAKE_MACOSX_RPATH TRUE) |
| 17 | |
Radek Krejci | 23bc6ea | 2019-04-05 10:48:44 +0200 | [diff] [blame] | 18 | # Version of the project |
| 19 | # Generic version of not only the library. Major version is reserved for really big changes of the project, |
| 20 | # minor version changes with added functionality (new tool, functionality of the tool or library, ...) and |
| 21 | # micro version is changed with a set of small changes or bugfixes anywhere in the project. |
| 22 | set(LIBYANG_MAJOR_VERSION 1) |
| 23 | set(LIBYANG_MINOR_VERSION 0) |
Michal Vasko | f05fc1e | 2019-11-07 08:51:27 +0100 | [diff] [blame] | 24 | set(LIBYANG_MICRO_VERSION 89) |
Radek Krejci | 8f7cf40 | 2015-08-13 08:05:48 +0200 | [diff] [blame] | 25 | set(LIBYANG_VERSION ${LIBYANG_MAJOR_VERSION}.${LIBYANG_MINOR_VERSION}.${LIBYANG_MICRO_VERSION}) |
Radek Krejci | 23bc6ea | 2019-04-05 10:48:44 +0200 | [diff] [blame] | 26 | |
| 27 | # Version of the library |
| 28 | # Major version is changed with every backward non-compatible API/ABI change in libyang, minor version changes |
| 29 | # with backward compatible change and micro version is connected with any internal change of the library. |
| 30 | set(LIBYANG_MAJOR_SOVERSION 1) |
Michal Vasko | e65f839 | 2019-11-07 08:51:18 +0100 | [diff] [blame] | 31 | set(LIBYANG_MINOR_SOVERSION 3) |
| 32 | set(LIBYANG_MICRO_SOVERSION 0) |
Radek Krejci | 23bc6ea | 2019-04-05 10:48:44 +0200 | [diff] [blame] | 33 | set(LIBYANG_SOVERSION_FULL ${LIBYANG_MAJOR_SOVERSION}.${LIBYANG_MINOR_SOVERSION}.${LIBYANG_MICRO_SOVERSION}) |
| 34 | set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_SOVERSION}) |
Michal Vasko | fcd974b | 2017-08-22 10:17:49 +0200 | [diff] [blame] | 35 | |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 36 | # set default build type if not specified by user |
| 37 | if(NOT CMAKE_BUILD_TYPE) |
| 38 | set(CMAKE_BUILD_TYPE debug) |
| 39 | endif() |
| 40 | |
Renato Westphal | e32d40b | 2018-10-22 21:58:40 -0200 | [diff] [blame] | 41 | set(CMAKE_C_STANDARD 11) |
| 42 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 43 | set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") |
| 44 | set(CMAKE_C_FLAGS_PACKAGE "-g -O2 -DNDEBUG") |
| 45 | set(CMAKE_C_FLAGS_DEBUG "-g -O0") |
| 46 | |
| 47 | # options |
| 48 | if((CMAKE_BUILD_TYPE STREQUAL debug) OR (CMAKE_BUILD_TYPE STREQUAL Package)) |
| 49 | option(ENABLE_BUILD_TESTS "Build tests" ON) |
| 50 | option(ENABLE_VALGRIND_TESTS "Build tests with valgrind" ON) |
| 51 | else() |
| 52 | option(ENABLE_BUILD_TESTS "Build tests" OFF) |
| 53 | option(ENABLE_VALGRIND_TESTS "Build tests with valgrind" OFF) |
| 54 | endif() |
Michal Vasko | cd958c6 | 2017-11-03 16:33:59 +0100 | [diff] [blame] | 55 | option(ENABLE_CALLGRIND_TESTS "Build performance tests to be run with callgrind" OFF) |
Michal Vasko | d025ee3 | 2018-06-28 10:04:19 +0200 | [diff] [blame] | 56 | |
| 57 | option(ENABLE_CACHE "Enable data caching for schemas and hash tables for data (time-efficient at the cost of increased space-complexity)" ON) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 58 | option(ENABLE_LATEST_REVISIONS "Enable reusing of latest revisions of schemas" ON) |
Michal Vasko | d025ee3 | 2018-06-28 10:04:19 +0200 | [diff] [blame] | 59 | option(ENABLE_LYD_PRIV "Add a private pointer also to struct lyd_node (data node structure), just like in struct lys_node, for arbitrary user data" OFF) |
Juraj Vijtiuk | fcd6fd8 | 2019-01-13 09:41:43 -0500 | [diff] [blame] | 60 | option(ENABLE_FUZZ_TARGETS "Build target programs suitable for fuzzing with AFL" OFF) |
Michal Vasko | c6cd3f0 | 2018-03-02 14:07:42 +0100 | [diff] [blame] | 61 | set(PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libyang" CACHE STRING "Directory with libyang plugins (extensions and user types)") |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 62 | |
Michal Vasko | fcd974b | 2017-08-22 10:17:49 +0200 | [diff] [blame] | 63 | if(ENABLE_CACHE) |
Michal Vasko | d025ee3 | 2018-06-28 10:04:19 +0200 | [diff] [blame] | 64 | set(LY_ENABLED_CACHE 1) |
| 65 | endif() |
| 66 | if(ENABLE_LATEST_REVISIONS) |
| 67 | set(LY_ENABLED_LATEST_REVISIONS 1) |
| 68 | endif() |
| 69 | if(ENABLE_LYD_PRIV) |
| 70 | set(LY_ENABLED_LYD_PRIV 1) |
Michal Vasko | fcd974b | 2017-08-22 10:17:49 +0200 | [diff] [blame] | 71 | endif() |
| 72 | |
Michal Vasko | 70bf8e5 | 2018-03-26 11:32:33 +0200 | [diff] [blame] | 73 | if(CMAKE_C_COMPILER_ID STREQUAL "GNU") |
Michal Vasko | 70bf8e5 | 2018-03-26 11:32:33 +0200 | [diff] [blame] | 74 | set(COMPILER_UNUSED_ATTR "UNUSED_ ## x __attribute__((__unused__))") |
| 75 | set(COMPILER_PACKED_ATTR "__attribute__((__packed__))") |
| 76 | elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang") |
| 77 | # require at least clang 3.0 |
| 78 | if (CMAKE_C_COMPILER_VERSION VERSION_LESS 3.0) |
| 79 | message(FATAL_ERROR "Clang version must be at least 3.0!") |
| 80 | endif() |
Michal Vasko | 0e9b297 | 2018-03-26 11:53:29 +0200 | [diff] [blame] | 81 | set(COMPILER_UNUSED_ATTR "UNUSED_ ## x __attribute__((__unused__))") |
Michal Vasko | 70bf8e5 | 2018-03-26 11:32:33 +0200 | [diff] [blame] | 82 | set(COMPILER_PACKED_ATTR "__attribute__((__packed__))") |
| 83 | else() |
Renato Westphal | e32d40b | 2018-10-22 21:58:40 -0200 | [diff] [blame] | 84 | message(WARNING "You are using an unknown compiler, it must support C11 standard \"_Generic\" statement or the \"__builtin_types_compatible_p\" built-in function.") |
Michal Vasko | 0e9b297 | 2018-03-26 11:53:29 +0200 | [diff] [blame] | 85 | set(COMPILER_UNUSED_ATTR "UNUSED_ ## x") |
Michal Vasko | 70bf8e5 | 2018-03-26 11:32:33 +0200 | [diff] [blame] | 86 | set(COMPILER_PACKED_ATTR "") |
| 87 | endif() |
| 88 | |
Jan Kundrát | fd7a5c7 | 2017-10-26 17:45:06 +0200 | [diff] [blame] | 89 | include_directories(${PROJECT_BINARY_DIR}/src ${PROJECT_SOURCE_DIR}/src) |
| 90 | configure_file(${PROJECT_SOURCE_DIR}/src/libyang.h.in ${PROJECT_BINARY_DIR}/src/libyang.h @ONLY) |
Michal Vasko | 70bf8e5 | 2018-03-26 11:32:33 +0200 | [diff] [blame] | 91 | configure_file(${PROJECT_SOURCE_DIR}/src/common.h.in ${PROJECT_BINARY_DIR}/src/common.h @ONLY) |
Radek Krejci | 8f7cf40 | 2015-08-13 08:05:48 +0200 | [diff] [blame] | 92 | |
Michal Vasko | c6cd3f0 | 2018-03-02 14:07:42 +0100 | [diff] [blame] | 93 | set(EXTENSIONS_PLUGINS_DIR_MACRO "${PLUGINS_DIR}/extensions") |
| 94 | set(USER_TYPES_PLUGINS_DIR_MACRO "${PLUGINS_DIR}/user_types") |
Radek Krejci | 858ad95 | 2017-01-04 11:16:32 +0100 | [diff] [blame] | 95 | |
Michal Vasko | e4e8fbd | 2015-08-24 14:54:49 +0200 | [diff] [blame] | 96 | # include custom Modules |
Radek Krejci | 977c1c8 | 2015-09-01 15:18:03 +0200 | [diff] [blame] | 97 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/") |
Michal Vasko | e4e8fbd | 2015-08-24 14:54:49 +0200 | [diff] [blame] | 98 | |
Mislav Novakovic | edc6c08 | 2017-05-30 15:21:42 +0200 | [diff] [blame] | 99 | # setup bindings |
| 100 | set(GEN_LANGUAGE_BINDINGS 0 CACHE BOOL "Enable language bindings generation.") |
| 101 | set(GEN_CPP_BINDINGS 1 CACHE BOOL "Enable C++ bindings.") |
| 102 | # Python bindings depend on C++ bindings because of SWIG |
| 103 | set(GEN_PYTHON_BINDINGS 1 CACHE BOOL "Enable Python bindings.") |
| 104 | set(GEN_PYTHON_VERSION "3" CACHE STRING "Python version") |
| 105 | set(GEN_JAVASCRIPT_BINDINGS 0 CACHE BOOL "Enable JavaScript bindings.") |
Michal Vasko | 5edb0ee | 2018-10-23 08:55:25 +0200 | [diff] [blame] | 106 | set(GEN_JAVA_BINDINGS 0 CACHE BOOL "Enable Java bindings.") |
Mislav Novakovic | edc6c08 | 2017-05-30 15:21:42 +0200 | [diff] [blame] | 107 | |
Pavol Vican | f7cc285 | 2016-03-22 23:27:35 +0100 | [diff] [blame] | 108 | find_package(FLEX) |
Pavol Vican | cae5488 | 2016-03-30 12:24:43 +0200 | [diff] [blame] | 109 | find_package(BISON) |
Michal Vasko | aa515e8 | 2018-03-23 08:45:19 +0100 | [diff] [blame] | 110 | find_program(DEB_BUILDER NAMES debuild) |
| 111 | find_program(RPM_BUILDER NAMES rpmbuild) |
| 112 | find_program(SED_TOOL NAMES sed) |
Pavol Vican | f7cc285 | 2016-03-22 23:27:35 +0100 | [diff] [blame] | 113 | |
Pavol Vican | cae5488 | 2016-03-30 12:24:43 +0200 | [diff] [blame] | 114 | if(NOT BISON_FOUND) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 115 | message(WARNING "Missing Bison.\nYou won't be able to generate source codes from changed flex/bison files.\nCompiling libyang should still works fine.") |
Pavol Vican | cae5488 | 2016-03-30 12:24:43 +0200 | [diff] [blame] | 116 | elseif (NOT FLEX_FOUND) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 117 | message(WARNING "Missing Flex.\nYou won't be able to generate source codes from changed flex/bison files.\nCompiling libyang should still works fine.") |
Pavol Vican | cae5488 | 2016-03-30 12:24:43 +0200 | [diff] [blame] | 118 | else() |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 119 | if (BISON_VERSION VERSION_LESS 3) |
| 120 | set(EMPTYDIR "") |
| 121 | else () |
| 122 | set(EMPTYDIR "%empty") |
| 123 | endif() |
Jan Kundrát | fd7a5c7 | 2017-10-26 17:45:06 +0200 | [diff] [blame] | 124 | configure_file(${PROJECT_SOURCE_DIR}/src/yang.y.in ${PROJECT_BINARY_DIR}/src/yang.y) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 125 | add_custom_target(bison |
| 126 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src |
Radek Krejci | f2dc9c3 | 2017-10-27 14:17:52 +0200 | [diff] [blame] | 127 | COMMAND bison -l -o parser_yang_bis.c --defines=parser_yang_bis.h ${PROJECT_BINARY_DIR}/src/yang.y |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 128 | COMMAND flex -8 -L -o parser_yang_lex.c --header-file=parser_yang_lex.h yang.l |
| 129 | COMMAND ${SED_TOOL} -i 's/int yychar\;/int yychar\;\\nchar *s = NULL, *tmp_s = NULL, *ext_name = NULL\;\\nstruct lys_module *trg = NULL\;\\nstruct lys_node *tpdf_parent = NULL, *data_node = NULL\;\\nstruct lys_ext_instance_complex *ext_instance = NULL\;\\nint is_ext_instance\;\\nvoid *actual = NULL\;\\nenum yytokentype backup_type, actual_type = MODULE_KEYWORD\;\\nint64_t cnt_val = 0\;\\nint is_value = 0\;\\nvoid *yang_type = NULL\;/' parser_yang_bis.c |
| 130 | ) |
Pavol Vican | cae5488 | 2016-03-30 12:24:43 +0200 | [diff] [blame] | 131 | endif() |
Pavol Vican | f7cc285 | 2016-03-22 23:27:35 +0100 | [diff] [blame] | 132 | |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 133 | if (NOT DEFINED ENV{TRAVIS_BRANCH}) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 134 | execute_process(COMMAND "git" "rev-parse" "--abbrev-ref" "HEAD" |
| 135 | OUTPUT_VARIABLE GIT_BRANCH |
| 136 | OUTPUT_STRIP_TRAILING_WHITESPACE |
| 137 | ERROR_QUIET |
| 138 | ) |
| 139 | if (NOT GIT_BRANCH) |
| 140 | set(ENV{TRAVIS_BRANCH} "master") |
| 141 | else() |
| 142 | if (GIT_BRANCH MATCHES "master|devel") |
| 143 | set(ENV{TRAVIS_BRANCH} ${GIT_BRANCH}) |
| 144 | else() |
| 145 | set(ENV{TRAVIS_BRANCH} "master") |
| 146 | endif() |
| 147 | endif() |
| 148 | set(GIT_BRANCH $ENV{TRAVIS_BRANCH}) |
PavolVican | 3739627 | 2017-03-25 00:57:20 +0100 | [diff] [blame] | 149 | endif() |
| 150 | |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 151 | if ($ENV{TRAVIS_BRANCH} STREQUAL "master") |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 152 | set(PACKAGE_NAME "libyang") |
PavolVican | 8738eee | 2018-02-27 01:47:02 +0100 | [diff] [blame] | 153 | set(PACKAGE_PART_NAME "") |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 154 | set(BRANCH "master") |
| 155 | set(BUILD_TYPE "Package") |
| 156 | set(CONFLICT_PACKAGE_NAME "libyang-experimental") |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 157 | else () |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 158 | set(PACKAGE_NAME "libyang-experimental") |
PavolVican | 8738eee | 2018-02-27 01:47:02 +0100 | [diff] [blame] | 159 | set(PACKAGE_PART_NAME "-experimental") |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 160 | set(BRANCH "devel") |
| 161 | set(BUILD_TYPE "debug") |
| 162 | set(CONFLICT_PACKAGE_NAME "libyang") |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 163 | endif() |
| 164 | # change version in config files |
| 165 | configure_file(${PROJECT_SOURCE_DIR}/packages/libyang.spec.in ${PROJECT_BINARY_DIR}/build-packages/libyang.spec) |
| 166 | configure_file(${PROJECT_SOURCE_DIR}/packages/libyang.dsc.in ${PROJECT_BINARY_DIR}/build-packages/libyang.dsc) |
| 167 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.control.in ${PROJECT_BINARY_DIR}/build-packages/debian.control @ONLY) |
| 168 | configure_file(${PROJECT_SOURCE_DIR}/packages/debian.rules.in ${PROJECT_BINARY_DIR}/build-packages/debian.rules) |
| 169 | |
PavolVican | cf74925 | 2017-06-08 09:31:49 +0200 | [diff] [blame] | 170 | if (NOT DEB_BUILDER) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 171 | message(WARNING "Missing tools (devscripts, debhelper package) for building deb package.\nYou won't be able to generate deb package from source code.\nCompiling libyang should still works fine.") |
PavolVican | cf74925 | 2017-06-08 09:31:49 +0200 | [diff] [blame] | 172 | else () |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 173 | # target for local build deb package |
| 174 | add_custom_target(build-deb |
| 175 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR} |
| 176 | COMMAND build-packages/local-deb.sh |
| 177 | ) |
| 178 | configure_file(${PROJECT_SOURCE_DIR}/packages/local-deb.sh.in ${PROJECT_BINARY_DIR}/build-packages/local-deb.sh @ONLY) |
PavolVican | cf74925 | 2017-06-08 09:31:49 +0200 | [diff] [blame] | 179 | endif() |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 180 | |
PavolVican | cf74925 | 2017-06-08 09:31:49 +0200 | [diff] [blame] | 181 | if (NOT RPM_BUILDER) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 182 | message(WARNING "Missing tools (rpm package) for building rpm package. \nYou won't be able to generate rpm package from source code.\nCompiling libyang should still works fine.") |
PavolVican | cf74925 | 2017-06-08 09:31:49 +0200 | [diff] [blame] | 183 | else () |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 184 | # target for local build rpm package |
| 185 | string(REPLACE ${PROJECT_SOURCE_DIR} "." EXCLUDE_BUILD_DIR ${PROJECT_BINARY_DIR}) |
| 186 | add_custom_target(build-rpm |
| 187 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR} |
| 188 | COMMAND build-packages/local-rpm.sh |
| 189 | ) |
| 190 | configure_file(${PROJECT_SOURCE_DIR}/packages/local-rpm.sh.in ${PROJECT_BINARY_DIR}/build-packages/local-rpm.sh @ONLY) |
PavolVican | cf74925 | 2017-06-08 09:31:49 +0200 | [diff] [blame] | 191 | endif() |
PavolVican | 5d37752 | 2017-06-07 15:08:14 +0200 | [diff] [blame] | 192 | |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 193 | # by default build shared library |
| 194 | # static build requires static libpcre library |
| 195 | option(ENABLE_STATIC "Build static (.a) library" OFF) |
| 196 | |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 197 | # check the supported platform |
| 198 | if(NOT UNIX) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 199 | message(FATAL_ERROR "Only *nix like systems are supported.") |
Radek Krejci | 61cd556 | 2015-10-05 14:06:34 +0200 | [diff] [blame] | 200 | endif() |
Mislav Novakovic | 021b9a1 | 2015-10-01 20:50:21 +0200 | [diff] [blame] | 201 | |
Radek Krejci | 5a06554 | 2015-05-22 15:02:07 +0200 | [diff] [blame] | 202 | set(libsrc |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 203 | src/common.c |
| 204 | src/context.c |
| 205 | src/log.c |
Michal Vasko | 6c81070 | 2018-03-14 16:23:21 +0100 | [diff] [blame] | 206 | src/hash_table.c |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 207 | src/resolve.c |
| 208 | src/validation.c |
| 209 | src/xml.c |
| 210 | src/parser.c |
| 211 | src/parser_yin.c |
| 212 | src/parser_xml.c |
| 213 | src/parser_json.c |
Michal Vasko | 1e82a3b | 2018-07-03 12:16:58 +0200 | [diff] [blame] | 214 | src/parser_lyb.c |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 215 | src/parser_yang_bis.c |
| 216 | src/parser_yang_lex.c |
| 217 | src/parser_yang.c |
| 218 | src/tree_schema.c |
| 219 | src/tree_data.c |
Michal Vasko | c6cd3f0 | 2018-03-02 14:07:42 +0100 | [diff] [blame] | 220 | src/plugins.c |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 221 | src/printer.c |
| 222 | src/xpath.c |
| 223 | src/printer_yang.c |
| 224 | src/printer_yin.c |
Radek Krejci | 0e67ac4 | 2018-07-25 15:46:37 +0200 | [diff] [blame] | 225 | src/printer_json_schema.c |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 226 | src/printer_xml.c |
| 227 | src/printer_tree.c |
| 228 | src/printer_info.c |
| 229 | src/printer_json.c |
Michal Vasko | 1e82a3b | 2018-07-03 12:16:58 +0200 | [diff] [blame] | 230 | src/printer_lyb.c |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 231 | src/yang_types.c) |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 232 | |
Radek Krejci | 5a06554 | 2015-05-22 15:02:07 +0200 | [diff] [blame] | 233 | set(lintsrc |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 234 | tools/lint/main.c |
| 235 | tools/lint/main_ni.c |
| 236 | tools/lint/commands.c |
| 237 | tools/lint/completion.c |
| 238 | tools/lint/configuration.c |
| 239 | linenoise/linenoise.c) |
Radek Krejci | 5a06554 | 2015-05-22 15:02:07 +0200 | [diff] [blame] | 240 | |
Radek Krejci | b4a481c | 2017-07-12 15:12:34 +0200 | [diff] [blame] | 241 | set(resrc |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 242 | tools/re/main.c) |
Radek Krejci | b4a481c | 2017-07-12 15:12:34 +0200 | [diff] [blame] | 243 | |
Michal Vasko | 9a54274 | 2016-06-23 13:04:51 +0200 | [diff] [blame] | 244 | set(yang2yinsrc |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 245 | tools/yang2yin/main.c) |
Michal Vasko | 9a54274 | 2016-06-23 13:04:51 +0200 | [diff] [blame] | 246 | |
Tomas Cejka | 422c007 | 2015-07-21 18:18:25 +0200 | [diff] [blame] | 247 | set(headers |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 248 | src/tree_schema.h |
| 249 | src/tree_data.h |
| 250 | src/extensions.h |
Michal Vasko | c6cd3f0 | 2018-03-02 14:07:42 +0100 | [diff] [blame] | 251 | src/user_types.h |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 252 | src/xml.h |
| 253 | src/dict.h) |
Tomas Cejka | 422c007 | 2015-07-21 18:18:25 +0200 | [diff] [blame] | 254 | |
Michal Vasko | 59b81cd | 2018-10-12 10:19:51 +0200 | [diff] [blame] | 255 | check_symbol_exists(vdprintf "stdio.h;stdarg.h" HAVE_VDPRINTF) |
Renato Westphal | 63836f7 | 2018-06-04 19:37:02 -0300 | [diff] [blame] | 256 | if(HAVE_VDPRINTF) |
| 257 | add_definitions(-DHAVE_VDPRINTF) |
| 258 | endif(HAVE_VDPRINTF) |
| 259 | |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 260 | # create static libyang library |
| 261 | if(ENABLE_STATIC) |
| 262 | add_definitions(-DSTATIC) |
| 263 | set(CMAKE_EXE_LINKER_FLAGS -static) |
| 264 | set(CMAKE_FIND_LIBRARY_SUFFIXES .a) |
| 265 | set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS) # remove -Wl,-Bdynamic |
| 266 | set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS) |
| 267 | add_library(yang STATIC ${libsrc}) |
Radek Krejci | aeccb36 | 2019-09-03 11:09:28 +0200 | [diff] [blame] | 268 | |
| 269 | # switch off the tests |
| 270 | if(ENABLE_BUILD_TESTS) |
| 271 | message(WARNING "Tests are disabled in case of static build") |
| 272 | set(ENABLE_BUILD_TESTS OFF) |
| 273 | set(ENABLE_VALGRIND_TESTS OFF) |
| 274 | endif(ENABLE_BUILD_TESTS) |
| 275 | if(ENABLE_VALGRIND_TESTS) |
| 276 | message(WARNING "Tests are disabled in case of static build") |
| 277 | set(ENABLE_VALGRIND_TESTS OFF) |
| 278 | endif(ENABLE_VALGRIND_TESTS) |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 279 | else() |
| 280 | set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) |
| 281 | add_library(yangobj OBJECT ${libsrc}) |
| 282 | add_library(yang SHARED $<TARGET_OBJECTS:yangobj>) |
Mislav Novakovic | 7073ef5 | 2018-05-24 17:23:02 +0200 | [diff] [blame] | 283 | |
Michal Vasko | e41dfe6 | 2018-11-08 13:28:07 +0100 | [diff] [blame] | 284 | #only for tests with visible internal symbols |
| 285 | add_library(yangobj_tests OBJECT ${libsrc}) |
| 286 | |
Mislav Novakovic | 7073ef5 | 2018-05-24 17:23:02 +0200 | [diff] [blame] | 287 | #link dl |
| 288 | target_link_libraries(yang ${CMAKE_DL_LIBS}) |
Robin Jarry | 05ad85a | 2018-11-19 12:53:00 +0100 | [diff] [blame] | 289 | |
| 290 | set_target_properties(yangobj PROPERTIES COMPILE_FLAGS "-fvisibility=hidden") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 291 | endif(ENABLE_STATIC) |
| 292 | |
Radek Krejci | 23bc6ea | 2019-04-05 10:48:44 +0200 | [diff] [blame] | 293 | set_target_properties(yang PROPERTIES VERSION ${LIBYANG_SOVERSION_FULL} SOVERSION ${LIBYANG_SOVERSION}) |
Michal Vasko | e4e8fbd | 2015-08-24 14:54:49 +0200 | [diff] [blame] | 294 | |
Radek Krejci | 89658b3 | 2016-02-08 11:14:46 +0100 | [diff] [blame] | 295 | # link math |
| 296 | target_link_libraries(yang m) |
| 297 | |
Radek Krejci | 7d9f46a | 2016-01-29 13:53:18 +0100 | [diff] [blame] | 298 | # find pthreads |
| 299 | set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
| 300 | find_package(Threads REQUIRED) |
Radek Krejci | aeccb36 | 2019-09-03 11:09:28 +0200 | [diff] [blame] | 301 | target_link_libraries(yang ${CMAKE_THREAD_LIBS_INIT}) |
Radek Krejci | 7d9f46a | 2016-01-29 13:53:18 +0100 | [diff] [blame] | 302 | |
Michal Vasko | e4e8fbd | 2015-08-24 14:54:49 +0200 | [diff] [blame] | 303 | # find PCRE library |
Mislav Novakovic | 4c31955 | 2018-05-29 16:27:08 +0200 | [diff] [blame] | 304 | unset(PCRE_LIBRARY CACHE) |
Michal Vasko | e4e8fbd | 2015-08-24 14:54:49 +0200 | [diff] [blame] | 305 | find_package(PCRE REQUIRED) |
| 306 | include_directories(${PCRE_INCLUDE_DIRS}) |
Radek Krejci | 1d949ec | 2015-10-02 13:35:05 +0200 | [diff] [blame] | 307 | target_link_libraries(yang ${PCRE_LIBRARIES}) |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 308 | |
Jan Kundrát | bffd9e4 | 2016-11-04 16:33:49 +0100 | [diff] [blame] | 309 | install(TARGETS yang DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
Jan Kundrát | fd7a5c7 | 2017-10-26 17:45:06 +0200 | [diff] [blame] | 310 | install(FILES ${headers} ${PROJECT_BINARY_DIR}/src/libyang.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libyang) |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 311 | |
Michal Vasko | e5cf992 | 2015-11-11 11:06:40 +0100 | [diff] [blame] | 312 | find_package(PkgConfig) |
| 313 | if(PKG_CONFIG_FOUND) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 314 | # generate and install pkg-config file |
| 315 | configure_file("libyang.pc.in" "libyang.pc" @ONLY) |
| 316 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libyang.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") |
| 317 | # check that pkg-config includes the used path |
| 318 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable pc_path pkg-config RESULT_VARIABLE RETURN OUTPUT_VARIABLE PC_PATH ERROR_QUIET) |
| 319 | if(RETURN EQUAL 0) |
David Sedlák | cc8bd24 | 2018-07-03 11:59:31 +0200 | [diff] [blame] | 320 | string(STRIP "${PC_PATH}" PC_PATH) |
| 321 | set(PC_PATH "${PC_PATH}:$ENV{PKG_CONFIG_PATH}") |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 322 | string(REGEX MATCH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig" SUBSTR "${PC_PATH}") |
| 323 | string(LENGTH "${SUBSTR}" SUBSTR_LEN) |
| 324 | if(SUBSTR_LEN EQUAL 0) |
| 325 | message(WARNING "pkg-config will not detect the new package after installation, adjust PKG_CONFIG_PATH using \"export PKG_CONFIG_PATH=\${PKG_CONFIG_PATH}:${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig\".") |
| 326 | endif() |
| 327 | endif() |
Michal Vasko | e5cf992 | 2015-11-11 11:06:40 +0100 | [diff] [blame] | 328 | endif() |
| 329 | |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 330 | # generate doxygen documentation for libyang API |
Radek Krejci | e262609 | 2015-10-08 11:25:44 +0200 | [diff] [blame] | 331 | find_package(Doxygen) |
| 332 | if(DOXYGEN_FOUND) |
Mislav Novakovic | ddb2d48 | 2018-07-23 14:38:37 +0200 | [diff] [blame] | 333 | find_program(DOT_PATH dot PATH_SUFFIXES graphviz2.38/bin graphviz/bin) |
| 334 | if(DOT_PATH) |
| 335 | set(HAVE_DOT "YES") |
| 336 | else() |
| 337 | set(HAVE_DOT "NO") |
| 338 | message(AUTHOR_WARNING "Doxygen: to generate UML diagrams please install graphviz") |
| 339 | endif() |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 340 | add_custom_target(doc |
| 341 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile |
| 342 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
| 343 | configure_file(Doxyfile.in Doxyfile) |
Radek Krejci | e262609 | 2015-10-08 11:25:44 +0200 | [diff] [blame] | 344 | endif() |
Radek Krejci | e74ea8c | 2015-04-09 18:06:20 +0200 | [diff] [blame] | 345 | |
| 346 | # clean cmake cache |
| 347 | add_custom_target(cclean |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 348 | COMMAND make clean |
| 349 | COMMAND find . -iname '*cmake*' -not -name CMakeLists.txt -not -path './CMakeModules*' -exec rm -rf {} + |
| 350 | COMMAND rm -rf Makefile Doxyfile |
| 351 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
Radek Krejci | 2cb3054 | 2015-04-10 08:33:57 +0200 | [diff] [blame] | 352 | |
Radek Krejci | c43058d | 2017-01-04 16:29:58 +0100 | [diff] [blame] | 353 | # YANG extensions plugins |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 354 | set(EXTENSIONS_LIST "nacm" "metadata" "yangdata") |
Mislav Novakovic | 609b748 | 2018-05-23 15:01:58 +0200 | [diff] [blame] | 355 | # if the tests are enabled, build libyang_ext_test |
| 356 | if(ENABLE_BUILD_TESTS) |
| 357 | find_package(CMocka 1.0.0) |
Mislav Novakovic | 675ebb0 | 2018-05-25 17:40:19 +0200 | [diff] [blame] | 358 | if(CMOCKA_FOUND AND CMAKE_BUILD_TYPE MATCHES debug) |
Mislav Novakovic | 609b748 | 2018-05-23 15:01:58 +0200 | [diff] [blame] | 359 | list(APPEND EXTENSIONS_LIST "libyang_ext_test") |
Mislav Novakovic | 675ebb0 | 2018-05-25 17:40:19 +0200 | [diff] [blame] | 360 | endif(CMOCKA_FOUND AND CMAKE_BUILD_TYPE MATCHES debug) |
Mislav Novakovic | 609b748 | 2018-05-23 15:01:58 +0200 | [diff] [blame] | 361 | endif(ENABLE_BUILD_TESTS) |
| 362 | |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 363 | if(ENABLE_STATIC) |
Mislav Novakovic | 3bef44a | 2018-05-23 18:08:52 +0200 | [diff] [blame] | 364 | set(EXTENSIONS_LIST_SIZE " 0 ") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 365 | set(ITEM 0) |
| 366 | foreach(EXTENSION ${EXTENSIONS_LIST}) |
| 367 | add_library(${EXTENSION} STATIC "src/extensions/${EXTENSION}.c") |
| 368 | target_link_libraries(yang ${EXTENSION}) |
Mislav Novakovic | 3bef44a | 2018-05-23 18:08:52 +0200 | [diff] [blame] | 369 | set(EXTENSIONS_LIST_SIZE "${EXTENSIONS_LIST_SIZE} + lyext_size(${EXTENSION})") |
| 370 | set(EXTERN_EXTENSIONS_LIST "${EXTERN_EXTENSIONS_LIST}extern struct lyext_plugin_list ${EXTENSION}[];\n") |
| 371 | set(MEMCPY_EXTENSIONS_LIST "${MEMCPY_EXTENSIONS_LIST} lyext_add(plugin, count, ${EXTENSION});\n") |
Mislav Novakovic | 7472693 | 2018-06-04 13:14:03 +0200 | [diff] [blame] | 372 | set(STATIC_LOADED_PLUGINS "${STATIC_LOADED_PLUGINS} \"${EXTENSION}\",") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 373 | MATH(EXPR ITEM "${ITEM}+1") |
| 374 | endforeach() |
| 375 | else() |
| 376 | add_subdirectory(src/extensions) |
Mislav Novakovic | e5bcc13 | 2018-05-29 16:28:02 +0200 | [diff] [blame] | 377 | endif(ENABLE_STATIC) |
Radek Krejci | c43058d | 2017-01-04 16:29:58 +0100 | [diff] [blame] | 378 | |
Michal Vasko | 717cb69 | 2018-12-19 15:13:25 +0100 | [diff] [blame] | 379 | # YANG user types plugins |
| 380 | set(USER_TYPE_LIST "user_yang_types" "user_inet_types") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 381 | if(ENABLE_STATIC) |
Mislav Novakovic | 3bef44a | 2018-05-23 18:08:52 +0200 | [diff] [blame] | 382 | set(USER_TYPE_LIST_SIZE " 0 ") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 383 | foreach(USER_TYPE ${USER_TYPE_LIST}) |
| 384 | add_library(${USER_TYPE} STATIC "src/user_types/${USER_TYPE}.c") |
| 385 | target_link_libraries(yang ${USER_TYPE}) |
Mislav Novakovic | 3bef44a | 2018-05-23 18:08:52 +0200 | [diff] [blame] | 386 | set(USER_TYPE_LIST_SIZE "${USER_TYPE_LIST_SIZE} + lytype_size(${USER_TYPE})") |
| 387 | set(EXTERN_USER_TYPE_LIST "${EXTERN_USER_TYPE_LIST}extern struct lytype_plugin_list ${USER_TYPE}[];\n") |
| 388 | set(MEMCPY_USER_TYPE_LIST "${MEMCPY_USER_TYPE_LIST} lytype_add(plugin, count, ${USER_TYPE});\n") |
Mislav Novakovic | 7472693 | 2018-06-04 13:14:03 +0200 | [diff] [blame] | 389 | set(STATIC_LOADED_PLUGINS "${STATIC_LOADED_PLUGINS} \"${USER_TYPE}\",") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 390 | MATH(EXPR ITEM "${ITEM}+1") |
| 391 | endforeach() |
Mislav Novakovic | 7472693 | 2018-06-04 13:14:03 +0200 | [diff] [blame] | 392 | set(STATIC_LOADED_PLUGINS_COUNT "${ITEM}") |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 393 | else() |
| 394 | add_subdirectory(src/user_types) |
Mislav Novakovic | e5bcc13 | 2018-05-29 16:28:02 +0200 | [diff] [blame] | 395 | endif(ENABLE_STATIC) |
Mislav Novakovic | 61c7908 | 2018-05-21 13:08:24 +0200 | [diff] [blame] | 396 | |
| 397 | configure_file(${PROJECT_SOURCE_DIR}/src/plugin_config.h.in ${PROJECT_BINARY_DIR}/src/plugin_config.h) |
Michal Vasko | 25b59c7 | 2018-03-21 11:49:23 +0100 | [diff] [blame] | 398 | |
Radek Krejci | c43058d | 2017-01-04 16:29:58 +0100 | [diff] [blame] | 399 | # yanglint |
Radek Krejci | 5a06554 | 2015-05-22 15:02:07 +0200 | [diff] [blame] | 400 | add_executable(yanglint ${lintsrc}) |
Radek Krejci | 40dcad2 | 2017-06-08 11:35:32 +0200 | [diff] [blame] | 401 | target_link_libraries(yanglint yang) |
Jan Kundrát | bffd9e4 | 2016-11-04 16:33:49 +0100 | [diff] [blame] | 402 | install(TARGETS yanglint DESTINATION ${CMAKE_INSTALL_BINDIR}) |
| 403 | install(FILES ${PROJECT_SOURCE_DIR}/tools/lint/yanglint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) |
Radek Krejci | 5a06554 | 2015-05-22 15:02:07 +0200 | [diff] [blame] | 404 | |
Radek Krejci | b4a481c | 2017-07-12 15:12:34 +0200 | [diff] [blame] | 405 | #yangre |
| 406 | add_executable(yangre ${resrc}) |
| 407 | target_link_libraries(yangre yang) |
| 408 | install(TARGETS yangre DESTINATION ${CMAKE_INSTALL_BINDIR}) |
David Lamparter | a7893f7 | 2018-11-09 16:05:44 +0100 | [diff] [blame] | 409 | install(FILES ${PROJECT_SOURCE_DIR}/tools/re/yangre.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) |
Radek Krejci | b4a481c | 2017-07-12 15:12:34 +0200 | [diff] [blame] | 410 | |
Radek Krejci | c43058d | 2017-01-04 16:29:58 +0100 | [diff] [blame] | 411 | # yang2yin |
Michal Vasko | 9a54274 | 2016-06-23 13:04:51 +0200 | [diff] [blame] | 412 | add_executable(yang2yin ${yang2yinsrc}) |
| 413 | |
Michal Vasko | e4edb09 | 2018-11-20 10:51:17 +0100 | [diff] [blame] | 414 | # uninstall |
| 415 | add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_MODULE_PATH}/uninstall.cmake") |
| 416 | |
Mislav Novakovic | 021b9a1 | 2015-10-01 20:50:21 +0200 | [diff] [blame] | 417 | if(ENABLE_VALGRIND_TESTS) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 418 | set(ENABLE_BUILD_TESTS ON) |
Mislav Novakovic | 021b9a1 | 2015-10-01 20:50:21 +0200 | [diff] [blame] | 419 | endif() |
| 420 | |
| 421 | if(ENABLE_BUILD_TESTS) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 422 | if(CMOCKA_FOUND) |
| 423 | enable_testing() |
| 424 | add_subdirectory(tests) |
Radek Krejci | bf123af | 2018-02-21 08:05:21 +0100 | [diff] [blame] | 425 | else(CMOCKA_FOUND) |
| 426 | message(STATUS "Disabling tests because of missing CMocka") |
| 427 | set(ENABLE_BUILD_TESTS NO) |
Michal Vasko | 8f3160e | 2017-09-27 11:25:26 +0200 | [diff] [blame] | 428 | endif(CMOCKA_FOUND) |
Radek Krejci | e02ce0a | 2015-11-04 14:14:20 +0100 | [diff] [blame] | 429 | endif(ENABLE_BUILD_TESTS) |
Mislav Novakovic | a827b5f | 2016-02-29 11:47:22 +0100 | [diff] [blame] | 430 | |
Juraj Vijtiuk | fcd6fd8 | 2019-01-13 09:41:43 -0500 | [diff] [blame] | 431 | if(ENABLE_BUILD_FUZZ_TARGETS) |
| 432 | add_subdirectory(tests/fuzz) |
| 433 | endif(ENABLE_BUILD_FUZZ_TARGETS) |
| 434 | |
Mislav Novakovic | edc6c08 | 2017-05-30 15:21:42 +0200 | [diff] [blame] | 435 | if(GEN_LANGUAGE_BINDINGS AND GEN_CPP_BINDINGS) |
| 436 | add_subdirectory(swig) |
| 437 | endif() |