fix build option issues; refine cmake
This commit is contained in:
+11
-3
@@ -1,9 +1,16 @@
|
||||
# Unit test
|
||||
|
||||
file(GLOB UT_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
|
||||
set(UT_TARGET_NAME unittest)
|
||||
|
||||
set(UT_TARGET_NAME webcc_unittest)
|
||||
set(UT_SRCS
|
||||
base64_unittest.cc
|
||||
body_unittest.cc
|
||||
request_parser_unittest.cc
|
||||
response_builder_unittest.cc
|
||||
router_unittest.cc
|
||||
string_unittest.cc
|
||||
url_unittest.cc
|
||||
)
|
||||
|
||||
# Common libraries to link.
|
||||
set(UT_LIBS
|
||||
@@ -18,5 +25,6 @@ endif()
|
||||
|
||||
add_executable(${UT_TARGET_NAME} ${UT_SRCS})
|
||||
target_link_libraries(${UT_TARGET_NAME} ${UT_LIBS})
|
||||
set_target_properties(${UT_TARGET_NAME} PROPERTIES FOLDER "Tests")
|
||||
|
||||
add_test(${UT_TARGET_NAME} ${UT_TARGET_NAME})
|
||||
|
||||
Reference in New Issue
Block a user