mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-26 16:11:02 +08:00
Define EASY_PRODUCT_VERSION by concatenating major, minor and patch strings
This commit is contained in:
parent
256f5f6041
commit
cbbf570fae
@ -33,7 +33,7 @@ set(INCLUDE_FILES
|
||||
source_group(include FILES ${INCLUDE_FILES})
|
||||
|
||||
|
||||
if(NOT DEFINED EASY_PRODUCT_VERSION_STRING)
|
||||
if(NOT DEFINED EASY_PROGRAM_VERSION_MAJOR)
|
||||
file (STRINGS ${CMAKE_CURRENT_LIST_DIR}/version.info EASY_PRODUCT_VERSION_STRING)
|
||||
string(REPLACE "." ";" VERSION_LIST ${EASY_PRODUCT_VERSION_STRING})
|
||||
|
||||
@ -50,16 +50,21 @@ if(NOT DEFINED EASY_PRODUCT_VERSION_STRING)
|
||||
-DEASY_PROFILER_VERSION_MAJOR=${EASY_PROGRAM_VERSION_MAJOR}
|
||||
-DEASY_PROFILER_VERSION_MINOR=${EASY_PROGRAM_VERSION_MINOR}
|
||||
-DEASY_PROFILER_VERSION_PATCH=${EASY_PROGRAM_VERSION_PATCH}
|
||||
-DEASY_PROFILER_PRODUCT_VERSION=\"v${EASY_PRODUCT_VERSION_STRING}\"
|
||||
)
|
||||
# EasyProfiler version
|
||||
|
||||
set(EASY_PROGRAM_VERSION_MAJOR ${EASY_PROGRAM_VERSION_MAJOR} PARENT_SCOPE)
|
||||
set(EASY_PROGRAM_VERSION_MINOR ${EASY_PROGRAM_VERSION_MINOR} PARENT_SCOPE)
|
||||
set(EASY_PROGRAM_VERSION_PATCH ${EASY_PROGRAM_VERSION_PATCH} PARENT_SCOPE)
|
||||
set(EASY_PRODUCT_VERSION_STRING ${EASY_PRODUCT_VERSION_STRING} PARENT_SCOPE)
|
||||
|
||||
endif(NOT DEFINED EASY_PRODUCT_VERSION_STRING)
|
||||
endif(NOT DEFINED EASY_PROGRAM_VERSION_MAJOR)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(
|
||||
-D_CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
set(SOURCES
|
||||
${CPP_FILES}
|
||||
|
@ -47,6 +47,7 @@
|
||||
#include "event_trace_win.h"
|
||||
#include "current_time.h"
|
||||
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <signal.h>
|
||||
#endif
|
||||
@ -66,6 +67,10 @@ using namespace profiler;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define EASY_PROFILER_PRODUCT_VERSION "v" EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MAJOR) "." \
|
||||
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MINOR) "." \
|
||||
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_PATCH)
|
||||
|
||||
# define EASY_VERSION_INT(v_major, v_minor, v_patch) ((static_cast<uint32_t>(v_major) << 24) | (static_cast<uint32_t>(v_minor) << 16) | static_cast<uint32_t>(v_patch))
|
||||
extern const uint32_t PROFILER_SIGNATURE = ('E' << 24) | ('a' << 16) | ('s' << 8) | 'y';
|
||||
extern const uint32_t EASY_CURRENT_VERSION = EASY_VERSION_INT(EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH);
|
||||
|
@ -1,4 +1,12 @@
|
||||
1 VERSIONINFO
|
||||
|
||||
# define EASY_STRINGIFY(a) #a
|
||||
# define EASY_STRINGIFICATION(a) EASY_STRINGIFY(a)
|
||||
|
||||
#define EASY_PROFILER_PRODUCT_VERSION "v" EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MAJOR) "." \
|
||||
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MINOR) "." \
|
||||
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_PATCH)
|
||||
|
||||
FILEVERSION EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH
|
||||
PRODUCTVERSION EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH
|
||||
BEGIN
|
||||
|
@ -2,6 +2,14 @@ IDI_ICON1 ICON DISCARDABLE "icons/logo.ico"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH
|
||||
PRODUCTVERSION EASY_PROFILER_VERSION_MAJOR, EASY_PROFILER_VERSION_MINOR, EASY_PROFILER_VERSION_PATCH
|
||||
|
||||
# define EASY_STRINGIFY(a) #a
|
||||
# define EASY_STRINGIFICATION(a) EASY_STRINGIFY(a)
|
||||
|
||||
#define EASY_PROFILER_PRODUCT_VERSION "v" EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MAJOR) "." \
|
||||
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_MINOR) "." \
|
||||
EASY_STRINGIFICATION(EASY_PROFILER_VERSION_PATCH)
|
||||
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
|
Loading…
x
Reference in New Issue
Block a user