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 )
37 if ( BUILD_LIB_LOGGER )
38 add_library ( logger STATIC logger/logger.cpp )
39 target_include_directories ( logger PUBLIC logger/include )
40 endif ( BUILD_LIB_LOGGER )
42 if ( BUILD_LIB_PINGER )
43 add_library ( pinger STATIC pinger/pinger.cpp )
44 target_include_directories ( pinger PUBLIC pinger/include )
45 target_link_libraries ( pinger common )
46 endif ( BUILD_LIB_PINGER )
48 if ( BUILD_LIB_SCRIPTEXECUTER )
49 add_library ( scriptexecuter STATIC scriptexecuter/scriptexecuter.c )
50 target_include_directories ( scriptexecuter PUBLIC scriptexecuter/include )
51 endif ( BUILD_LIB_SCRIPTEXECUTER )
54 file ( GLOB SMUX_C_FILES smux/*.c )
55 add_library ( smux STATIC ${SMUX_C_FILES} )
56 target_include_directories ( smux PUBLIC smux/include smux/include/stg )
57 target_compile_options ( smux PRIVATE -Wno-cpp )
58 endif ( BUILD_LIB_SMUX )
60 if ( BUILD_LIB_SRVCONF )
61 find_package ( EXPAT REQUIRED )
62 file ( GLOB PARSERS srvconf/parsers/*.cpp )
63 add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} )
64 target_include_directories ( srvconf PUBLIC srvconf/include )
65 target_link_libraries ( srvconf crypto common EXPAT::EXPAT )
66 endif ( BUILD_LIB_SRVCONF )