Merge branch 'develop' of https://git.khaganat.net/khaganat/mmorpg_khanat/khanat-opennel-code into develop
This commit is contained in:
commit
73ea688f68
3 changed files with 230 additions and 88 deletions
|
@ -39,6 +39,7 @@ Linux client build:
|
||||||
stage: build
|
stage: build
|
||||||
except:
|
except:
|
||||||
- ryzomcore
|
- ryzomcore
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: debian:jessie
|
image: debian:jessie
|
||||||
|
@ -88,6 +89,8 @@ Linux client build:
|
||||||
|
|
||||||
Linux server debian_amd64_strech build:
|
Linux server debian_amd64_strech build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: amd64/debian:9
|
image: amd64/debian:9
|
||||||
|
@ -169,6 +172,8 @@ Linux server debian_amd64_strech build:
|
||||||
|
|
||||||
Linux client debian_amd64_strech build:
|
Linux client debian_amd64_strech build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: amd64/debian:9
|
image: amd64/debian:9
|
||||||
|
@ -229,6 +234,8 @@ Linux client debian_amd64_strech build:
|
||||||
|
|
||||||
Linux client_static debian_amd64_strech build:
|
Linux client_static debian_amd64_strech build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: amd64/debian:9
|
image: amd64/debian:9
|
||||||
|
@ -335,6 +342,8 @@ Linux client_static debian_amd64_strech build:
|
||||||
# Fedora Client
|
# Fedora Client
|
||||||
Linux client fedora_amd64_27 build:
|
Linux client fedora_amd64_27 build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: amd64/fedora:27
|
image: amd64/fedora:27
|
||||||
|
@ -395,6 +404,8 @@ Linux client fedora_amd64_27 build:
|
||||||
# Ubuntu Client
|
# Ubuntu Client
|
||||||
Linux client ubuntu_amd64_17_10 build:
|
Linux client ubuntu_amd64_17_10 build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: amd64/ubuntu:17.10
|
image: amd64/ubuntu:17.10
|
||||||
|
@ -450,6 +461,8 @@ Linux client ubuntu_amd64_17_10 build:
|
||||||
# Archlinux Client
|
# Archlinux Client
|
||||||
Linux client archlinux build:
|
Linux client archlinux build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: base/archlinux
|
image: base/archlinux
|
||||||
|
@ -544,6 +557,8 @@ Linux client archlinux build:
|
||||||
|
|
||||||
Windows client build:
|
Windows client build:
|
||||||
stage: build
|
stage: build
|
||||||
|
except:
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: amd64/debian:9
|
image: amd64/debian:9
|
||||||
|
@ -585,8 +600,12 @@ OSX client build:
|
||||||
stage: build
|
stage: build
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- OSX
|
- OSX
|
||||||
|
variables:
|
||||||
|
# Éviter de cloner tout le dépot à chaque fois, à la place juste récuperer les changements
|
||||||
|
GIT_STRATEGY: fetch
|
||||||
script:
|
script:
|
||||||
# Création de l'environnement de compilation
|
# Création de l'environnement de compilation
|
||||||
- mkdir -p BUILD/x86_64
|
- mkdir -p BUILD/x86_64
|
||||||
|
@ -607,6 +626,7 @@ Linux client test:
|
||||||
stage: test
|
stage: test
|
||||||
except:
|
except:
|
||||||
- ryzomcore
|
- ryzomcore
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- Docker
|
- Docker
|
||||||
image: ubuntu:14.04
|
image: ubuntu:14.04
|
||||||
|
@ -618,8 +638,9 @@ Linux client test:
|
||||||
|
|
||||||
.OSX client test:
|
.OSX client test:
|
||||||
stage: test
|
stage: test
|
||||||
except:
|
only:
|
||||||
- ryzomcore
|
- tags
|
||||||
|
- mac-ci-build
|
||||||
tags:
|
tags:
|
||||||
- OSX
|
- OSX
|
||||||
script:
|
script:
|
||||||
|
|
106
code/CMakeModules/FindGit.cmake
Normal file
106
code/CMakeModules/FindGit.cmake
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
|
||||||
|
#.rst:
|
||||||
|
# FindGit
|
||||||
|
# -------
|
||||||
|
#
|
||||||
|
# The module defines the following variables:
|
||||||
|
#
|
||||||
|
# ``GIT_EXECUTABLE``
|
||||||
|
# Path to Git command-line client.
|
||||||
|
# ``Git_FOUND``, ``GIT_FOUND``
|
||||||
|
# True if the Git command-line client was found.
|
||||||
|
# ``GIT_VERSION_STRING``
|
||||||
|
# The version of Git found.
|
||||||
|
#
|
||||||
|
# Example usage:
|
||||||
|
#
|
||||||
|
# .. code-block:: cmake
|
||||||
|
#
|
||||||
|
# find_package(Git)
|
||||||
|
# if(Git_FOUND)
|
||||||
|
# message("Git found: ${GIT_EXECUTABLE}")
|
||||||
|
# endif()
|
||||||
|
|
||||||
|
# Look for 'git' or 'eg' (easy git)
|
||||||
|
#
|
||||||
|
set(git_names git eg)
|
||||||
|
|
||||||
|
# Prefer .cmd variants on Windows unless running in a Makefile
|
||||||
|
# in the MSYS shell.
|
||||||
|
#
|
||||||
|
if(CMAKE_HOST_WIN32)
|
||||||
|
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
||||||
|
set(git_names git.cmd git eg.cmd eg)
|
||||||
|
# GitHub search path for Windows
|
||||||
|
file(GLOB github_path
|
||||||
|
"$ENV{LOCALAPPDATA}/Github/PortableGit*/cmd"
|
||||||
|
"$ENV{LOCALAPPDATA}/Github/PortableGit*/bin"
|
||||||
|
)
|
||||||
|
# SourceTree search path for Windows
|
||||||
|
set(_git_sourcetree_path "$ENV{LOCALAPPDATA}/Atlassian/SourceTree/git_local/bin")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# First search the PATH and specific locations.
|
||||||
|
find_program(GIT_EXECUTABLE
|
||||||
|
NAMES ${git_names}
|
||||||
|
PATHS ${github_path} ${_git_sourcetree_path}
|
||||||
|
DOC "Git command line client"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CMAKE_HOST_WIN32)
|
||||||
|
# Now look for installations in Git/ directories under typical installation
|
||||||
|
# prefixes on Windows. Exclude PATH from this search because VS 2017's
|
||||||
|
# command prompt happens to have a PATH entry with a Git/ subdirectory
|
||||||
|
# containing a minimal git not meant for general use.
|
||||||
|
find_program(GIT_EXECUTABLE
|
||||||
|
NAMES ${git_names}
|
||||||
|
PATH_SUFFIXES Git/cmd Git/bin
|
||||||
|
NO_SYSTEM_ENVIRONMENT_PATH
|
||||||
|
DOC "Git command line client"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(GIT_EXECUTABLE)
|
||||||
|
|
||||||
|
MACRO(Git_WC_INFO dir prefix)
|
||||||
|
EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} log -r --pretty=format:"%d;%H;%an" .
|
||||||
|
WORKING_DIRECTORY ${dir}
|
||||||
|
OUTPUT_VARIABLE ${prefix}_WC_INFO
|
||||||
|
ERROR_VARIABLE Git_info_error
|
||||||
|
RESULT_VARIABLE Git_info_result
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
IF(NOT ${Git_info_result} EQUAL 0)
|
||||||
|
MESSAGE(SEND_ERROR "Command \"${GIT_EXECUTABLE} log\" failed with output:\n${Git_info_error}")
|
||||||
|
ELSE()
|
||||||
|
LIST(LENGTH ${prefix}_WC_INFO _COUNT)
|
||||||
|
IF(_COUNT EQUAL 4)
|
||||||
|
LIST(GET ${prefix}_WC_INFO 0 ${prefix}_WC_REVISION)
|
||||||
|
LIST(GET ${prefix}_WC_INFO 1 ${prefix}_WC_CHANGESET)
|
||||||
|
LIST(GET ${prefix}_WC_INFO 3 ${prefix}_WC_LAST_CHANGED_AUTHOR)
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(STATUS "Bad output from HG")
|
||||||
|
SET(${prefix}_WC_REVISION "unknown")
|
||||||
|
SET(${prefix}_WC_CHANGESET "unknown")
|
||||||
|
SET(${prefix}_WC_BRANCH "unknown")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ENDMACRO()
|
||||||
|
|
||||||
|
unset(git_names)
|
||||||
|
unset(_git_sourcetree_path)
|
||||||
|
|
||||||
|
if(GIT_EXECUTABLE)
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} --version
|
||||||
|
OUTPUT_VARIABLE git_version
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if (git_version MATCHES "^git version [0-9]")
|
||||||
|
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
|
||||||
|
endif()
|
||||||
|
unset(git_version)
|
||||||
|
endif()
|
|
@ -1,86 +1,101 @@
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
|
||||||
|
|
||||||
# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
|
# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
|
||||||
# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
|
# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
|
||||||
# BINARY_DIR should be set to root of your build directory
|
# BINARY_DIR should be set to root of your build directory
|
||||||
|
|
||||||
IF(SOURCE_DIR)
|
IF(SOURCE_DIR)
|
||||||
# Replace spaces by semi-columns
|
# Replace spaces by semi-columns
|
||||||
IF(CMAKE_MODULE_PATH)
|
IF(CMAKE_MODULE_PATH)
|
||||||
STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
|
SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
|
||||||
|
|
||||||
IF(NOT ROOT_DIR AND SOURCE_DIR)
|
IF(NOT ROOT_DIR AND SOURCE_DIR)
|
||||||
SET(ROOT_DIR ${SOURCE_DIR})
|
SET(ROOT_DIR ${SOURCE_DIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT SOURCE_DIR AND ROOT_DIR)
|
IF(NOT SOURCE_DIR AND ROOT_DIR)
|
||||||
SET(SOURCE_DIR ${ROOT_DIR})
|
SET(SOURCE_DIR ${ROOT_DIR})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||||
SET(ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
|
SET(ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
|
||||||
|
|
||||||
# convert ROOT_DIR to absolute path
|
# convert ROOT_DIR to absolute path
|
||||||
GET_FILENAME_COMPONENT(ROOT_DIR ${ROOT_DIR} ABSOLUTE)
|
GET_FILENAME_COMPONENT(ROOT_DIR ${ROOT_DIR} ABSOLUTE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
MACRO(NOW RESULT)
|
MACRO(NOW RESULT)
|
||||||
IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
|
IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
|
||||||
STRING(TIMESTAMP ${RESULT} "%Y-%m-%d %H:%M:%S")
|
STRING(TIMESTAMP ${RESULT} "%Y-%m-%d %H:%M:%S")
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
|
EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
|
||||||
IF(NOT DATETIME MATCHES "ERROR")
|
IF(NOT DATETIME MATCHES "ERROR")
|
||||||
STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
|
STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ELSEIF(UNIX)
|
ELSEIF(UNIX)
|
||||||
EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME)
|
EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME)
|
||||||
STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
|
STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(SEND_ERROR "date not implemented")
|
MESSAGE(SEND_ERROR "date not implemented")
|
||||||
SET(${RESULT} "0000-00-00 00:00:00")
|
SET(${RESULT} "0000-00-00 00:00:00")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDMACRO()
|
ENDMACRO()
|
||||||
|
|
||||||
IF(EXISTS "${ROOT_DIR}/.svn/")
|
IF(EXISTS "${ROOT_DIR}/.svn/")
|
||||||
FIND_PACKAGE(Subversion QUIET)
|
FIND_PACKAGE(Subversion QUIET)
|
||||||
|
|
||||||
IF(SUBVERSION_FOUND)
|
IF(SUBVERSION_FOUND)
|
||||||
Subversion_WC_INFO(${ROOT_DIR} ER)
|
Subversion_WC_INFO(${ROOT_DIR} ER)
|
||||||
SET(REVISION ${ER_WC_REVISION})
|
SET(REVISION ${ER_WC_REVISION})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
FIND_PACKAGE(TortoiseSVN QUIET)
|
FIND_PACKAGE(TortoiseSVN QUIET)
|
||||||
|
|
||||||
IF(TORTOISESVN_FOUND)
|
IF(TORTOISESVN_FOUND)
|
||||||
TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION)
|
TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(EXISTS "${ROOT_DIR}/.hg/")
|
IF(EXISTS "${ROOT_DIR}/.hg/")
|
||||||
FIND_PACKAGE(Mercurial)
|
FIND_PACKAGE(Mercurial)
|
||||||
|
|
||||||
IF(MERCURIAL_FOUND)
|
IF(MERCURIAL_FOUND)
|
||||||
Mercurial_WC_INFO(${ROOT_DIR} ER)
|
Mercurial_WC_INFO(${ROOT_DIR} ER)
|
||||||
SET(REVISION ${ER_WC_REVISION})
|
SET(REVISION ${ER_WC_REVISION})
|
||||||
SET(CHANGESET ${ER_WC_CHANGESET})
|
SET(CHANGESET ${ER_WC_CHANGESET})
|
||||||
SET(BRANCH ${ER_WC_BRANCH})
|
SET(BRANCH ${ER_WC_BRANCH})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# if processing exported sources, use "revision" file if exists
|
IF(EXISTS "${ROOT_DIR}/.git/")
|
||||||
IF(SOURCE_DIR AND NOT DEFINED REVISION)
|
FIND_PACKAGE(Git)
|
||||||
SET(REVISION_FILE ${SOURCE_DIR}/revision)
|
|
||||||
IF(EXISTS ${REVISION_FILE})
|
IF(GIT_FOUND)
|
||||||
FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1)
|
Git_WC_INFO(${ROOT_DIR} ER)
|
||||||
MESSAGE(STATUS "Read revision ${REVISION} from file")
|
SET(REVISION ${ER_WC_REVISION})
|
||||||
ENDIF()
|
SET(CHANGESET ${ER_WC_CHANGESET})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
IF(DEFINED REVISION)
|
|
||||||
MESSAGE(STATUS "Found revision ${REVISION}")
|
# if processing exported sources, use "revision" file if exists
|
||||||
ENDIF()
|
IF(SOURCE_DIR AND NOT DEFINED REVISION)
|
||||||
|
SET(REVISION_FILE ${SOURCE_DIR}/revision)
|
||||||
|
IF(EXISTS ${REVISION_FILE})
|
||||||
|
FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1)
|
||||||
|
MESSAGE(STATUS "Read revision ${REVISION} from file")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Prevent crash if no revision from git or mercurial found
|
||||||
|
IF(NOT DEFINED REVISION)
|
||||||
|
SET(REVISION 0)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(DEFINED REVISION)
|
||||||
|
MESSAGE(STATUS "Found revision ${REVISION}")
|
||||||
|
ENDIF()
|
||||||
|
|
Loading…
Reference in a new issue