Files
rest_rpc/examples/CMakeLists.txt
T

31 lines
837 B
CMake
Raw Normal View History

2020-09-21 15:43:25 +08:00
cmake_minimum_required(VERSION 3.1)
2020-10-21 12:38:13 +08:00
project(example)
2019-03-21 16:20:53 +08:00
2019-04-10 13:48:35 +08:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11")
2019-03-21 16:20:53 +08:00
2020-06-08 09:23:51 +08:00
SET(ENABLE_SSL OFF)
if (ENABLE_SSL)
add_definitions(-DCINATRA_ENABLE_SSL)
message(STATUS "Use SSL")
endif()
2020-10-23 16:41:15 +08:00
find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(JNI REQUIRED)
2020-10-23 16:41:15 +08:00
2020-10-21 12:39:25 +08:00
include_directories(
2020-10-23 16:41:15 +08:00
"/usr/local/include"
2020-10-31 22:38:49 +08:00
"../include"
"../third/msgpack/include")
2019-03-21 16:20:53 +08:00
2020-10-21 12:38:13 +08:00
add_executable(basic_server server/main.cpp)
add_executable(basic_client client/main.cpp)
2020-06-08 09:23:51 +08:00
if (ENABLE_SSL)
2020-10-22 09:56:39 +08:00
target_link_libraries(basic_server ${Boost_LIBRARIES} -lssl -lcrypto -lpthread)
2020-10-21 22:49:00 +08:00
target_link_libraries(basic_client ${Boost_LIBRARIES} -lssl -lcrypto -lpthread)
2020-06-08 09:23:51 +08:00
else()
2020-10-22 09:56:39 +08:00
target_link_libraries(basic_server ${Boost_LIBRARIES})
2020-10-21 22:49:00 +08:00
target_link_libraries(basic_client ${Boost_LIBRARIES})
2020-06-08 09:23:51 +08:00
endif()