1 Star 0 Fork 0

suomier/st_gtest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
suomier 提交于 2022-03-13 17:53 . gtest例子代码
cmake_minimum_required(VERSION 3.17)
project(test)
set(CMAKE_CXX_STANDARD 11)
# ------------------------------------------------------------------
# gtest
# ------------------------------------------------------------------
include_directories("/usr/local/include")
link_directories("/usr/local/lib/")
# ------------------------------------------------------------------
# source files
# ------------------------------------------------------------------
include_directories(src/samples1)
AUX_SOURCE_DIRECTORY(src/samples1 samples1_code)
include_directories(src/samples2)
AUX_SOURCE_DIRECTORY(src/samples2 samples2_code)
include_directories(src/samples3)
AUX_SOURCE_DIRECTORY(src/samples3 samples3_code)
include_directories(src/samples4)
AUX_SOURCE_DIRECTORY(src/samples4 samples4_code)
include_directories(src/samples5)
AUX_SOURCE_DIRECTORY(src/samples5 samples5_code)
include_directories(src/samples678)
AUX_SOURCE_DIRECTORY(src/samples678 samples6_code)
include_directories(src/samples9)
AUX_SOURCE_DIRECTORY(src/samples9 samples9_code)
include_directories(src/samples10)
AUX_SOURCE_DIRECTORY(src/samples10 samples10_code)
include_directories(src/moke)
AUX_SOURCE_DIRECTORY(src/moke moke_code)
add_executable(test main.cpp
${samples1_code}
${samples2_code}
${samples3_code}
${samples4_code}
${samples5_code}
${samples6_code}
)
target_link_libraries(test pthread gtest)
# 事件案例, 可以定制化输出,但是必须包含 main
add_executable(test_cb ${samples9_code})
target_link_libraries(test_cb pthread gtest)
# 内存泄露检测
add_executable(test_malloc ${samples10_code})
target_link_libraries(test_malloc pthread gtest)
# 内存泄露检测
add_executable(test_moke ${moke_code})
target_link_libraries(test_moke pthread gtest gmoke)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/suomier/st_gtest.git
git@gitee.com:suomier/st_gtest.git
suomier
st_gtest
st_gtest
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385