Fix build on Mac

This commit is contained in:
Adam Gu
2019-04-21 12:16:28 +08:00
parent 4721d50363
commit 847a20483f
4 changed files with 20 additions and 14 deletions
+12 -7
View File
@@ -75,9 +75,9 @@ find_package(Threads REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
if(WIN32)
find_package(Boost 1.66.0 REQUIRED)
find_package(Boost REQUIRED)
else()
find_package(Boost 1.66.0 REQUIRED COMPONENTS system filesystem)
find_package(Boost REQUIRED COMPONENTS system filesystem date_time)
endif()
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
@@ -128,20 +128,25 @@ endif()
add_subdirectory(webcc)
if(WEBCC_ENABLE_EXAMPLES)
if(WEBCC_ENABLE_AUTOTEST OR WEBCC_ENABLE_EXAMPLES)
# 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(examples)
add_subdirectory(${THIRD_PARTY_DIR}/src/jsoncpp)
endif()
if(WEBCC_ENABLE_AUTOTEST OR WEBCC_ENABLE_UNITTEST)
add_subdirectory(${THIRD_PARTY_DIR}/src/gtest)
endif()
if(WEBCC_ENABLE_AUTOTEST)
add_subdirectory(autotest)
endif()
if(WEBCC_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
if(WEBCC_ENABLE_UNITTEST)
add_subdirectory(${THIRD_PARTY_DIR}/src/gtest)
add_subdirectory(unittest)
endif()