56 строки
1.2 KiB
CMake
56 строки
1.2 KiB
CMake
|
cmake_minimum_required(VERSION 3.5.1)
|
||
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||
|
|
||
|
if (POLICY CMP0074)
|
||
|
cmake_policy(SET CMP0074 NEW) # CMake 3.12
|
||
|
endif ()
|
||
|
|
||
|
if (POLICY CMP0077)
|
||
|
cmake_policy(SET CMP0077 NEW)
|
||
|
endif()
|
||
|
|
||
|
if (POLICY CMP0079)
|
||
|
cmake_policy(SET CMP0079 NEW)
|
||
|
endif()
|
||
|
|
||
|
project(translator_server CXX C)
|
||
|
|
||
|
|
||
|
set(CMAKE_CXX_STANDARD 17)
|
||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||
|
|
||
|
find_package(Threads REQUIRED)
|
||
|
#find_package(Tcmalloc)
|
||
|
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-pthread")
|
||
|
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-pthread")
|
||
|
|
||
|
include(CMakeDependentOption)
|
||
|
|
||
|
if (NOT CMAKE_BUILD_TYPE)
|
||
|
message(STATUS "No build type selected, default to Release")
|
||
|
set(CMAKE_BUILD_TYPE "Release")
|
||
|
endif()
|
||
|
|
||
|
|
||
|
find_program(CCACHE_FOUND ccache)
|
||
|
if(CCACHE_FOUND)
|
||
|
message("Found ccache ${CCACHE_FOUND}")
|
||
|
message("Using ccache to speed up compilation")
|
||
|
set(ENV{CCACHE_CPP2} "yes")
|
||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||
|
endif(CCACHE_FOUND)
|
||
|
|
||
|
|
||
|
|
||
|
include_directories( ${Boost_INCLUDE_DIR} )
|
||
|
|
||
|
add_subdirectory(3rd_party/moz-bergamot-translator)
|
||
|
add_subdirectory(3rd_party/crow)
|
||
|
|
||
|
include_directories( 3rd_party/crow/include )
|
||
|
|
||
|
add_subdirectory(src)
|
||
|
|
||
|
|