@@ -4,6 +4,9 @@ include(GNUInstallDirs)
44include (CheckFunctionExists )
55include (CheckCSourceCompiles )
66include (CheckIncludeFile )
7+ if (POLICY CMP0075)
8+ cmake_policy (SET CMP0075 NEW )
9+ endif ()
710
811# include custom Modules
912set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR} /CMakeModules/" )
@@ -31,12 +34,23 @@ set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
3134set (CMAKE_C_FLAGS_PACKAGE "-g -O2 -DNDEBUG" )
3235set (CMAKE_C_FLAGS_DEBUG "-g -O0" )
3336
34- # set version
35- set (LIBNETCONF2_MAJOR_VERSION 0)
36- set (LIBNETCONF2_MINOR_VERSION 12)
37- set (LIBNETCONF2_MICRO_VERSION 64)
37+ # Version of the project
38+ # Generic version of not only the library. Major version is reserved for really big changes of the project,
39+ # minor version changes with added functionality (new tool, functionality of the tool or library, ...) and
40+ # micro version is changed with a set of small changes or bugfixes anywhere in the project.
41+ set (LIBNETCONF2_MAJOR_VERSION 1)
42+ set (LIBNETCONF2_MINOR_VERSION 1)
43+ set (LIBNETCONF2_MICRO_VERSION 3)
3844set (LIBNETCONF2_VERSION ${LIBNETCONF2_MAJOR_VERSION} .${LIBNETCONF2_MINOR_VERSION} .${LIBNETCONF2_MICRO_VERSION} )
39- set (LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_VERSION} .${LIBNETCONF2_MINOR_VERSION} )
45+
46+ # Version of the library
47+ # Major version is changed with every backward non-compatible API/ABI change in libyang, minor version changes
48+ # with backward compatible change and micro version is connected with any internal change of the library.
49+ set (LIBNETCONF2_MAJOR_SOVERSION 1)
50+ set (LIBNETCONF2_MINOR_SOVERSION 1)
51+ set (LIBNETCONF2_MICRO_SOVERSION 3)
52+ set (LIBNETCONF2_SOVERSION_FULL ${LIBNETCONF2_MAJOR_SOVERSION} .${LIBNETCONF2_MINOR_SOVERSION} .${LIBNETCONF2_MICRO_SOVERSION} )
53+ set (LIBNETCONF2_SOVERSION ${LIBNETCONF2_MAJOR_SOVERSION} )
4054
4155# build options
4256option (ENABLE_SSH "Enable NETCONF over SSH support (via libssh)" ON )
@@ -113,7 +127,7 @@ else ()
113127endif ()
114128
115129if (NOT RPM_BUILDER)
116- message (WARNING "Missing tools (rpm package) for building rpm package. \n You won't be able to generate rpm package from source code.\n Compiling libnetconf2 should still works fine." )
130+ message (WARNING "Missing tools (rpm package) for building rpm package. \n You won't be able to generate rpm package from source code.\n Compiling libnetconf2 should still work fine." )
117131else ()
118132 # target for local build rpm package
119133 string (REPLACE ${PROJECT_SOURCE_DIR} "." EXCLUDE_BUILD_DIR ${PROJECT_BINARY_DIR} )
@@ -164,7 +178,7 @@ set(headers
164178
165179# libnetconf2 target
166180add_library (netconf2 SHARED ${libsrc} )
167- set_target_properties (netconf2 PROPERTIES VERSION ${LIBNETCONF2_VERSION} SOVERSION ${LIBNETCONF2_SOVERSION } )
181+ set_target_properties (netconf2 PROPERTIES VERSION ${LIBNETCONF2_VERSION} SOVERSION ${LIBNETCONF2_SOVERSION_FULL } )
168182
169183if ((CMAKE_BUILD_TYPE STREQUAL debug) OR (CMAKE_BUILD_TYPE STREQUAL Package))
170184 option (ENABLE_BUILD_TESTS "Build tests" ON )
@@ -207,16 +221,9 @@ if(ENABLE_SSH)
207221 endif ()
208222 include_directories (${LIBSSH_INCLUDE_DIRS} )
209223
210- set (LIBSSH_SESSION_OPTION_CHECK_CODE
211- "#include <libssh/libssh.h>
212- int main(void) {
213- ssh_session sess;
214- ssh_options_set(sess, SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES, NULL);
215- return 0;
216- }"
217- )
218-
219- check_c_source_compiles ("${LIBSSH_SESSION_OPTION_CHECK_CODE} " HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES )
224+ if (LibSSH_VERSION VERSION_GREATER 0.8.2)
225+ set (HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES 1)
226+ endif ()
220227endif ()
221228
222229# dependencies - libval
0 commit comments