Print server version when starting up.

Also added -ldl to fix cmake compilation on Unix systems.
This commit is contained in:
2020-09-16 20:12:12 +02:00
parent f7571607ba
commit efda6673b5
5 changed files with 22 additions and 3 deletions

View File

@@ -3,6 +3,8 @@ project(OpenFusion)
set(CMAKE_CXX_STANDARD 17)
execute_process(COMMAND git describe --tags OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# OpenFusion supports multiple packet/struct versions
# 104 is the default version to build which can be changed
# For example: cmake -B build -DPROTOCOL_VERSION=728
@@ -33,10 +35,14 @@ endif()
include_directories(src)
file(GLOB_RECURSE SOURCES src/**.cpp src/**.hpp src/**.c src/**.h)
file(GLOB_RECURSE SOURCES src/**.cpp src/**.hpp src/**.c src/**.h version.h)
configure_file(version.h.in ${CMAKE_SOURCE_DIR}/version.h @ONLY)
add_executable(openfusion ${SOURCES})
target_link_libraries(openfusion dl)
set_target_properties(openfusion PROPERTIES OUTPUT_NAME ${BIN_NAME})
# Use pthreads if not generating a VS solution or MinGW makefile (because MinGW will prefer Win32 threads)