From: Maksym Mamontov Date: Sun, 12 Jan 2020 17:22:37 +0000 (+0200) Subject: Restructure libs. X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/06186a8866478b05d56179dc2c5a3c4b3fd3a8f4?ds=inline Restructure libs. --- diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index af3d944f..ece4c9a3 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,49 +1,67 @@ set ( CMAKE_POSITION_INDEPENDENT_CODE ON ) if ( BUILD_LIB_COMMON ) - add_subdirectory (common) + add_library ( common STATIC common/blockio.cpp common/common.cpp common/strptime.cpp ) + target_include_directories ( common PUBLIC common/include ) endif ( BUILD_LIB_COMMON ) if ( BUILD_LIB_CONFFILES ) - add_subdirectory (conffiles) + add_library ( conffiles STATIC conffiles/conffiles.cpp ) + target_include_directories ( conffiles PUBLIC conffiles/include ) endif ( BUILD_LIB_CONFFILES ) if ( BUILD_LIB_CRYPTO ) - add_subdirectory (crypto) + add_library ( crypto STATIC crypto/ag_md5.c crypto/bfstream.cpp crypto/blowfish.c ) + target_include_directories ( crypto PUBLIC crypto/include ) endif ( BUILD_LIB_CRYPTO ) if ( BUILD_LIB_DOTCONFPP ) - add_subdirectory (dotconfpp) + add_library ( dotconfpp STATIC dotconfpp/dotconfpp.cpp dotconfpp/mempool.cpp ) + target_include_directories ( dotconfpp PUBLIC dotconfpp/include ) endif ( BUILD_LIB_DOTCONFPP ) if ( BUILD_LIB_IA ) - add_subdirectory (ia) + add_library ( ia STATIC ia/ia.cpp ) + target_include_directories ( ia PUBLIC ia/include ) + target_link_libraries ( ia crypto common ) endif ( BUILD_LIB_IA ) if ( BUILD_LIB_IBPP ) - add_subdirectory (ibpp) + add_library ( ibpp STATIC ibpp/all_in_one.cpp ) + target_include_directories ( ibpp PUBLIC ibpp/include ) endif ( BUILD_LIB_IBPP ) if ( BUILD_LIB_JSON ) - add_subdirectory (json) + add_library ( json STATIC json/generator.cpp json/parser.cpp ) + target_include_directories ( json PUBLIC json/include ) + target_link_libraries ( json common ) endif ( BUILD_LIB_JSON ) if ( BUILD_LIB_LOGGER ) - add_subdirectory (logger) + add_library ( logger STATIC logger/logger.cpp ) + target_include_directories ( logger PUBLIC logger/include ) endif ( BUILD_LIB_LOGGER ) if ( BUILD_LIB_PINGER ) - add_subdirectory (pinger) + add_library ( pinger STATIC pinger/pinger.cpp ) + target_include_directories ( pinger PUBLIC pinger/include ) + target_link_libraries ( pinger common ) endif ( BUILD_LIB_PINGER ) if ( BUILD_LIB_SCRIPTEXECUTER ) - add_subdirectory (scriptexecuter) + add_library ( scriptexecuter STATIC scriptexecuter/scriptexecuter.c ) + target_include_directories ( scriptexecuter PUBLIC scriptexecuter/include ) endif ( BUILD_LIB_SCRIPTEXECUTER ) if ( BUILD_LIB_SMUX ) - add_subdirectory (smux) + file ( GLOB SMUX_C_FILES smux/*.c ) + add_library ( smux STATIC ${SMUX_C_FILES} ) + target_include_directories ( smux PUBLIC smux/include smux/include/stg ) endif ( BUILD_LIB_SMUX ) if ( BUILD_LIB_SRVCONF ) - add_subdirectory (srvconf) + file ( GLOB PARSERS srvconf/parsers/*.cpp ) + add_library ( srvconf STATIC srvconf/servconf.cpp srvconf/netunit.cpp ${PARSERS} ) + target_include_directories ( srvconf PUBLIC srvconf/include ) + target_link_libraries ( srvconf crypto common ) endif ( BUILD_LIB_SRVCONF ) diff --git a/libs/common/CMakeLists.txt b/libs/common/CMakeLists.txt deleted file mode 100644 index 330ee0d6..00000000 --- a/libs/common/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set ( CPP_FILES blockio.cpp common.cpp strptime.cpp ) - -include_directories ( include ) - -add_library ( common STATIC ${CPP_FILES} ) - -target_include_directories ( common PUBLIC include ) diff --git a/libs/conffiles/CMakeLists.txt b/libs/conffiles/CMakeLists.txt deleted file mode 100644 index 34e18014..00000000 --- a/libs/conffiles/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set ( CPP_FILES conffiles.cpp ) - -add_library ( conffiles STATIC ${CPP_FILES} ) - -target_include_directories ( conffiles PUBLIC include ) diff --git a/libs/crypto/CMakeLists.txt b/libs/crypto/CMakeLists.txt deleted file mode 100644 index 9b40d18b..00000000 --- a/libs/crypto/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -set ( CPP_FILES bfstream.cpp ) -set ( C_FILES ag_md5.c blowfish.c ) - -add_library ( crypto STATIC ${CPP_FILES} ${C_FILES} ) - -target_include_directories ( crypto PUBLIC include ) diff --git a/libs/dotconfpp/CMakeLists.txt b/libs/dotconfpp/CMakeLists.txt deleted file mode 100644 index eec079ed..00000000 --- a/libs/dotconfpp/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set ( CPP_FILES dotconfpp.cpp mempool.cpp ) - -add_library ( dotconfpp STATIC ${CPP_FILES} ) - -target_include_directories ( dotconfpp PUBLIC include ) diff --git a/libs/ia/CMakeLists.txt b/libs/ia/CMakeLists.txt deleted file mode 100644 index 73ab8e46..00000000 --- a/libs/ia/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set ( CPP_FILES ia.cpp ) - -add_library ( ia STATIC ${CPP_FILES} ) - -target_include_directories ( ia PUBLIC include ) - -target_link_libraries ( ia crypto common ) diff --git a/libs/ibpp/CMakeLists.txt b/libs/ibpp/CMakeLists.txt deleted file mode 100644 index 109ba752..00000000 --- a/libs/ibpp/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set ( CPP_FILES all_in_one.cpp ) - -add_library ( ibpp STATIC ${CPP_FILES} ) - -target_include_directories ( ibpp PUBLIC include ) diff --git a/libs/json/CMakeLists.txt b/libs/json/CMakeLists.txt deleted file mode 100644 index c6031550..00000000 --- a/libs/json/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set ( CPP_FILES generator.cpp parser.cpp ) - -add_library ( json STATIC ${CPP_FILES} ) - -target_include_directories ( json PUBLIC include ) - -target_link_libraries ( json common ) diff --git a/libs/logger/CMakeLists.txt b/libs/logger/CMakeLists.txt deleted file mode 100644 index 44b1e0d9..00000000 --- a/libs/logger/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set ( CPP_FILES logger.cpp ) - -add_library ( logger STATIC ${CPP_FILES} ) - -target_include_directories ( logger PUBLIC include ) diff --git a/libs/pinger/CMakeLists.txt b/libs/pinger/CMakeLists.txt deleted file mode 100644 index f70e580a..00000000 --- a/libs/pinger/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set ( CPP_FILES pinger.cpp ) - -add_library ( pinger STATIC ${CPP_FILES} ) - -target_include_directories ( pinger PUBLIC include ) - -target_link_libraries ( pinger common ) diff --git a/libs/scriptexecuter/CMakeLists.txt b/libs/scriptexecuter/CMakeLists.txt deleted file mode 100644 index 88d9b23d..00000000 --- a/libs/scriptexecuter/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -set ( C_FILES scriptexecuter.c ) - -add_library ( scriptexecuter STATIC ${C_FILES} ) - -target_include_directories ( scriptexecuter PUBLIC include ) diff --git a/libs/smux/CMakeLists.txt b/libs/smux/CMakeLists.txt deleted file mode 100644 index 81fe22f4..00000000 --- a/libs/smux/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -file ( GLOB C_FILES *.c ) - -add_library ( smux STATIC ${C_FILES} ) - -target_include_directories ( smux PUBLIC include include/stg ) diff --git a/libs/srvconf/CMakeLists.txt b/libs/srvconf/CMakeLists.txt deleted file mode 100644 index e3cc91bb..00000000 --- a/libs/srvconf/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set ( CPP_FILES netunit.cpp servconf.cpp ) -file ( GLOB PARSERS parsers/*.cpp ) - -add_library ( srvconf STATIC ${CPP_FILES} ${PARSERS} ) - -target_include_directories ( srvconf PUBLIC include ) - -target_link_libraries ( srvconf crypto common )