2022-03-05 12:44:06 +02:00
|
|
|
cmake_minimum_required(VERSION 3.12)
|
|
|
|
|
|
|
|
# Build mode debug/release?
|
|
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
|
2022-11-27 22:18:08 +02:00
|
|
|
# Set C++ standard to C++17
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2022-03-05 12:44:06 +02:00
|
|
|
|
|
|
|
project("Metin2 Server")
|
|
|
|
|
|
|
|
set(BINARY_OUTPUT_DIR ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
|
|
|
# Set build directory
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
|
|
|
|
# Set the CMake module directory
|
2022-03-06 17:36:43 +02:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
2022-03-05 12:44:06 +02:00
|
|
|
|
|
|
|
# Set environment variables
|
|
|
|
set(METIN2_OS_NAME ${CMAKE_SYSTEM})
|
2022-03-21 10:27:28 +02:00
|
|
|
set(METIN2_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
|
2022-03-05 12:44:06 +02:00
|
|
|
set(METIN2_CPU_TARGET ${CMAKE_SYSTEM_PROCESSOR})
|
|
|
|
|
|
|
|
# Git revision
|
2023-12-10 10:00:55 +02:00
|
|
|
find_package(GitInfo)
|
2022-03-05 12:44:06 +02:00
|
|
|
|
2022-03-21 10:27:28 +02:00
|
|
|
if(GIT_FOUND)
|
|
|
|
GIT_WC_INFO(${PROJECT_SOURCE_DIR} Metin2)
|
2023-12-10 10:00:55 +02:00
|
|
|
set(METIN2_REVISION ${Metin2_WC_REVISION_HASH})
|
2022-03-21 10:27:28 +02:00
|
|
|
set(METIN2_LAST_CHANGED_DATE ${Metin2_WC_LAST_CHANGED_DATE})
|
|
|
|
|
2023-12-10 10:00:55 +02:00
|
|
|
if (Metin2_WC_LATEST_TAG)
|
2022-03-21 10:27:28 +02:00
|
|
|
set(METIN2_LATEST_TAG ${Metin2_WC_LATEST_TAG})
|
|
|
|
else()
|
|
|
|
set(METIN2_LATEST_TAG "unknown")
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(METIN2_REVISION "unknown")
|
|
|
|
set(METIN2_LAST_CHANGED_DATE "\"unknown\"")
|
|
|
|
set(METIN2_LATEST_TAG "unknown")
|
|
|
|
endif()
|
2022-03-05 12:44:06 +02:00
|
|
|
|
|
|
|
message(STATUS "Current revision is ${METIN2_REVISION}")
|
|
|
|
|
2022-03-21 10:27:28 +02:00
|
|
|
# Generate the version header
|
2023-12-04 21:54:28 +02:00
|
|
|
configure_file(
|
|
|
|
"src/common/version.h.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/common/version.h"
|
2022-03-21 10:27:28 +02:00
|
|
|
)
|
|
|
|
include_directories(${PROJECT_BINARY_DIR}/common/)
|
|
|
|
|
2022-03-05 12:44:06 +02:00
|
|
|
# Set the global include directories
|
2023-12-04 21:54:28 +02:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
|
2022-03-05 12:44:06 +02:00
|
|
|
|
2023-12-04 21:54:28 +02:00
|
|
|
add_subdirectory(src/libgame)
|
|
|
|
add_subdirectory(src/liblua)
|
|
|
|
add_subdirectory(src/libpoly)
|
|
|
|
add_subdirectory(src/libsql)
|
|
|
|
add_subdirectory(src/libthecore)
|
|
|
|
add_subdirectory(src/game)
|
|
|
|
add_subdirectory(src/db)
|
|
|
|
add_subdirectory(src/quest)
|