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 )
10 set_target_properties ( common PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
12 if ( INCLUDE_WHAT_YOU_USE_EXE )
13 set_target_properties ( common PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
15 endif ( BUILD_LIB_COMMON )
17 if ( BUILD_LIB_CONFFILES )
18 add_library ( conffiles STATIC conffiles/conffiles.cpp )
19 target_include_directories ( conffiles PUBLIC conffiles/include )
22 set_target_properties ( conffiles PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
24 if ( INCLUDE_WHAT_YOU_USE_EXE )
25 set_target_properties ( conffiles PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
27 endif ( BUILD_LIB_CONFFILES )
29 if ( BUILD_LIB_CRYPTO )
30 add_library ( crypto STATIC crypto/ag_md5.c crypto/bfstream.cpp crypto/blowfish.c )
31 target_include_directories ( crypto PUBLIC crypto/include )
34 set_target_properties ( crypto PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
36 if ( INCLUDE_WHAT_YOU_USE_EXE )
37 set_target_properties ( crypto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
39 endif ( BUILD_LIB_CRYPTO )
41 if ( BUILD_LIB_DOTCONFPP )
42 add_library ( dotconfpp STATIC dotconfpp/dotconfpp.cpp dotconfpp/mempool.cpp )
43 target_include_directories ( dotconfpp PUBLIC dotconfpp/include )
46 set_target_properties ( dotconfpp PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
48 if ( INCLUDE_WHAT_YOU_USE_EXE )
49 set_target_properties ( dotconfpp PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
51 endif ( BUILD_LIB_DOTCONFPP )
54 add_library ( ia STATIC ia/ia.cpp )
55 target_include_directories ( ia PUBLIC ia/include )
56 target_link_libraries ( ia crypto common )
59 set_target_properties ( ia PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
61 if ( INCLUDE_WHAT_YOU_USE_EXE )
62 set_target_properties ( ia PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
64 endif ( BUILD_LIB_IA )
67 add_library ( ibpp STATIC ibpp/all_in_one.cpp )
68 target_include_directories ( ibpp PUBLIC ibpp/include )
69 target_compile_options ( ibpp PRIVATE -Wno-old-style-cast $<$<CXX_COMPILER_ID:GNU>:-Wno-useless-cast> )
72 set_target_properties ( ibpp PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
74 if ( INCLUDE_WHAT_YOU_USE_EXE )
75 set_target_properties ( ibpp PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
77 endif ( BUILD_LIB_IBPP )
79 if ( BUILD_LIB_LOGGER )
80 add_library ( logger STATIC logger/logger.cpp )
81 target_include_directories ( logger PUBLIC logger/include )
84 set_target_properties ( logger PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
86 if ( INCLUDE_WHAT_YOU_USE_EXE )
87 set_target_properties ( logger PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
89 endif ( BUILD_LIB_LOGGER )
91 if ( BUILD_LIB_PINGER )
92 add_library ( pinger STATIC pinger/pinger.cpp )
93 target_include_directories ( pinger PUBLIC pinger/include )
94 target_link_libraries ( pinger common )
97 set_target_properties ( pinger PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
99 if ( INCLUDE_WHAT_YOU_USE_EXE )
100 set_target_properties ( pinger PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
102 endif ( BUILD_LIB_PINGER )
104 if ( BUILD_LIB_SCRIPTEXECUTER )
105 add_library ( scriptexecuter STATIC scriptexecuter/scriptexecuter.c )
106 target_include_directories ( scriptexecuter PUBLIC scriptexecuter/include )
108 if ( CLANG_TIDY_EXE )
109 set_target_properties ( scriptexecuter PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
111 if ( INCLUDE_WHAT_YOU_USE_EXE )
112 set_target_properties ( scriptexecuter PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
114 endif ( BUILD_LIB_SCRIPTEXECUTER )
116 if ( BUILD_LIB_SMUX )
117 file ( GLOB SMUX_C_FILES smux/*.c )
118 add_library ( smux STATIC ${SMUX_C_FILES} )
119 target_include_directories ( smux PUBLIC smux/include smux/include/stg )
120 target_compile_options ( smux PRIVATE -Wno-cpp )
122 if ( CLANG_TIDY_EXE )
123 set_target_properties ( smux PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
125 if ( INCLUDE_WHAT_YOU_USE_EXE )
126 set_target_properties ( smux PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
128 endif ( BUILD_LIB_SMUX )
130 if ( BUILD_LIB_SRVCONF )
131 find_package ( EXPAT REQUIRED )
132 file ( GLOB PARSERS srvconf/parsers/*.cpp )
133 add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} )
134 target_include_directories ( srvconf PUBLIC srvconf/include )
135 target_link_libraries ( srvconf crypto common EXPAT::EXPAT )
137 if ( CLANG_TIDY_EXE )
138 set_target_properties ( srvconf PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
140 if ( INCLUDE_WHAT_YOU_USE_EXE )
141 set_target_properties ( srvconf PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "${DO_INCLUDE_WHAT_YOU_USE}" )
143 endif ( BUILD_LIB_SRVCONF )