1 set ( CMAKE_POSITION_INDEPENDENT_CODE ON )
3 if ( BUILD_LIB_COMMON )
4 find_package ( Iconv REQUIRED )
5 add_library ( common STATIC common/blockio.cpp common/common.cpp common/strptime.cpp )
6 target_include_directories ( common PUBLIC common/include )
7 target_link_libraries ( common Iconv::Iconv )
8 endif ( BUILD_LIB_COMMON )
10 if ( BUILD_LIB_CONFFILES )
11 add_library ( conffiles STATIC conffiles/conffiles.cpp )
12 target_include_directories ( conffiles PUBLIC conffiles/include )
13 endif ( BUILD_LIB_CONFFILES )
15 if ( BUILD_LIB_CRYPTO )
16 add_library ( crypto STATIC crypto/ag_md5.c crypto/bfstream.cpp crypto/blowfish.c )
17 target_include_directories ( crypto PUBLIC crypto/include )
18 endif ( BUILD_LIB_CRYPTO )
20 if ( BUILD_LIB_DOTCONFPP )
21 add_library ( dotconfpp STATIC dotconfpp/dotconfpp.cpp dotconfpp/mempool.cpp )
22 target_include_directories ( dotconfpp PUBLIC dotconfpp/include )
23 endif ( BUILD_LIB_DOTCONFPP )
26 add_library ( ia STATIC ia/ia.cpp )
27 target_include_directories ( ia PUBLIC ia/include )
28 target_link_libraries ( ia crypto common )
29 endif ( BUILD_LIB_IA )
32 add_library ( ibpp STATIC ibpp/all_in_one.cpp )
33 target_include_directories ( ibpp PUBLIC ibpp/include )
34 target_compile_options ( ibpp PRIVATE -Wno-old-style-cast $<$<CXX_COMPILER_ID:GNU>:-Wno-useless-cast> )
35 endif ( BUILD_LIB_IBPP )
38 find_package ( YAJL REQUIRED )
39 add_library ( json STATIC json/generator.cpp json/parser.cpp )
40 target_include_directories ( json PUBLIC json/include )
41 target_link_libraries ( json common YAJL::YAJL )
42 endif ( BUILD_LIB_JSON )
44 if ( BUILD_LIB_LOGGER )
45 add_library ( logger STATIC logger/logger.cpp )
46 target_include_directories ( logger PUBLIC logger/include )
47 endif ( BUILD_LIB_LOGGER )
49 if ( BUILD_LIB_PINGER )
50 add_library ( pinger STATIC pinger/pinger.cpp )
51 target_include_directories ( pinger PUBLIC pinger/include )
52 target_link_libraries ( pinger common )
53 endif ( BUILD_LIB_PINGER )
55 if ( BUILD_LIB_SCRIPTEXECUTER )
56 add_library ( scriptexecuter STATIC scriptexecuter/scriptexecuter.c )
57 target_include_directories ( scriptexecuter PUBLIC scriptexecuter/include )
58 endif ( BUILD_LIB_SCRIPTEXECUTER )
61 file ( GLOB SMUX_C_FILES smux/*.c )
62 add_library ( smux STATIC ${SMUX_C_FILES} )
63 target_include_directories ( smux PUBLIC smux/include smux/include/stg )
64 endif ( BUILD_LIB_SMUX )
66 if ( BUILD_LIB_SRVCONF )
67 file ( GLOB PARSERS srvconf/parsers/*.cpp )
68 add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} )
69 target_include_directories ( srvconf PUBLIC srvconf/include )
70 target_link_libraries ( srvconf crypto common )
71 endif ( BUILD_LIB_SRVCONF )