From a6ed27598f0d28d359678f11d39dedf365959ba7 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 29 Nov 2015 14:19:02 +0100 Subject: [PATCH] Changed: Add and use more constants in config.h --- code/CMakeLists.txt | 3 ++- code/CMakeModules/ConfigureChecks.cmake | 23 +++++++++++++++++-- code/config.h.cmake | 14 +++++++++++ .../nel/src/3d/driver/direct3d/CMakeLists.txt | 2 +- code/nel/src/3d/driver/opengl/CMakeLists.txt | 2 +- .../nel/src/3d/driver/opengles/CMakeLists.txt | 2 +- .../src/sound/driver/dsound/CMakeLists.txt | 2 +- code/nel/src/sound/driver/fmod/CMakeLists.txt | 2 +- .../src/sound/driver/openal/CMakeLists.txt | 2 +- .../src/sound/driver/xaudio2/CMakeLists.txt | 2 +- code/ryzom/client/src/CMakeLists.txt | 6 ++--- code/ryzom/client/src/client.rc | 13 ++++++----- code/ryzom/client/src/user_agent.cpp | 14 ++--------- code/ryzom/client/unix/CMakeLists.txt | 12 +++++----- .../ryzom/client/unix/ryzom_client.desktop.in | 2 +- 15 files changed, 63 insertions(+), 38 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 6c4b0bdc1..c7b7ebd5f 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -49,7 +49,8 @@ PROJECT(RyzomCore CXX C) SET(NL_VERSION_MAJOR 0) SET(NL_VERSION_MINOR 12) SET(NL_VERSION_PATCH 0) -SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}") +SET(YEAR "2004-2015") +SET(AUTHOR "Winchgate and The Ryzom Core Community") #----------------------------------------------------------------------------- # Redirect output files diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake index 5ea13e9e1..3929d65c9 100644 --- a/code/CMakeModules/ConfigureChecks.cmake +++ b/code/CMakeModules/ConfigureChecks.cmake @@ -31,7 +31,26 @@ MACRO(NL_CONFIGURE_CHECKS) SET(NL_XAUDIO2_AVAILABLE 1) ENDIF() - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + IF(NOT RYZOM_VERSION_MAJOR) + SET(RYZOM_VERSION_MAJOR ${NL_VERSION_MAJOR}) + SET(RYZOM_VERSION_MINOR ${NL_VERSION_MINOR}) + SET(RYZOM_VERSION_PATCH ${NL_VERSION_PATCH}) + ENDIF() + + SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}") + SET(NL_VERSION_RC "${NL_VERSION_MAJOR},${NL_VERSION_MINOR},${NL_VERSION_PATCH},${REVISION}") + + SET(RYZOM_VERSION "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}.${REVISION}") + SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}") + NOW(BUILD_DATE) + + SET(COPYRIGHT "${YEAR} ${AUTHOR}") + + IF(NOT RYZOM_CLIENT_ICON) + SET(RYZOM_CLIENT_ICON "ryzom_client") + ENDIF() + + CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h) + INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) ADD_DEFINITIONS(-DHAVE_CONFIG_H) ENDMACRO() diff --git a/code/config.h.cmake b/code/config.h.cmake index 55a02b232..2feb8ca7a 100644 --- a/code/config.h.cmake +++ b/code/config.h.cmake @@ -20,4 +20,18 @@ #cmakedefine RYZOM_ETC_PREFIX "${RYZOM_ETC_ABSOLUTE_PREFIX}" #cmakedefine RYZOM_SHARE_PREFIX "${RYZOM_SHARE_ABSOLUTE_PREFIX}" +#cmakedefine REVISION "${REVISION}" +#cmakedefine BUILD_DATE "${BUILD_DATE}" + +#cmakedefine NL_VERSION "${NL_VERSION}" +#cmakedefine NL_VERSION_RC ${NL_VERSION_RC} + +#cmakedefine RYZOM_VERSION "${RYZOM_VERSION}" +#cmakedefine RYZOM_VERSION_RC ${RYZOM_VERSION_RC} +#cmakedefine AUTHOR "${AUTHOR}" +#cmakedefine YEAR "${YEAR}" +#cmakedefine COPYRIGHT "${COPYRIGHT}" + +#cmakedefine RYZOM_CLIENT_ICON "${RYZOM_CLIENT_ICON}" + #endif // CONFIG_H diff --git a/code/nel/src/3d/driver/direct3d/CMakeLists.txt b/code/nel/src/3d/driver/direct3d/CMakeLists.txt index 0ea54cba6..125815dc0 100644 --- a/code/nel/src/3d/driver/direct3d/CMakeLists.txt +++ b/code/nel/src/3d/driver/direct3d/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc) NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC}) diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index a0ea6b5e7..6d8efb929 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -10,7 +10,7 @@ IF(NOT WIN32) ENDIF() ENDIF() -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc) IF(APPLE) FILE(GLOB MAC_SRC mac/*.h mac/*.m mac/*.mm mac/*.cpp) diff --git a/code/nel/src/3d/driver/opengles/CMakeLists.txt b/code/nel/src/3d/driver/opengles/CMakeLists.txt index 27b7f004c..e6d10fae5 100644 --- a/code/nel/src/3d/driver/opengles/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengles/CMakeLists.txt @@ -12,7 +12,7 @@ ENDIF() SET(SOURCE_DIR ${CMAKE_SOURCE_DIR}/nel/src/3d/driver/opengl) -FILE(GLOB SRC ${SOURCE_DIR}/*.cpp ${SOURCE_DIR}/*.h ${SOURCE_DIR}/*.def) +FILE(GLOB SRC ${SOURCE_DIR}/*.cpp ${SOURCE_DIR}/*.h ${SOURCE_DIR}/*.def *.rc) IF(APPLE) FILE(GLOB MAC_SRC ${SOURCE_DIR}/mac/*.h ${SOURCE_DIR}/mac/*.m ${SOURCE_DIR}/mac/*.mm ${SOURCE_DIR}/mac/*.cpp) diff --git a/code/nel/src/sound/driver/dsound/CMakeLists.txt b/code/nel/src/sound/driver/dsound/CMakeLists.txt index 4cff6d996..8eba07fb6 100644 --- a/code/nel/src/sound/driver/dsound/CMakeLists.txt +++ b/code/nel/src/sound/driver/dsound/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc) NL_TARGET_DRIVER(nel_drv_dsound_win ${SRC}) diff --git a/code/nel/src/sound/driver/fmod/CMakeLists.txt b/code/nel/src/sound/driver/fmod/CMakeLists.txt index 859f59751..59cc544c1 100644 --- a/code/nel/src/sound/driver/fmod/CMakeLists.txt +++ b/code/nel/src/sound/driver/fmod/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc) NL_TARGET_DRIVER(nel_drv_fmod_win ${SRC}) diff --git a/code/nel/src/sound/driver/openal/CMakeLists.txt b/code/nel/src/sound/driver/openal/CMakeLists.txt index a862f9c9d..911214a57 100644 --- a/code/nel/src/sound/driver/openal/CMakeLists.txt +++ b/code/nel/src/sound/driver/openal/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc) IF(WIN32) SET(NLDRV_AL_LIB "nel_drv_openal_win") diff --git a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt index 536743e0e..4e2567959 100644 --- a/code/nel/src/sound/driver/xaudio2/CMakeLists.txt +++ b/code/nel/src/sound/driver/xaudio2/CMakeLists.txt @@ -1,4 +1,4 @@ -FILE(GLOB SRC *.cpp *.h *.def) +FILE(GLOB SRC *.cpp *.h *.def *.rc) SOURCE_GROUP(sfx FILES buffer_xaudio2.cpp diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index e9a101945..73122cb64 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -50,11 +50,11 @@ if(APPLE) SET(MACOSX_BUNDLE_INFO_STRING "Ryzom Core Client") SET(MACOSX_BUNDLE_ICON_FILE "ryzom.icns") SET(MACOSX_BUNDLE_GUI_IDENTIFIER "") - SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${NL_VERSION}) + SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${RYZOM_VERSION}) SET(MACOSX_BUNDLE_BUNDLE_NAME "Ryzom Core Client") - SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "0.8") + SET(MACOSX_BUNDLE_SHORT_VERSION_STRING ${RYZOM_VERSION}) SET(MACOSX_BUNDLE_BUNDLE_VERSION "1.0") - SET(MACOSX_BUNDLE_COPYRIGHT "Winchgate and The Ryzom Core Community") + SET(MACOSX_BUNDLE_COPYRIGHT ${COPYRIGHT}) SET(RYZOM_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MACOSX_BUNDLE_BUNDLE_NAME}.app) SET(RYZOM_CONTENTS_DIR ${RYZOM_OUTPUT_DIR}/Contents) SET(RYZOM_RESOURCES_DIR ${RYZOM_CONTENTS_DIR}/Resources) diff --git a/code/ryzom/client/src/client.rc b/code/ryzom/client/src/client.rc index c0f488e80..2b22bf9fe 100644 --- a/code/ryzom/client/src/client.rc +++ b/code/ryzom/client/src/client.rc @@ -8,6 +8,7 @@ // Generated from the TEXTINCLUDE 2 resource. // #include +#include "config.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -165,8 +166,8 @@ IDB_ERROR_LOGO BITMAP DISCARDABLE "error_logo.bmp" ///////////////////////////////////////////////////////////////////////////// VS_VERSION_INFO VERSIONINFO -FILEVERSION 2,1,0 -PRODUCTVERSION 2,1,0 +FILEVERSION RYZOM_VERSION_RC +PRODUCTVERSION NL_VERSION_RC FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG @@ -182,15 +183,15 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "Ryzom client" - VALUE "FileVersion", "2.1.0" - VALUE "LegalCopyright", "Copyright (C) 2004-2015 Winchgate and The Ryzom Core Community" + VALUE "FileVersion", RYZOM_VERSION + VALUE "LegalCopyright", COPYRIGHT #ifdef _DEBUG VALUE "OriginalFilename", "ryzom_client_d.exe" #else VALUE "OriginalFilename", "ryzom_client_r.exe" #endif - VALUE "ProductName", "Ryzom" - VALUE "ProductVersion", "2.1.0" + VALUE "ProductName", "Ryzom Core" + VALUE "ProductVersion", NL_VERSION END END BLOCK "VarFileInfo" diff --git a/code/ryzom/client/src/user_agent.cpp b/code/ryzom/client/src/user_agent.cpp index e1c364eef..e8d4f8708 100644 --- a/code/ryzom/client/src/user_agent.cpp +++ b/code/ryzom/client/src/user_agent.cpp @@ -20,10 +20,8 @@ #include "user_agent.h" #include "client_cfg.h" -#include "game_share/ryzom_version.h" - -#ifdef HAVE_REVISION_H -#include "revision.h" +#ifdef HAVE_CONFIG_H +#include "config.h" #endif #if defined(HAVE_X86_64) @@ -61,11 +59,7 @@ std::string getUserAgentVersion() if (s_userAgent.empty()) { -#ifdef REVISION - s_userAgent = NLMISC::toString("%s.%s-%s-%s", RYZOM_VERSION, REVISION, RYZOM_SYSTEM, RYZOM_ARCH); -#else s_userAgent = NLMISC::toString("%s-%s-%s", RYZOM_VERSION, RYZOM_SYSTEM, RYZOM_ARCH); -#endif } return s_userAgent; @@ -90,10 +84,6 @@ std::string getDisplayVersion() if (ClientCfg.ExtendedCommands) s_version += "_E"; s_version += getVersion(); - -#ifdef REVISION - s_version += NLMISC::toString(".%s", REVISION); -#endif } return s_version; diff --git a/code/ryzom/client/unix/CMakeLists.txt b/code/ryzom/client/unix/CMakeLists.txt index 54f2ed881..8cceef8d1 100644 --- a/code/ryzom/client/unix/CMakeLists.txt +++ b/code/ryzom/client/unix/CMakeLists.txt @@ -3,9 +3,9 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/ryzom_client.desktop.in" "${CMAKE_CU INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/ryzom_client.desktop" DESTINATION share/applications) INSTALL(FILES ryzom_client.png DESTINATION share/pixmaps) INSTALL(FILES ryzom_client.xpm DESTINATION share/pixmaps) -INSTALL(FILES ryzom_16x16.png DESTINATION share/icons/hicolor/16x16/apps RENAME ryzom_client.png) -INSTALL(FILES ryzom_22x22.png DESTINATION share/icons/hicolor/22x22/apps RENAME ryzom_client.png) -INSTALL(FILES ryzom_24x24.png DESTINATION share/icons/hicolor/24x24/apps RENAME ryzom_client.png) -INSTALL(FILES ryzom_32x32.png DESTINATION share/icons/hicolor/32x32/apps RENAME ryzom_client.png) -INSTALL(FILES ryzom_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME ryzom_client.png) -INSTALL(FILES ryzom_128x128.png DESTINATION share/icons/hicolor/128x128/apps RENAME ryzom_client.png) +INSTALL(FILES ryzom_16x16.png DESTINATION share/icons/hicolor/16x16/apps RENAME ${RYZOM_CLIENT_ICON}.png) +INSTALL(FILES ryzom_22x22.png DESTINATION share/icons/hicolor/22x22/apps RENAME ${RYZOM_CLIENT_ICON}.png) +INSTALL(FILES ryzom_24x24.png DESTINATION share/icons/hicolor/24x24/apps RENAME ${RYZOM_CLIENT_ICON}.png) +INSTALL(FILES ryzom_32x32.png DESTINATION share/icons/hicolor/32x32/apps RENAME ${RYZOM_CLIENT_ICON}.png) +INSTALL(FILES ryzom_48x48.png DESTINATION share/icons/hicolor/48x48/apps RENAME ${RYZOM_CLIENT_ICON}.png) +INSTALL(FILES ryzom_128x128.png DESTINATION share/icons/hicolor/128x128/apps RENAME ${RYZOM_CLIENT_ICON}.png) diff --git a/code/ryzom/client/unix/ryzom_client.desktop.in b/code/ryzom/client/unix/ryzom_client.desktop.in index 6520c1039..b42aee5bf 100644 --- a/code/ryzom/client/unix/ryzom_client.desktop.in +++ b/code/ryzom/client/unix/ryzom_client.desktop.in @@ -8,7 +8,7 @@ Comment=Ryzom client Comment[fr_FR]=Client Ryzom TryExec=${RYZOM_GAMES_PREFIX}/ryzom_client Exec=${RYZOM_GAMES_PREFIX}/ryzom_client -Icon=ryzom_client +Icon=${RYZOM_CLIENT_ICON} Terminal=false Hidden=false Categories=Game;RolePlaying;