drogon/unittest/CMakeLists.txt
0rangeFox df51674792
Enhancements on files part. (#803)
Co-authored-by: an-tao <antao2002@gmail.com>
2021-04-17 14:01:06 +08:00

42 lines
1.4 KiB
CMake

add_executable(drogon_msgbuffer_unittest MsgBufferUnittest.cpp)
add_executable(drobject_unittest DrObjectUnittest.cpp)
add_executable(gzip_unittest GzipUnittest.cpp)
add_executable(md5_unittest MD5Unittest.cpp)
add_executable(sha1_unittest SHA1Unittest.cpp ../lib/src/ssl_funcs/Sha1.cc)
add_executable(ostringstream_unittest OStringStreamUnitttest.cpp)
add_executable(base64_unittest Base64Unittest.cpp)
add_executable(pubsubservice_unittest PubSubServiceUnittest.cpp)
add_executable(httpdate_unittest HttpDateUnittest.cpp)
add_executable(httpheader_unittest HttpHeaderUnittest.cpp)
add_executable(filetype_unittest FileTypeUnittest.cpp)
if(Brotli_FOUND)
add_executable(brotli_unittest BrotliUnittest.cpp)
endif()
set(UNITTEST_TARGETS
drogon_msgbuffer_unittest
drobject_unittest
gzip_unittest
md5_unittest
sha1_unittest
ostringstream_unittest
base64_unittest
pubsubservice_unittest
httpdate_unittest
httpheader_unittest
filetype_unittest)
if(Brotli_FOUND)
set(UNITTEST_TARGETS ${UNITTEST_TARGETS} brotli_unittest)
endif()
set_property(TARGET ${UNITTEST_TARGETS}
PROPERTY CXX_STANDARD ${DROGON_CXX_STANDARD})
set_property(TARGET ${UNITTEST_TARGETS} PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET ${UNITTEST_TARGETS} PROPERTY CXX_EXTENSIONS OFF)
include(GoogleTest)
foreach(T ${UNITTEST_TARGETS})
target_link_libraries(${T} PRIVATE drogon GTest::GTest)
gtest_discover_tests(${T})
endforeach()