1- cmake_minimum_required (VERSION 3.20 )
2- project (ltfs,
3- # TODO: Find a better solution to mark this version as different from the official build
4- VERSION "2.5.0.9999"
5- )
1+ cmake_minimum_required (VERSION 3.26 )
2+ project (ltfs
3+ LANGUAGES C)
4+ list ( APPEND CMAKE_MODULE_PATH " ${CMAKE_CURRENT_SOURCE_DIR} /.cmake" )
5+
66include (CheckSymbolExists REQUIRED)
77include (CheckTypeSize REQUIRED)
88include (CheckLibraryExists REQUIRED)
99include (CheckIncludeFiles REQUIRED)
1010include (GNUInstallDirs REQUIRED)
1111
12+ find_package (SNMP REQUIRED)
1213find_package (PkgConfig REQUIRED)
1314find_package (Threads REQUIRED)
1415find_package (ICU COMPONENTS uc)
1516find_package (LibXml2 REQUIRED)
1617
18+ check_type_size(time_t SIZEOF_TIME_T)
1719add_compile_definitions (_GNU_SOURCE __CMAKE_BUILD)
1820
1921pkg_check_modules(FUSE REQUIRED "fuse>=2.6.0" IMPORTED_TARGET)
@@ -29,29 +31,3 @@ endif()
2931
3032add_subdirectory (messages)
3133add_subdirectory (src)
32-
33- # TODO: Improve the use of SNMP, right now this flags are not added to the build.
34- # TODO: Test the use of SNMP
35- option (ENABLE_SNMP "Force to use ICU6x (unorm2) functions" OFF )
36- if (ENABLE_SNMP)
37- pkg_check_modules(SNMP REQUIRED "net-snmp>=5.3" IMPORTED_TARGET)
38- find_program (NETSNMP_CONFIG_BIN net-snmp-config REQUIRED)
39- if (NETSNMP_CONFIG_BIN)
40- exec_program (${NETSNMP_CONFIG_BIN} ARGS --cflags OUTPUT_VARIABLE _NETSNMP_CFLAGS)
41- exec_program (${NETSNMP_CONFIG_BIN} ARGS --libs OUTPUT_VARIABLE _NETSNMP_LIBS)
42-
43- string (REGEX REPLACE "[\"\r\n ]" " " _NETSNMP_CFLAGS "${_NETSNMP_CFLAGS} " )
44- string (REGEX REPLACE "[\"\r\n ]" " " _NETSNMP_LIBS "${_NETSNMP_LIBS} " )
45- set (NETSNMP_CFLAGS ${_NETSNMP_CFLAGS} CACHE STRING "CFLAGS for net-snmp lib" )
46- set (NETSNMP_LIBS ${_NETSNMP_LIBS} CACHE STRING "linker options for net-snmp lib" )
47- set (NETSNMP_FOUND TRUE CACHE BOOL "net-snmp is found" )
48- else ()
49- set (NETSNMP_FOUND FALSE CACHE BOOL "net-snmp is not found" )
50- endif ()
51- endif ()
52-
53-
54- check_type_size(time_t SIZEOF_TIME_T)
55- add_compile_definitions (
56- SIZEOF_TIME_T=${SIZEOF_TIME_T}
57- )
0 commit comments