From 73689afc09ce346f9eb00e02faf7f242e55dc7ee Mon Sep 17 00:00:00 2001
From: fujuntang <fujuntang@smartai.com>
Date: 星期四, 09 十二月 2021 19:33:00 +0800
Subject: [PATCH] Add the sync to fix the resource clear issue.
---
CMakeLists.txt | 57 +++++++++++++++++++++++++++++----------------------------
1 files changed, 29 insertions(+), 28 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4a8bee..ae3249b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,41 +1,42 @@
cmake_minimum_required(VERSION 3.5)
# set the project name and version
-project(B_BUS VERSION 3.0)
+project(B_BUS VERSION 2.2)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+add_compile_options(-fPIC)
+
+option(BUILD_DOC "Build doc" OFF)
-# add the MathFunctions library
-# if(USE_MYMATH)
-# add_subdirectory(MathFunctions)
-# list(APPEND EXTRA_LIBS MathFunctions)
-# endif()
+list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/include/usgcommon")
+list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/proto/source")
+list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/src/msg_trigger")
+list(APPEND EXTRA_LIBS ${PROJECT_SOURCE_DIR}/lib/libusgcommon.a pthread rt protobuf.a protobuf-lite.a)
-# list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/include/usgcommon")
-# list(APPEND EXTRA_LIBS lib/usgcommon)
+# build api doc
+if (BUILD_DOC)
+ # build the docs
+ add_subdirectory(${PROJECT_SOURCE_DIR}/doc)
+else()
+ add_subdirectory(${PROJECT_SOURCE_DIR}/src)
+ add_subdirectory(${PROJECT_SOURCE_DIR}/test)
+ add_subdirectory(${PROJECT_SOURCE_DIR}/test_net_socket)
+ add_subdirectory(${PROJECT_SOURCE_DIR}/test_socket)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}/proto)
+ #add_subdirectory(${PROJECT_SOURCE_DIR}/shm_util)
+endif()
-add_subdirectory(${PROJECT_SOURCE_DIR}/src)
-# list(APPEND EXTRA_LIBS shm_queue)
+add_definitions("-DPROTOBUF_USS_DLLS")
-
-# target_link_libraries(B_BUS PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find BusConfig.h
-# target_include_directories(B_BUS PUBLIC
-# "${PROJECT_BINARY_DIR}"
-# ${EXTRA_INCLUDES}
-# )
-
-# add the executable
-# add_executable(B_BUS B_BUS.cxx)
-# add the install targets
-# install(TARGETS B_BUS DESTINATION bin)
-# install(FILES "${PROJECT_BINARY_DIR}/BusConfig.h"
-# DESTINATION include
-# )
-
--
Gitblit v1.8.0