소스 검색

Fixed cmakes

qiuyang 2 달 전
부모
커밋
bdb0e81c3b

+ 1 - 1
CMakeLists.txt

@@ -14,7 +14,7 @@ add_compile_options(-DRELEASE)
 option(build_modules "build modules" ON)
 option(build_modules "build modules" ON)
 option(build_source "build source programs" ON)
 option(build_source "build source programs" ON)
 option(build_plugins "build plugins programs" ON)
 option(build_plugins "build plugins programs" ON)
-option(build_test "build test programs" OFF)
+option(build_test "build test programs" ON)
 
 
 add_subdirectory(framework)
 add_subdirectory(framework)
 if(build_modules)
 if(build_modules)

+ 10 - 0
cmake/clean.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+rm CMakeCache.txt 
+rm -rf CMakeFiles/
+rm cmake_install.cmake 
+rm -rf framework/
+rm Makefile 
+rm -rf modules/
+rm -rf plugins/
+rm -rf source/
+rm -rf test/

BIN
lib/libgsd_core.so


BIN
lib/libgsd_modules.so


BIN
lib/libgsd_plugins.so


+ 1 - 1
modules/CMakeLists.txt

@@ -86,7 +86,7 @@ if(build_HttpServer)
 endif()
 endif()
 if(build_Hepu)
 if(build_Hepu)
   list(APPEND module_list Hepu)
   list(APPEND module_list Hepu)
-  include_directories($(PROJECT_SOURCE_DIR)/modules/Hepu/src)
+  include_directories(${PROJECT_SOURCE_DIR}/modules/Hepu/src)
   install(DIRECTORY Hepu/include/ DESTINATION include)
   install(DIRECTORY Hepu/include/ DESTINATION include)
 endif()
 endif()
 if(build_Audit)
 if(build_Audit)

+ 3 - 1
modules/Hepu/include/Hepu.hpp

@@ -5,13 +5,14 @@
 #include <time.h>
 #include <time.h>
 #include <ctime>
 #include <ctime>
 
 
+#include "Util/util.h"
 #include "Util/logger.h"
 #include "Util/logger.h"
 #include "Util/NoticeCenter.h"
 #include "Util/NoticeCenter.h"
 #include "Poller/EventPoller.h"
 #include "Poller/EventPoller.h"
 #include "Util/SqlPool.h"
 #include "Util/SqlPool.h"
 #include "Network/TcpClient.h"
 #include "Network/TcpClient.h"
 #include "Poller/Timer.h"
 #include "Poller/Timer.h"
-#include "TCPClient.hpp"
+//#include "TCPClient.hpp"
 #include <httplib.h>
 #include <httplib.h>
 #include "Notices.h"
 #include "Notices.h"
 
 
@@ -25,6 +26,7 @@
 #include "HepuTargetRe.h"
 #include "HepuTargetRe.h"
 
 
 using namespace std;
 using namespace std;
