Restructure libs.
authorMaksym Mamontov <madf@madf.info>
Sun, 12 Jan 2020 17:22:37 +0000 (19:22 +0200)
committerMaksym Mamontov <madf@madf.info>
Sun, 12 Jan 2020 17:22:37 +0000 (19:22 +0200)
13 files changed:
libs/CMakeLists.txt
libs/common/CMakeLists.txt [deleted file]
libs/conffiles/CMakeLists.txt [deleted file]
libs/crypto/CMakeLists.txt [deleted file]
libs/dotconfpp/CMakeLists.txt [deleted file]
libs/ia/CMakeLists.txt [deleted file]
libs/ibpp/CMakeLists.txt [deleted file]
libs/json/CMakeLists.txt [deleted file]
libs/logger/CMakeLists.txt [deleted file]
libs/pinger/CMakeLists.txt [deleted file]
libs/scriptexecuter/CMakeLists.txt [deleted file]
libs/smux/CMakeLists.txt [deleted file]
libs/srvconf/CMakeLists.txt [deleted file]

index af3d944..ece4c9a 100644 (file)
@@ -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 (file)
index 330ee0d..0000000
+++ /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 (file)
index 34e1801..0000000
+++ /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 (file)
index 9b40d18..0000000
+++ /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 (file)
index eec079e..0000000
+++ /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 (file)
index 73ab8e4..0000000
+++ /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 (file)
index 109ba75..0000000
+++ /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 (file)
index c603155..0000000
+++ /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 (file)
index 44b1e0d..0000000
+++ /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 (file)
index f70e580..0000000
+++ /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 (file)
index 88d9b23..0000000
+++ /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 (file)
index 81fe22f..0000000
+++ /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 (file)
index e3cc91b..0000000
+++ /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 )