1 Star 0 Fork 0

kryoer/cpp-ipc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 2.26 KB
一键复制 编辑 原始数据 按行查看 历史
mutouyun 提交于 2023-09-23 14:19 . Supplement similar demo under linux.
cmake_minimum_required(VERSION 3.10)
project(cpp-ipc)
option(LIBIPC_BUILD_TESTS "Build all of libipc's own tests." OFF)
option(LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF)
option(LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
option(LIBIPC_USE_STATIC_CRT "Set to ON to build with static CRT on Windows (/MT)." OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
if(NOT MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
endif()
if (MSVC)
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
if (LIBIPC_USE_STATIC_CRT)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
string(REPLACE "/MDd" "/MTd" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
else()
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MT" "/MD" ${CompilerFlag} "${${CompilerFlag}}")
string(REPLACE "/MTd" "/MDd" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
endif()
endif()
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
set(LIBIPC_PROJECT_DIR ${PROJECT_SOURCE_DIR})
# Unicode Support
add_definitions(-DUNICODE -D_UNICODE)
add_subdirectory(src)
if (LIBIPC_BUILD_TESTS)
set(GOOGLETEST_VERSION 1.10.0)
if (LIBIPC_USE_STATIC_CRT)
set(gtest_force_shared_crt OFF)
else()
set(gtest_force_shared_crt ON)
endif()
add_subdirectory(3rdparty/gtest)
add_subdirectory(test)
endif()
if (LIBIPC_BUILD_DEMOS)
add_subdirectory(demo/chat)
add_subdirectory(demo/msg_que)
add_subdirectory(demo/send_recv)
if (MSVC)
add_subdirectory(demo/win_service/service)
add_subdirectory(demo/win_service/client)
else()
add_subdirectory(demo/linux_service/service)
add_subdirectory(demo/linux_service/client)
endif()
endif()
install(
DIRECTORY "include/"
DESTINATION "include"
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kryoer/cpp-ipc.git
git@gitee.com:kryoer/cpp-ipc.git
kryoer
cpp-ipc
cpp-ipc
master

搜索帮助