From d328f3a957bc0c98f0983bcee6f5d48e74d7dbf1 Mon Sep 17 00:00:00 2001 From: Chunting Gu Date: Wed, 30 Jan 2019 09:56:07 +0800 Subject: [PATCH] Fix CMake issues --- CMakeLists.txt | 13 ++++++++----- unittest/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4420949..abca1b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,12 +107,13 @@ if(WIN32) link_directories(${THIRD_PARTY_DIR}/win32/lib) endif() +# For including pugixml as "pugixml/pugixml.hpp" or gtest as +# "gtest/gtest.h". +include_directories(${THIRD_PARTY_DIR}/src) + # SOAP support needs pugixml to parse and create XML. if(WEBCC_ENABLE_SOAP) add_subdirectory(${THIRD_PARTY_DIR}/src/pugixml) - - # For including pugixml as "pugixml/pugixml.hpp". - include_directories(${THIRD_PARTY_DIR}/src) endif() add_subdirectory(webcc) @@ -121,10 +122,12 @@ if(WEBCC_ENABLE_EXAMPLES) add_subdirectory(example/http_hello_client) add_subdirectory(example/http_hello_async_client) - # REST example needs jsoncpp to parse and create JSON. - add_subdirectory(${THIRD_PARTY_DIR}/src/jsoncpp) + # For including jsoncpp as "json/json.h". include_directories(${THIRD_PARTY_DIR}/src/jsoncpp) + # REST examples need jsoncpp to parse and create JSON. + add_subdirectory(${THIRD_PARTY_DIR}/src/jsoncpp) + add_subdirectory(example/rest_book_server) add_subdirectory(example/rest_book_client) add_subdirectory(example/rest_book_async_client) diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 409b42d..3c83354 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -6,7 +6,7 @@ set(UT_SRCS set(UT_TARGET_NAME webcc_unittest) add_executable(${UT_TARGET_NAME} ${UT_SRCS}) -target_link_libraries(${UT_TARGET_NAME} webcc pugixml gtest ${Boost_LIBRARIES}) +target_link_libraries(${UT_TARGET_NAME} webcc gtest ${Boost_LIBRARIES}) target_link_libraries(${UT_TARGET_NAME} "${CMAKE_THREAD_LIBS_INIT}") add_test(${UT_TARGET_NAME} ${UT_TARGET_NAME})