|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g3")
|
|
|
|
|
|
|
|
project(server)
|
|
|
|
|
|
|
|
# JSON lib
|
|
|
|
set(JSON_SPIRIT_BUILD_DEMOS OFF CACHE INTERNAL "" FORCE)
|
|
|
|
set(JSON_SPIRIT_BUILD_TESTS OFF CACHE INTERNAL "" FORCE)
|
|
|
|
set(JSON_SPIRIT_LIBRARY_TYPE "STATIC" CACHE INTERNAL "" FORCE)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/contrib/json-spirit/build ${CMAKE_CURRENT_BINARY_DIR}/json-spirit)
|
|
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/contrib/json-spirit/include/")
|
|
|
|
|
|
|
|
# websockets lib
|
|
|
|
set(WITHOUT_TESTAPPS ON CACHE INTERNAL "" FORCE)
|
|
|
|
add_subdirectory(${PROJECT_SOURCE_DIR}/contrib/libwebsockets/)
|
|
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/contrib/libwebsockets/")
|
|
|
|
|
|
|
|
# Boost libs
|
|
|
|
find_package(Boost 1.47 REQUIRED COMPONENTS thread system)
|
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
set(boost ${Boost_LIBRARIES})
|
|
|
|
|
|
|
|
set(all_libraries websockets json_spirit)
|
|
|
|
|
|
|
|
# Own files
|
|
|
|
include_directories("${PROJECT_SOURCE_DIR}")
|
|
|
|
include_directories("${PROJECT_SOURCE_DIR}/src/")
|
|
|
|
file(GLOB all_files "src/*.cpp")
|
|
|
|
|
|
|
|
add_executable(server ${all_files})
|
|
|
|
target_link_libraries(server ${all_libraries})
|