cmake_minimum_required(VERSION 2.8) add_subdirectory("motor") include(motor/cmake/set_system_include_flag.cmake) include(motor/cmake/address_sanitizer.cmake) include(motor/cmake/detect_compiler.cmake) check_compiling_with_clang(COMPILING_WITH_CLANG) check_compiling_with_gcc(COMPILING_WITH_GCC) if(${COMPILING_WITH_CLANG}) if(APPLE) include_directories(SYSTEM "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/") endif() endif() if(MINGW) include(motor/cmake/enable_gnu11.cmake) else() include(motor/cmake/enable_cpp11.cmake) endif() if(UNIX) #Always compile with debugging symbols set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") else() if(MSVC) message(FATAL_ERROR "Were not supporting MSVC at this time") elseif(MINGW) #assume were runnig cross compilation add_definitions("-DGLEW_STATIC" "-DAL_LIBTYPE_STATIC" "-DALURE_STATIC_LIBRARY" "-DBOOST_THREAD_USE_LIB") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3") else() message(FATAL_ERROR "Unsupported platform detected") endif() endif() include(motor/cmake/warning_settings.cmake) get_sane_warning_flags(warnings) include(motor/cmake/join.cmake) join("${warnings}" " " warnings) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${warnings}") # websockets lib set(WITHOUT_TESTAPPS ON CACHE INTERNAL "" FORCE) add_subdirectory(${PROJECT_SOURCE_DIR}/contrib/libwebsockets/) include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/contrib/libwebsockets/") # 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/") add_subdirectory("src")