Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
forked from cpp-master/cpp-tbox
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (14)
Tags (28)
master
develop
feat/mqtt-reconnect
tidy/doc
wlabs-develop
fix/terminal-mem-leak
feat/use-config-enable-epoll
feature-Broker
opt-loop-wdog
feature-DBus
feature-epoll
feature-update-readme
feature-Dns
feature-TcpSSL
v1.13.2
v1.12.28
v1.12.25
v1.12.22
v1.12.20
v1.12.10
v1.12.0
v1.11.14
v1.11.12
v1.11.11
v1.11.5
v1.11.4
v1.11.2
v1.11.0
v1.10.27
v1.10.23
v1.10.21
v1.10.20
v1.10.18
v1.10.17
master
Branches (14)
Tags (28)
master
develop
feat/mqtt-reconnect
tidy/doc
wlabs-develop
fix/terminal-mem-leak
feat/use-config-enable-epoll
feature-Broker
opt-loop-wdog
feature-DBus
feature-epoll
feature-update-readme
feature-Dns
feature-TcpSSL
v1.13.2
v1.12.28
v1.12.25
v1.12.22
v1.12.20
v1.12.10
v1.12.0
v1.11.14
v1.11.12
v1.11.11
v1.11.5
v1.11.4
v1.11.2
v1.11.0
v1.10.27
v1.10.23
v1.10.21
v1.10.20
v1.10.18
v1.10.17
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (14)
Tags (28)
master
develop
feat/mqtt-reconnect
tidy/doc
wlabs-develop
fix/terminal-mem-leak
feat/use-config-enable-epoll
feature-Broker
opt-loop-wdog
feature-DBus
feature-epoll
feature-update-readme
feature-Dns
feature-TcpSSL
v1.13.2
v1.12.28
v1.12.25
v1.12.22
v1.12.20
v1.12.10
v1.12.0
v1.11.14
v1.11.12
v1.11.11
v1.11.5
v1.11.4
v1.11.2
v1.11.0
v1.10.27
v1.10.23
v1.10.21
v1.10.20
v1.10.18
v1.10.17
cpp-tbox
/
CMakeLists.txt
cpp-tbox
/
CMakeLists.txt
CMakeLists.txt 6.35 KB
Copy Edit Raw Blame History
海卫哥 authored 2024年06月12日 08:52 +08:00 . fix: 修复了CMake构建问题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
#
# .============.
# // M A K E / \
# // C++ DEV / \
# // E A S Y / \/ \
# ++ ----------. \/\ .
# \\ \ \ /\ /
# \\ \ \ /
# \\ \ \ /
# -============'
#
# Copyright (c) 2018 Hevake and contributors, all rights reserved.
#
# This file is part of cpp-tbox (https://github.com/cpp-main/cpp-tbox)
# Use of this source code is governed by MIT license that can be found
# in the LICENSE file in the root of the source tree. All contributing
# project authors may be found in the CONTRIBUTORS.md file in the root
# of the source tree.
#
cmake_minimum_required(VERSION 3.15)
#
# Building in-tree is not allowed (we take care of your craziness).
#
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the source code and call cmake from there. Thank you.")
endif()
#
# Project configuration
#
file(STRINGS "version.mk" VERSION_CONTENTS)
set(REGEX_MAJOR "TBOX_VERSION_MAJOR *:= *([0-9]+)")
set(REGEX_MINOR "TBOX_VERSION_MINOR *:= *([0-9]+)")
set(REGEX_REVISION "TBOX_VERSION_REVISION *:= *([0-9]+)")
string(REGEX MATCH "${REGEX_MAJOR}" _ ${VERSION_CONTENTS})
set(TBOX_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "${REGEX_MINOR}" _ ${VERSION_CONTENTS})
set(TBOX_VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "${REGEX_REVISION}" _ ${VERSION_CONTENTS})
set(TBOX_VERSION_REVISION ${CMAKE_MATCH_1})
set(TBOX_VERSION ${TBOX_VERSION_MAJOR}.${TBOX_VERSION_MINOR}.${TBOX_VERSION_REVISION})
#
# Set install prefix
#
#set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/install" CACHE PATH "")
project(
cpp-tbox
VERSION ${TBOX_VERSION}
DESCRIPTION "Easy to use, convenient and modern C++ treasure box!"
HOMEPAGE_URL "https://gitee.com/cpp-master/cpp-tbox"
LANGUAGES C CXX
)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(TBOX_BUILD_LIB_TYPE STATIC)
message("*")
message("* ${PROJECT_NAME} v${PROJECT_VERSION} (${CMAKE_BUILD_TYPE})")
message("* Copyright (c) 2020-2025 Hevake,Lucas")
message("*")
option(TBOX_ENABLE_BASE "build base" ON)
option(TBOX_ENABLE_UTIL "build util" ON)
option(TBOX_ENABLE_EVENT "build event" ON)
option(TBOX_ENABLE_EVENTX "build eventx" ON)
option(TBOX_ENABLE_LOG "build log" ON)
option(TBOX_ENABLE_NETWORK "build network" ON)
option(TBOX_ENABLE_TERMINAL "build terminal" ON)
option(TBOX_ENABLE_TRACE "build trace" ON)
option(TBOX_ENABLE_MAIN "build main" ON)
option(TBOX_ENABLE_COROUTINE "build coroutine" ON)
option(TBOX_ENABLE_HTTP "build http" ON)
option(TBOX_ENABLE_MQTT "build mqtt" ON)
option(TBOX_ENABLE_FLOW "build flow" ON)
option(TBOX_ENABLE_ALARM "build alarm" ON)
option(TBOX_ENABLE_CRYPTO "build crypto" ON)
option(TBOX_ENABLE_JSONRPC "build jsonrpc" ON)
option(TBOX_ENABLE_DBUS "build dbus" ON)
#
# 3rd-party libraries
#
option(TBOX_ENABLE_NLOHMANN_JSON "install nlohmann/json" ON)
#
# TESTS
#
option(CMAKE_ENABLE_TEST "Whether to enable unit tests" ON)
if(CMAKE_ENABLE_TEST)
message(STATUS "Unit tests enabled")
find_package(GTest REQUIRED)
set(TBOX_ENABLE_TEST ON)
enable_testing()
endif()
include(GNUInstallDirs)
#
# Compiler args
#
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 11)
add_compile_options(-Wall -Wextra -Werror -Wno-missing-field-initializers)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rd-party)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/modules)
add_definitions(-DTBOX_VERSION_MAJOR=${TBOX_VERSION_MAJOR}
-DTBOX_VERSION_MINOR=${TBOX_VERSION_MINOR}
-DTBOX_VERSION_REVISION=${TBOX_VERSION_REVISION})
set(TBOX_COMPONENTS)
if(TBOX_ENABLE_BASE)
message(STATUS "base module enabled")
list(APPEND TBOX_COMPONENTS base)
endif()
if(TBOX_ENABLE_UTIL)
message(STATUS "util module enabled")
list(APPEND TBOX_COMPONENTS util)
endif()
if(TBOX_ENABLE_EVENT)
message(STATUS "event module enabled")
list(APPEND TBOX_COMPONENTS event)
endif()
if(TBOX_ENABLE_EVENTX)
message(STATUS "eventx module enabled")
list(APPEND TBOX_COMPONENTS eventx)
endif()
if(TBOX_ENABLE_LOG)
message(STATUS "log module enabled")
list(APPEND TBOX_COMPONENTS log)
endif()
if(TBOX_ENABLE_NETWORK)
message(STATUS "network module enabled")
list(APPEND TBOX_COMPONENTS network)
endif()
if(TBOX_ENABLE_TERMINAL)
message(STATUS "terminal module enabled")
list(APPEND TBOX_COMPONENTS terminal)
endif()
if(TBOX_ENABLE_TRACE)
message(STATUS "trace module enabled")
list(APPEND TBOX_COMPONENTS trace)
endif()
if(TBOX_ENABLE_MAIN)
message(STATUS "main module enabled")
list(APPEND TBOX_COMPONENTS main)
endif()
if(TBOX_ENABLE_COROUTINE)
message(STATUS "coroutine module enabled")
list(APPEND TBOX_COMPONENTS coroutine)
endif()
if(TBOX_ENABLE_HTTP)
message(STATUS "http module enabled")
list(APPEND TBOX_COMPONENTS http)
endif()
if(TBOX_ENABLE_MQTT)
message(STATUS "mqtt module enabled")
list(APPEND TBOX_COMPONENTS mqtt)
endif()
if(TBOX_ENABLE_FLOW)
message(STATUS "flow module enabled")
list(APPEND TBOX_COMPONENTS flow)
endif()
if(TBOX_ENABLE_ALARM)
message(STATUS "alarm module enabled")
list(APPEND TBOX_COMPONENTS alarm)
endif()
if(TBOX_ENABLE_CRYPTO)
message(STATUS "crypto module enabled")
list(APPEND TBOX_COMPONENTS crypto)
endif()
if(TBOX_ENABLE_JSONRPC)
message(STATUS "jsonrpc module enabled")
list(APPEND TBOX_COMPONENTS jsonrpc)
endif()
if(TBOX_ENABLE_DBUS)
message(STATUS "dbus module enabled")
list(APPEND TBOX_COMPONENTS dbus)
endif()
foreach(item IN LISTS TBOX_COMPONENTS)
add_subdirectory(modules/${item})
endforeach()
if(TBOX_ENABLE_NLOHMANN_JSON)
message(STATUS "nlohmann/json installation enabled")
list(APPEND TBOX_COMPONENTS nlohmann)
add_subdirectory(3rd-party/nlohmann)
endif()
#
# installation
#
include(CMakePackageConfigHelpers)
# generate the version file for the config file
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/tboxConfigVersion.cmake"
VERSION "${TBOX_VERSION}"
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/tboxConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tbox
PATH_VARS TBOX_COMPONENTS
)
install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/tboxConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/tboxConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tbox
)
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

cpp-tbox是一个Linux C++,MIT开源许可的,基于 Reactor 模式的开发框架与组件库。它主要针对智能硬件、机器人、网络服务等开发领域。 它提供了一套易于开发、稳定可靠的框架,有:通信库(TCP/UDP/串口)、HTTP、线程池、定时器池、协程、日志、命令终端、状态机、行为树等非常实用的开发组件,以及完备实用的主框架,能为广大开发者节省大量开发与调试时间。
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/yu0824/cpp-tbox.git
git@gitee.com:yu0824/cpp-tbox.git
yu0824
cpp-tbox
cpp-tbox
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /