Skip to content

Cmake build system implementation #525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .cmake/FindSNMP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# TODO: Improve the use of SNMP, right now this flags are not added to the build.
# TODO: Test the use of SNMP
option(ENABLE_SNMP "Force to use ICU6x (unorm2) functions" OFF)
if(ENABLE_SNMP)
pkg_check_modules(SNMP REQUIRED "net-snmp>=5.3" IMPORTED_TARGET)
find_program(NETSNMP_CONFIG_BIN net-snmp-config REQUIRED)
if(NETSNMP_CONFIG_BIN)
exec_program(${NETSNMP_CONFIG_BIN} ARGS --cflags OUTPUT_VARIABLE _NETSNMP_CFLAGS)
exec_program(${NETSNMP_CONFIG_BIN} ARGS --libs OUTPUT_VARIABLE _NETSNMP_LIBS)

string(REGEX REPLACE "[\"\r\n]" " " _NETSNMP_CFLAGS "${_NETSNMP_CFLAGS}")
string(REGEX REPLACE "[\"\r\n]" " " _NETSNMP_LIBS "${_NETSNMP_LIBS}")
set(NETSNMP_CFLAGS ${_NETSNMP_CFLAGS} CACHE STRING "CFLAGS for net-snmp lib")
set(NETSNMP_LIBS ${_NETSNMP_LIBS} CACHE STRING "linker options for net-snmp lib")
set(NETSNMP_FOUND TRUE CACHE BOOL "net-snmp is found")
else()
set (NETSNMP_FOUND FALSE CACHE BOOL "net-snmp is not found")
endif()
endif()
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Files generated by cmake
__cmake_systeminformation
.cache

# Files generated by ./autogen.sh
Makefile.in
aclocal.m4
Expand Down
Loading
Loading