-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
43 lines (32 loc) · 1.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR)
project(xchange)
set(JSONCPP_WITH_TESTS OFF CACHE BOOL "Turn off JsonCpp tests")
set(MSGPACK_CXX11 ON CACHE BOOL "Turn on C++11 for msgpack")
set(MSGPACK_BUILD_EXAMPLES OFF CACHE BOOL "Turn off msgpack examples")
set(MSGPACK_BUILD_TESTS OFF CACHE BOOL "Turn off msgpack tests")
set(MSGPACK_ENABLE_SHARED OFF CACHE BOOL "Turn off msgpack shared library")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(formats/jsoncpp)
add_subdirectory(formats/msgpack)
include_directories(
src
formats/msgpack/include
formats/rapidjson/include
formats/jsoncpp/include
)
link_directories(${CMAKE_BINARY_DIR}/lib)
list(APPEND SOURCES
src/main.cpp
src/msgpack/type/rapidjson.hpp
src/msgpack/type/jsoncpp.hpp
)
add_definitions(-std=c++11)
add_executable(xchange ${SOURCES})
target_link_libraries(xchange msgpack-static jsoncpp_lib_static)
if (MSVC)
set_property(TARGET xchange APPEND_STRING PROPERTY COMPILE_FLAGS "/wd4290")
set_property(TARGET msgpack APPEND_STRING PROPERTY COMPILE_FLAGS "/wd4100 /wd4127 /wd4204 /wd4290")
set_property(TARGET msgpack-static APPEND_STRING PROPERTY COMPILE_FLAGS "/wd4100 /wd4127 /wd4204 /wd4290")
endif (MSVC)