2018-11-26 17:06:59 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
|
|
|
|
MESSAGE(STATUS "operation system is ${CMAKE_SYSTEM}")
|
|
|
|
MESSAGE(STATUS "root source directory is ${PROJECT_SOURCE_DIR}")
|
|
|
|
MESSAGE(STATUS "current source directory is ${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
|
|
|
|
set(CMAKE_CONFIGURATION_TYPES Debug Release)
|
|
|
|
|
|
|
|
# Determine the platform.
|
|
|
|
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
|
|
|
MESSAGE(STATUS "build on macOS...")
|
|
|
|
set(OS_MACOS 1)
|
|
|
|
set(OS_POSIX 1)
|
2020-01-15 12:07:34 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
2018-11-26 17:06:59 +00:00
|
|
|
set(TP_EXTERNAL_RELEASE_DIR "${PROJECT_SOURCE_DIR}/external/macos/release")
|
2020-12-04 17:33:47 +00:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/out/server/macos/bin")
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/out/server/macos/bin")
|
2018-11-26 17:06:59 +00:00
|
|
|
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
2020-09-10 17:20:11 +00:00
|
|
|
MESSAGE(STATUS "build on Linux...")
|
2018-11-26 17:06:59 +00:00
|
|
|
set(OS_LINUX 1)
|
|
|
|
set(OS_POSIX 1)
|
2019-11-19 16:09:33 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
2018-11-26 17:06:59 +00:00
|
|
|
set(TP_EXTERNAL_RELEASE_DIR "${PROJECT_SOURCE_DIR}/external/linux/release")
|
2020-12-04 17:33:47 +00:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/out/server/linux/bin")
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/out/server/linux/bin")
|
2018-11-26 17:06:59 +00:00
|
|
|
elseif ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
|
2020-01-15 12:07:34 +00:00
|
|
|
MESSAGE(FATAL_ERROR "unsupported platform: Windows")
|
2018-11-26 17:06:59 +00:00
|
|
|
else ()
|
|
|
|
MESSAGE(FATAL_ERROR "unsupported platform: ${CMAKE_SYSTEM_NAME}")
|
|
|
|
endif ()
|
|
|
|
|