]> git.stg.codes - stg.git/blob - libs/CMakeLists.txt
17b90799d1228b11bcf54cf321c8545963ea4b4d
[stg.git] / libs / CMakeLists.txt
1 set ( CMAKE_POSITION_INDEPENDENT_CODE ON )
2
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 )
9
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 )
14
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 )
19
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 )
24
25 if ( BUILD_LIB_IA )
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 )
30
31 if ( BUILD_LIB_IBPP )
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 )
36
37 if ( BUILD_LIB_JSON )
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 )
43
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 )
48
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 )
54
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 )
59
60 if ( BUILD_LIB_SMUX )
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 )
65
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 )