]> git.stg.codes - stg.git/blob - libs/CMakeLists.txt
Non-virtual admin.
[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_LOGGER )
38     add_library ( logger STATIC logger/logger.cpp )
39     target_include_directories ( logger PUBLIC logger/include )
40 endif ( BUILD_LIB_LOGGER )
41
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 )
47
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 )
52
53 if ( BUILD_LIB_SMUX )
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 endif ( BUILD_LIB_SMUX )
58
59 if ( BUILD_LIB_SRVCONF )
60     find_package ( EXPAT REQUIRED )
61     file ( GLOB PARSERS srvconf/parsers/*.cpp )
62     add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} )
63     target_include_directories ( srvconf PUBLIC srvconf/include )
64     target_link_libraries ( srvconf crypto common EXPAT::EXPAT )
65 endif ( BUILD_LIB_SRVCONF )