From 46b295c67b42fda8eabc0cc4a2e7c9ee365b8ccb Mon Sep 17 00:00:00 2001 From: Sergey Yagovtsev Date: Wed, 16 Nov 2016 23:58:47 +0300 Subject: [PATCH] Prepare for release. Add rc-files and read version info from file --- CMakeLists.txt | 68 ++++++++++++------------------------- profiler_gui/CMakeLists.txt | 21 ------------ profiler_gui/main.cpp | 6 ++-- profiler_gui/resources.rc | 26 +++++++++++++- src/CMakeLists.txt | 22 +----------- src/event_trace_win.h | 28 +++++++-------- src/resources.rc | 22 ++++++++++++ version.info | 1 + 8 files changed, 87 insertions(+), 107 deletions(-) create mode 100644 src/resources.rc create mode 100644 version.info diff --git a/CMakeLists.txt b/CMakeLists.txt index e96905b..bc40abe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,27 @@ set( ${CMAKE_CURRENT_LIST_DIR} ) + +file (STRINGS ${ROOT}/version.info PRODUCT_VERSION_STRING) +string(REPLACE "." ";" VERSION_LIST ${PRODUCT_VERSION_STRING}) + +list(GET VERSION_LIST 0 PROGRAM_VERSION_MAJOR) +list(GET VERSION_LIST 1 PROGRAM_VERSION_MINOR) +list(GET VERSION_LIST 2 PROGRAM_VERSION_PATCH) + +message(STATUS "PROGRAM_VERSION_MAJOR: ${PROGRAM_VERSION_MAJOR}") +message(STATUS "PROGRAM_VERSION_MINOR: ${PROGRAM_VERSION_MINOR}") +message(STATUS "PROGRAM_VERSION_PATCH: ${PROGRAM_VERSION_PATCH}") + +# EasyProfiler version +add_definitions( + -DEASY_VERSION_MAJOR=${PROGRAM_VERSION_MAJOR} + -DEASY_VERSION_MINOR=${PROGRAM_VERSION_MINOR} + -DEASY_VERSION_REV=${PROGRAM_VERSION_PATCH} + -DPRODUCT_VERSION=\"v${PRODUCT_VERSION_STRING}\" +) +# EasyProfiler version + set(OUTPUT_DIR ${ROOT}/bin ) @@ -43,50 +64,3 @@ add_subdirectory(src) add_subdirectory(sample) add_subdirectory(reader) add_subdirectory(profiler_gui) - -install(FILES -LICENSE.APACHE -LICENSE.GPL3 -DESTINATION . -) - -set(CPACK_PACKAGE_NAME "easy_profiler") -set(CPACK_PACKAGE_RELEASE 1) -set(CPACK_PACKAGE_CONTACT "Easy Profiler Team") -set(CPACK_PACKAGE_VENDOR "Easy Profiler Team") - -if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) - set(PLATFORM_SUFFIX x64) -else() - set(PLATFORM_SUFFIX x86) -endif(${CMAKE_SIZEOF_VOID_P} EQUAL 8) - -if(UNIX) - - execute_process( COMMAND ldd --version - OUTPUT_VARIABLE LDD_OUT ) - - if(LDD_OUT) - string( REGEX MATCH "^ldd.*[0-9][.][0-9][0-9]?" LDD_VERSION_STRING ${LDD_OUT} ) - endif(LDD_OUT) - - if( LDD_VERSION_STRING ) - string( REGEX MATCH "[0-9][.][0-9][0-9]?" LIBC_VERSION ${LDD_VERSION_STRING} ) - endif( LDD_VERSION_STRING ) - - - if(LIBC_VERSION) - set(CPACK_SYSTEM_NAME "linux_${PLATFORM_SUFFIX}-libc_${LIBC_VERSION}") - endif(LIBC_VERSION) - - - set(CPACK_GENERATOR "TGZ") -else() - set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP "TRUE") - include(InstallRequiredSystemLibraries) - - set(CPACK_GENERATOR "ZIP") -endif(UNIX) - -set(CPACK_PACKAGE_VERSION "v1.0.0") -include(CPack) diff --git a/profiler_gui/CMakeLists.txt b/profiler_gui/CMakeLists.txt index f652659..15424ef 100644 --- a/profiler_gui/CMakeLists.txt +++ b/profiler_gui/CMakeLists.txt @@ -48,24 +48,3 @@ if(UNIX) endif(UNIX) target_link_libraries(${PROJECT_NAME} Qt5::Widgets Qt5::Network easy_profiler ${SPECIAL_LIB}) - -install(TARGETS ${PROJECT_NAME} - DESTINATION bin - COMPONENT binaries -) - -get_target_property(QtCore_location Qt5::Core LOCATION) -get_target_property(QtWidgets_location Qt5::Widgets LOCATION) -get_target_property(QtNetwork_location Qt5::Network LOCATION) -get_target_property(QtGui_location Qt5::Gui LOCATION) -get_target_property(QtSvg_location Qt5::Svg LOCATION) - -install(FILES - ${QtCore_location} - ${QtWidgets_location} - ${QtNetwork_location} - ${QtGui_location} - ${QtSvg_location} - DESTINATION bin - COMPONENT binaries -) diff --git a/profiler_gui/main.cpp b/profiler_gui/main.cpp index 5728536..39f900c 100644 --- a/profiler_gui/main.cpp +++ b/profiler_gui/main.cpp @@ -47,9 +47,9 @@ #include "easy/reader.h" -//#ifdef _WIN32 -//#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") -//#endif +#if defined(_WIN32) && defined (_BUILD_RELEASE_) +#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") +#endif int main(int argc, char **argv) { diff --git a/profiler_gui/resources.rc b/profiler_gui/resources.rc index dca7558..52b881e 100644 --- a/profiler_gui/resources.rc +++ b/profiler_gui/resources.rc @@ -1 +1,25 @@ -IDI_ICON1 ICON DISCARDABLE "icons/logo.ico" \ No newline at end of file +IDI_ICON1 ICON DISCARDABLE "icons/logo.ico" +1 VERSIONINFO +FILEVERSION EASY_VERSION_MAJOR, EASY_VERSION_MINOR, EASY_VERSION_REV +PRODUCTVERSION EASY_VERSION_MAJOR, EASY_VERSION_MINOR, EASY_VERSION_REV +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "CompanyName", "EasyProfiler Team" + VALUE "FileDescription", "Gui application for reading easy_profiler capturings" + VALUE "InternalName", "profiler_gui" + VALUE "LegalCopyright", "Copyright 2016 Victor Zarubkin, Sergey Yagovtsev" + VALUE "LegalTrademarks1", "All Rights Reserved" + VALUE "LegalTrademarks2", "All Rights Reserved" + VALUE "OriginalFilename", "profiler_gui.exe" + VALUE "ProductName", "easy_profiler gui application" + VALUE "ProductVersion", PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8445d16..a722d56 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,13 +1,5 @@ project(easy_profiler) -# EasyProfiler version -add_definitions( - -DEASY_VERSION_MAJOR=1 - -DEASY_VERSION_MINOR=0 - -DEASY_VERSION_REV=0 -) -# EasyProfiler version - set(CPP_FILES block.cpp profile_manager.cpp @@ -42,22 +34,10 @@ add_definitions( ) endif(WIN32) - -add_library(${PROJECT_NAME} SHARED ${SOURCES}) +add_library(${PROJECT_NAME} SHARED ${SOURCES} resources.rc) if(UNIX) set(PLATFORM_LIBS pthread) endif(UNIX) target_link_libraries(${PROJECT_NAME} ${PLATFORM_LIBS}) - -install(TARGETS ${PROJECT_NAME} - DESTINATION bin - COMPONENT sdk -) - -install(DIRECTORY ${ROOT}/include/easy - DESTINATION include/ - COMPONENT sdk - FILES_MATCHING PATTERN "*.h" -) \ No newline at end of file diff --git a/src/event_trace_win.h b/src/event_trace_win.h index b99f8f7..780d52d 100644 --- a/src/event_trace_win.h +++ b/src/event_trace_win.h @@ -1,17 +1,17 @@ -/************************************************************************ -* file name : event_trace_win.h -* ----------------- : -* creation time : 2016/09/04 -* author : Victor Zarubkin -* email : v.s.zarubkin@gmail.com -* ----------------- : -* description : The file contains declaration of EasyEventTracer class used for tracing -* : Windows system events to get context switches. -* ----------------- : -* change log : * 2016/09/04 Victor Zarubkin: initial commit. -* : -* : * -* ----------------- : +/************************************************************************ +* file name : event_trace_win.h +* ----------------- : +* creation time : 2016/09/04 +* author : Victor Zarubkin +* email : v.s.zarubkin@gmail.com +* ----------------- : +* description : The file contains declaration of EasyEventTracer class used for tracing +* : Windows system events to get context switches. +* ----------------- : +* change log : * 2016/09/04 Victor Zarubkin: initial commit. +* : +* : * +* ----------------- : * license : Lightweight profiler library for c++ * : Copyright(C) 2016 Sergey Yagovtsev, Victor Zarubkin * : diff --git a/src/resources.rc b/src/resources.rc new file mode 100644 index 0000000..eebf4dd --- /dev/null +++ b/src/resources.rc @@ -0,0 +1,22 @@ +1 VERSIONINFO +FILEVERSION EASY_VERSION_MAJOR, EASY_VERSION_MINOR, EASY_VERSION_REV +PRODUCTVERSION EASY_VERSION_MAJOR, EASY_VERSION_MINOR, EASY_VERSION_REV +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080904b0" + BEGIN + VALUE "CompanyName", "EasyProfiler Team" + VALUE "FileDescription", "Lightweight profiler library for c++" + VALUE "LegalCopyright", "Copyright 2016 Victor Zarubkin, Sergey Yagovtsev" + VALUE "LegalTrademarks1", "All Rights Reserved" + VALUE "LegalTrademarks2", "All Rights Reserved" + VALUE "ProductName", "easy_profiler lib" + VALUE "ProductVersion", PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x809, 1200 + END +END \ No newline at end of file diff --git a/version.info b/version.info new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/version.info @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file