diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index df71410fb..25887a0e6 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -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 diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 3919419be..258e777aa 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -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) #----------------------------------------------------------------------------- diff --git a/code/nel/include/nel/misc/CMakeLists.txt b/code/nel/include/nel/misc/CMakeLists.txt index 4b77b813f..85d8914f5 100644 --- a/code/nel/include/nel/misc/CMakeLists.txt +++ b/code/nel/include/nel/misc/CMakeLists.txt @@ -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) diff --git a/code/nel/include/nel/misc/version_nl.cmake b/code/nel/include/nel/misc/version_nl.cmake new file mode 100644 index 000000000..2e650486e --- /dev/null +++ b/code/nel/include/nel/misc/version_nl.cmake @@ -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