+using namespace toolkit;
 
 
 namespace gsd{
 namespace gsd{
 
 

+ 2 - 3
plugins/CMakeLists.txt

@@ -21,9 +21,8 @@ option(build_HttpPlugin "build module HttpPlugin" ON)
 option(build_MonitorPlugin "build module MonitorPlugin" ON)
 option(build_MonitorPlugin "build module MonitorPlugin" ON)
 option(build_TcpPlugin "build module TcpPlugin" ON)
 option(build_TcpPlugin "build module TcpPlugin" ON)
 option(build_AuditPlugin "build module AuditPlugin" ON)
 option(build_AuditPlugin "build module AuditPlugin" ON)
-option(build_kafka           "build module kafka" ON)
 option(build_HepuPlugin "build module HepuPlugin" ON)
 option(build_HepuPlugin "build module HepuPlugin" ON)
-
+option(build_kafka "build module kafka" ON)
 
 
 
 
 # ---[ 3rdparty
 # ---[ 3rdparty
@@ -120,4 +119,4 @@ endforeach()
 set(LIBRARY_OUTPUT_PATH ${GSD_ROOT_DIR}/lib)
 set(LIBRARY_OUTPUT_PATH ${GSD_ROOT_DIR}/lib)
 
 
 add_library(gsd_plugins SHARED ${srcs})
 add_library(gsd_plugins SHARED ${srcs})
-target_link_libraries(gsd_plugins ${3RDPARTY_LIBS} rt dl uuid pthread)
+target_link_libraries(gsd_plugins gsd_modules ${3RDPARTY_LIBS} rt dl uuid pthread)

+ 1 - 1
plugins/HepuPlugin/include/HepuPlugin.hpp

@@ -7,7 +7,7 @@
 #include "Util/logger.h"
 #include "Util/logger.h"
 #include "Util/TimeTicker.h"
 #include "Util/TimeTicker.h"
 #include "Util/NoticeCenter.h"
 #include "Util/NoticeCenter.h"
-#include "HttpClient.hpp"
+//#include "HttpClient.hpp"
 #include "requests.hpp"
 #include "requests.hpp"
 #include "Hepu.hpp"
 #include "Hepu.hpp"
 #include "PluginSubscriber.hpp"
 #include "PluginSubscriber.hpp"

+ 2 - 2
source/CMakeLists.txt

@@ -73,7 +73,7 @@ include_directories(${CNSTREAM_ROOT_DIR}/modules/TCPClient/include)
 include_directories(${CNSTREAM_ROOT_DIR}/modules/config/include)
 include_directories(${CNSTREAM_ROOT_DIR}/modules/config/include)
 #include_directories(${CNSTREAM_ROOT_DIR}/modules/Hepu/include)
 #include_directories(${CNSTREAM_ROOT_DIR}/modules/Hepu/include)
 include_directories(${CNSTREAM_ROOT_DIR}/source/UserApp/include)
 include_directories(${CNSTREAM_ROOT_DIR}/source/UserApp/include)
-include_directories(${CNSTREAM_ROOT_DIR}/source/TestApp/include)
+#include_directories(${CNSTREAM_ROOT_DIR}/source/TestApp/include)
 include_directories(${CNSTREAM_ROOT_DIR}/framework/core/include)
 include_directories(${CNSTREAM_ROOT_DIR}/framework/core/include)
 include_directories(${CNSTREAM_ROOT_DIR}/framework/request/include)
 include_directories(${CNSTREAM_ROOT_DIR}/framework/request/include)
 
 
@@ -87,7 +87,7 @@ include_directories(${CNSTREAM_ROOT_DIR}/plugins/AuditPlugin/include)
 aux_source_directory(${CNSTREAM_ROOT_DIR}/source/src srcs)
 aux_source_directory(${CNSTREAM_ROOT_DIR}/source/src srcs)
 #aux_source_directory(${CNSTREAM_ROOT_DIR}/source/test tests)
 #aux_source_directory(${CNSTREAM_ROOT_DIR}/source/test tests)
 aux_source_directory(${CNSTREAM_ROOT_DIR}/source/UserApp/src userApps)
 aux_source_directory(${CNSTREAM_ROOT_DIR}/source/UserApp/src userApps)
-aux_source_directory(${CNSTREAM_ROOT_DIR}/source/TestApp/src testApps)
+#aux_source_directory(${CNSTREAM_ROOT_DIR}/source/TestApp/src testApps)
 
 
 # ---[ add targets
 # ---[ add targets
 # set(EXECUTABLE_OUTPUT_PATH ${SOURCE_ROOT_DIR}/bin)
 # set(EXECUTABLE_OUTPUT_PATH ${SOURCE_ROOT_DIR}/bin)

+ 7 - 7
test/CMakeLists.txt

@@ -13,8 +13,8 @@ endif()
 
 
 set(CNSTREAM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../)
 set(CNSTREAM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../)
 set(TEST_ROOT_DIR ${CNSTREAM_ROOT_DIR}/test)
 set(TEST_ROOT_DIR ${CNSTREAM_ROOT_DIR}/test)
-message(STATUS "SOURCE: CNSTREAM_ROOT_DIR = ${CNSTREAM_ROOT_DIR}")
-message(STATUS "SOURCE: TEST_ROOT_DIR = ${TEST_ROOT_DIR}")
+message(STATUS "TEST: CNSTREAM_ROOT_DIR = ${CNSTREAM_ROOT_DIR}")
+message(STATUS "TEST: TEST_ROOT_DIR = ${TEST_ROOT_DIR}")
 # # compile flags
 # # compile flags
 # set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2")
 # set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2")
 # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g")
 # set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -g")
@@ -31,8 +31,8 @@ if(build_kafka)
   include_directories(${RDKAFKA_INCLUDE_DIR})
   include_directories(${RDKAFKA_INCLUDE_DIR})
   list(APPEND 3RDPARTY_LIBS ${RDKAFKA_LIBRARIES}) 
   list(APPEND 3RDPARTY_LIBS ${RDKAFKA_LIBRARIES}) 
   #link_directories(${RDKAFKA_LINK_DIR})
   #link_directories(${RDKAFKA_LINK_DIR})
-  message(STATUS "Test: RDKafka include: ${RDKAFKA_INCLUDE_DIR}")
-  message(STATUS "Test: RDKafka libraries: ${RDKAFKA_LIBRARIES}")
+  message(STATUS "TEST: RDKafka include: ${RDKAFKA_INCLUDE_DIR}")
+  message(STATUS "TEST: RDKafka libraries: ${RDKAFKA_LIBRARIES}")
 endif()
 endif()
 
 
 set(ENABLE_MYSQL ON CACHE BOOL "enable mysql")
 set(ENABLE_MYSQL ON CACHE BOOL "enable mysql")
@@ -54,8 +54,8 @@ find_package(ZLToolKit REQUIRED)
 #link_directories(${ZLTOOLKIT_LINK_DIR})
 #link_directories(${ZLTOOLKIT_LINK_DIR})
 include_directories(${ZLTOOLKIT_INCLUDE_DIR})
 include_directories(${ZLTOOLKIT_INCLUDE_DIR})
 list(APPEND 3RDPARTY_LIBS ${ZLTOOLKIT_LIBRARIES})
 list(APPEND 3RDPARTY_LIBS ${ZLTOOLKIT_LIBRARIES})
-message(STATUS "Test: ZLToolKit include: ${ZLTOOLKIT_INCLUDE_DIR}")
-message(STATUS "Test: ZLToolKit libraries: ${ZLTOOLKIT_LIBRARIES}")
+message(STATUS "TEST: ZLToolKit include: ${ZLTOOLKIT_INCLUDE_DIR}")
+message(STATUS "TEST: ZLToolKit libraries: ${ZLTOOLKIT_LIBRARIES}")
 
 
 # ---[ rapidjson
 # ---[ rapidjson
 include_directories(${CNSTREAM_ROOT_DIR}/3rdparty/)
 include_directories(${CNSTREAM_ROOT_DIR}/3rdparty/)
@@ -87,7 +87,7 @@ aux_source_directory(${CNSTREAM_ROOT_DIR}/test/src tests)
 aux_source_directory(${CNSTREAM_ROOT_DIR}/test/TestApp/src testApps)
 aux_source_directory(${CNSTREAM_ROOT_DIR}/test/TestApp/src testApps)
 
 
 # ---[ add targets
 # ---[ add targets
-set(EXECUTABLE_OUTPUT_PATH ${TEST_ROOT_DIR}/bin)
+# set(EXECUTABLE_OUTPUT_PATH ${TEST_ROOT_DIR}/bin)
 
 
 #add_executable(gsd ${srcs} ${userApps} ${3RDPARTY_LIBS})
 #add_executable(gsd ${srcs} ${userApps} ${3RDPARTY_LIBS})
 #target_link_libraries(gsd gsd_core gsd_modules gsd_plugins ${3RDPARTY_LIBS} pthread dl)
 #target_link_libraries(gsd gsd_core gsd_modules gsd_plugins ${3RDPARTY_LIBS} pthread dl)

+ 1 - 1
test/TestApp/include/TestApp.hpp

@@ -5,7 +5,7 @@
 #include "Util/SqlPool.h"
 #include "Util/SqlPool.h"
 #include "UtilBase.hpp"
 #include "UtilBase.hpp"
 #include "Util/logger.h"
 #include "Util/logger.h"
-#include "config.hpp"
+//#include "config.hpp"
 
 
 #include "HepuPlugin.hpp"
 #include "HepuPlugin.hpp"