mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-01 16:37:45 +00:00
68 lines
2.4 KiB
CMake
68 lines
2.4 KiB
CMake
cmake_policy( SET CMP0014 NEW )
|
|
cmake_minimum_required( VERSION 3.0.2 )
|
|
project( Sapphire )
|
|
|
|
#set( CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin )
|
|
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin )
|
|
set( LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin )
|
|
|
|
if( WIN32 )
|
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/bin/" )
|
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_CURRENT_BINARY_DIR}/bin/" )
|
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_CURRENT_BINARY_DIR}/bin/" )
|
|
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_BINARY_DIR}/bin/" )
|
|
set( VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin/" )
|
|
endif()
|
|
|
|
set( CMAKE_MODULE_PATH
|
|
${CMAKE_MODULE_PATH}
|
|
${CMAKE_SOURCE_DIR}/cmake )
|
|
|
|
add_custom_target( copy_runtime_files ALL
|
|
COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/config ${CMAKE_BINARY_DIR}/bin/config
|
|
COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/sql ${CMAKE_BINARY_DIR}/bin/sql
|
|
COMMAND cmake -E copy_directory ${CMAKE_SOURCE_DIR}/web ${CMAKE_BINARY_DIR}/bin/web )
|
|
|
|
######################################
|
|
# Dependencies and compiler settings #
|
|
######################################
|
|
include( "cmake/mysql.cmake" )
|
|
include( "cmake/compiler.cmake" )
|
|
include( "cmake/cotire.cmake" )
|
|
|
|
##############################
|
|
# Git #
|
|
##############################
|
|
include( GetGitRevisionDescription )
|
|
get_git_head_revision( GIT_REFSPEC GIT_SHA1 )
|
|
git_describe( VERSION --all --dirty=-d )
|
|
configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/src/common/Version.cpp.in"
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/Version.cpp" @ONLY )
|
|
|
|
##############################
|
|
# Mysql #
|
|
##############################
|
|
find_package( MySQL )
|
|
|
|
##############################
|
|
# Dependencies #
|
|
##############################
|
|
add_subdirectory( "deps/zlib" )
|
|
add_subdirectory( "deps/MySQL" )
|
|
add_subdirectory( "deps/datReader" )
|
|
add_subdirectory( "deps/mysqlConnector" )
|
|
|
|
##############################
|
|
# Main Sapphire Components #
|
|
##############################
|
|
add_subdirectory( "src/common" )
|
|
add_subdirectory( "src/api" )
|
|
add_subdirectory( "src/lobby" )
|
|
add_subdirectory( "src/world" )
|
|
add_subdirectory( "src/scripts" )
|
|
add_subdirectory( "src/dbm" )
|
|
|
|
##############################
|
|
# Tools #
|
|
##############################
|
|
add_subdirectory( "src/tools" )
|