Changed: Improve versioning info for resources

This commit is contained in:
kaetemi 2019-05-11 05:56:18 +08:00
parent 0676cd0d2b
commit 5baa32790f
7 changed files with 92 additions and 65 deletions

View file

@ -37,15 +37,25 @@ MACRO(NL_CONFIGURE_CHECKS)
SET(RYZOM_VERSION_PATCH ${NL_VERSION_PATCH})
ENDIF()
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}")
IF(DESCRIBE)
SET(NL_VERSION "${DESCRIBE}")
ELSE()
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}")
ENDIF()
SET(NL_VERSION_RC "${NL_VERSION_MAJOR},${NL_VERSION_MINOR},${NL_VERSION_PATCH},${REVISION}")
SET(NL_PRODUCT_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
SET(RYZOM_VERSION_SHORT "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}")
SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}")
IF(DESCRIBE)
SET(RYZOM_VERSION "${DESCRIBE}")
ELSE()
SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}")
ENDIF()
SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}")
SET(RYZOM_PRODUCT_VERSION "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}")
NOW(BUILD_DATE)
SET(COPYRIGHT "${YEAR} ${AUTHOR}")
SET(COPYRIGHT "Copyright (C) ${YEAR} ${AUTHOR}")
IF(NOT RYZOM_CLIENT_ICON)
SET(RYZOM_CLIENT_ICON "ryzom_client")

View file

@ -81,25 +81,33 @@ IF(EXISTS "${ROOT_DIR}/.git/")
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE REVISION)
IF(NOT ${git_exit_code} EQUAL 0)
message(WARNING "git rev-list failed, unable to include version.")
MESSAGE(WARNING "git rev-list failed, unable to include version.")
ENDIF()
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short=8 HEAD
WORKING_DIRECTORY ${ROOT_DIR}
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE CHANGESET)
IF(NOT ${git_exit_code} EQUAL 0)
message(WARNING "git rev-parse failed, unable to include version.")
MESSAGE(WARNING "git rev-parse failed, unable to include version.")
ENDIF()
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${ROOT_DIR}
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE BRANCH)
IF(NOT ${git_exit_code} EQUAL 0)
message(WARNING "git rev-parse failed, unable to include git branch.")
MESSAGE(WARNING "git rev-parse failed, unable to include git branch.")
ENDIF()
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe
WORKING_DIRECTORY ${ROOT_DIR}
RESULT_VARIABLE git_exit_code
OUTPUT_VARIABLE DESCRIBE)
IF(NOT ${git_exit_code} EQUAL 0)
MESSAGE(WARNING "git rev-parse failed, unable to include git branch.")
ENDIF()
STRING(STRIP ${REVISION} REVISION)
STRING(STRIP ${CHANGESET} CHANGESET)
STRING(STRIP ${BRANCH} BRANCH)
STRING(STRIP ${DESCRIBE} DESCRIBE)
ENDIF()
ENDIF()

View file

@ -27,9 +27,12 @@
#cmakedefine NL_VERSION "${NL_VERSION}"
#cmakedefine NL_VERSION_RC ${NL_VERSION_RC}
#cmakedefine NL_PRODUCT_VERSION "${NL_PRODUCT_VERSION}"
#cmakedefine RYZOM_VERSION "${RYZOM_VERSION}"
#cmakedefine RYZOM_VERSION_RC ${RYZOM_VERSION_RC}
#cmakedefine RYZOM_PRODUCT_VERSION "${RYZOM_PRODUCT_VERSION}"
#cmakedefine AUTHOR "${AUTHOR}"
#cmakedefine YEAR "${YEAR}"
#cmakedefine COPYRIGHT "${COPYRIGHT}"

View file

@ -2,6 +2,7 @@
#define NL_VERSION_H
#define NL_VERSION "${NL_VERSION}"
#define NL_PRODUCT_VERSION "${NL_PRODUCT_VERSION}"
#define NL_VERSION_MAJOR ${NL_VERSION_MAJOR}
#define NL_VERSION_MINOR ${NL_VERSION_MINOR}
#define NL_VERSION_PATCH ${NL_VERSION_PATCH}

View file

@ -1,6 +1,8 @@
FILE(GLOB SRC *.cpp *.h ../../ig_lighter_lib/*.cpp ../../ig_lighter_lib/*.h)
FILE(GLOB SRC *.cpp *.h ../../ig_lighter_lib/*.cpp ../../ig_lighter_lib/*.h *.rc *.rc2)
ADD_LIBRARY(ligoscape_utility SHARED ligoscape_utility.rc ${SRC} ligoscape_utility.def)
SOURCE_GROUP("" FILES ${SRC})
ADD_LIBRARY(ligoscape_utility SHARED ${SRC} ligoscape_utility.def)
INCLUDE_DIRECTORIES(${MAXSDK_INCLUDE_DIR})

View file

@ -1,4 +1,4 @@
//Microsoft Developer Studio generated resource script.
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
@ -7,19 +7,17 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "windows.h"
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
// English resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
@ -27,76 +25,32 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
3 TEXTINCLUDE
BEGIN
"\r\n"
"#include ""version.rc2""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,0,0
PRODUCTVERSION 3,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileVersion", "3.0.0.0\0"
VALUE "InternalName", "Ligoscape\0"
VALUE "LegalCopyright", "\0"
VALUE "OriginalFilename", "Ligoscape.dlu\0"
VALUE "ProductName", "3D Studio MAX\0"
VALUE "ProductVersion", "3.0.0.0\0"
VALUE "FileDescription", "NeL Ligoscape utility\0"
VALUE "Comments", "TECH: \0"
VALUE "LegalTrademarks", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
STRINGTABLE
BEGIN
IDS_LIBDESCRIPTION "NeL Ligoscape utility"
IDS_CATEGORY "NeL Tools"
@ -105,7 +59,7 @@ BEGIN
IDS_SPIN "Spin"
END
#endif // English (U.S.) resources
#endif // English resources
/////////////////////////////////////////////////////////////////////////////
@ -115,7 +69,7 @@ END
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "version.rc2"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -0,0 +1,49 @@
#ifndef NL_VERSION_RC2
#define NL_VERSION_RC2
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
#pragma code_page(65001)
#include <windows.h>
#include "config.h"
#include "maxversion.h"
#define STRINGIFY_(x) #x
#define STRINGIFY(x) STRINGIFY_(x)
VS_VERSION_INFO VERSIONINFO
FILEVERSION NL_VERSION_RC
PRODUCTVERSION NL_VERSION_RC
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "NeL is provided under the AGPLv3 with a linking exception for the 3ds Max SDK"
VALUE "CompanyName", AUTHOR
VALUE "FileDescription", "NeL Ligoscape utility"
VALUE "FileVersion", NL_VERSION
VALUE "LegalCopyright", COPYRIGHT
VALUE "OriginalFilename", "ligoscape.dlu"
VALUE "ProductName", "NeL Plugins for 3ds Max " STRINGIFY(MAX_PRODUCT_YEAR_NUMBER)
VALUE "ProductVersion", NL_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x9, 1200
END
END
#endif /* #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) */
#endif /* #ifndef NL_VERSION_RC2 */