Changed: Generate version_nl.h in include/nel/misc

--HG--
branch : develop
This commit is contained in:
kervala 2018-07-28 11:31:32 +02:00
parent 5cb3f8426d
commit 307eb77e63
4 changed files with 29 additions and 4 deletions

View file

@ -86,12 +86,12 @@ NL_SETUP_NELNS_DEFAULT_OPTIONS()
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
#-----------------------------------------------------------------------------
#Platform specifics

View file

@ -374,6 +374,13 @@ MACRO(ADD_PLATFORM_LINKFLAGS _FLAGS)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${_FLAGS}")
ENDMACRO()
MACRO(CONVERT_VERSION_NUMBER _VERSION_NUMBER _BASE)
SET(${_VERSION_NUMBER} 0)
FOREACH(_ARG ${ARGN})
MATH(EXPR ${_VERSION_NUMBER} "${${_VERSION_NUMBER}} * ${_BASE} + ${_ARG}")
ENDFOREACH()
ENDMACRO()
MACRO(NL_SETUP_BUILD)
#-----------------------------------------------------------------------------

View file

@ -1,3 +1,7 @@
CONVERT_VERSION_NUMBER(NL_VERSION_NUM 100 ${NL_VERSION_MAJOR} ${NL_VERSION_MINOR} ${NL_VERSION_PATCH})
CONFIGURE_FILE(version_nl.cmake ${CMAKE_BINARY_DIR}/version_nl.h)
FILE(GLOB HEADERS *.h)
INSTALL(FILES ${HEADERS} DESTINATION include/nel/misc COMPONENT headers)
INSTALL(FILES ${HEADERS} ${CMAKE_BINARY_DIR}/version_nl.h DESTINATION include/nel/misc COMPONENT headers)

View file

@ -0,0 +1,14 @@
#ifndef NL_VERSION_H
#define NL_VERSION_H
#define NL_VERSION "${NL_VERSION}"
#define NL_VERSION_MAJOR ${NL_VERSION_MAJOR}
#define NL_VERSION_MINOR ${NL_VERSION_MINOR}
#define NL_VERSION_PATCH ${NL_VERSION_PATCH}
#define NL_VERSION_NUM ${NL_VERSION_NUM}
#define NL_REVISION ${REVISION}
#define NL_BUILD_DATE "${BUILD_DATE}"
#endif