mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 22:35:52 +08:00
Spit out the result of git rev-parse --short HEAD in AboutDialog.
This commit is contained in:
parent
ac24ab827e
commit
8fb78ca5d7
@ -1,8 +1,12 @@
|
|||||||
cmake_minimum_required (VERSION 3.9)
|
cmake_minimum_required (VERSION 3.9)
|
||||||
project (slic3r)
|
project (slic3r)
|
||||||
|
|
||||||
|
|
||||||
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
# only on newer GCCs: -ftemplate-backtrace-limit=0
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -DM_PI=3.14159265358979323846 -D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DBOOST_ASIO_DISABLE_KQUEUE")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -DM_PI=3.14159265358979323846 -D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DBOOST_ASIO_DISABLE_KQUEUE")
|
||||||
|
|
||||||
|
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE GIT_VERSION)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -DSLIC3R_DEBUG")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -DSLIC3R_DEBUG")
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7.0)
|
||||||
@ -158,6 +162,17 @@ target_link_libraries (slic3r libslic3r admesh BSpline clipper expat polypartiti
|
|||||||
IF(wxWidgets_FOUND)
|
IF(wxWidgets_FOUND)
|
||||||
MESSAGE("wx found!")
|
MESSAGE("wx found!")
|
||||||
INCLUDE("${wxWidgets_USE_FILE}")
|
INCLUDE("${wxWidgets_USE_FILE}")
|
||||||
|
|
||||||
|
if (NOT GIT_VERSION STREQUAL "")
|
||||||
|
if (MSVC)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DSLIC3R_BUILD_COMMIT=${GIT_VERSION} ")
|
||||||
|
else(MSVC)
|
||||||
|
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE GIT_VERSION)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSLIC3R_BUILD_COMMIT=${GIT_VERSION}")
|
||||||
|
string(REGEX REPLACE "\n$" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
endif(MSVC)
|
||||||
|
endif(NOT GIT_VERSION STREQUAL "")
|
||||||
|
|
||||||
include_directories(${GUI_LIBDIR})
|
include_directories(${GUI_LIBDIR})
|
||||||
include_directories(${wxWidgets_INCLUDE})
|
include_directories(${wxWidgets_INCLUDE})
|
||||||
|
|
||||||
|
@ -11,14 +11,19 @@
|
|||||||
#include "libslic3r.h"
|
#include "libslic3r.h"
|
||||||
#include "misc_ui.hpp"
|
#include "misc_ui.hpp"
|
||||||
|
|
||||||
|
|
||||||
#ifndef SLIC3R_BUILD_COMMIT
|
#ifndef SLIC3R_BUILD_COMMIT
|
||||||
#define SLIC3R_BUILD_COMMIT "(Unknown revision)"
|
#define SLIC3R_BUILD_COMMIT "(Unknown revision)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define VER1_(x) #x
|
||||||
|
#define VER_(x) VER1_(x)
|
||||||
|
#define BUILD_COMMIT VER_(SLIC3R_BUILD_COMMIT)
|
||||||
|
|
||||||
namespace Slic3r { namespace GUI {
|
namespace Slic3r { namespace GUI {
|
||||||
|
|
||||||
const wxString build_date {__DATE__};
|
const wxString build_date {__DATE__};
|
||||||
const wxString git_version {SLIC3R_BUILD_COMMIT};
|
const wxString git_version {BUILD_COMMIT};
|
||||||
|
|
||||||
class AboutDialogLogo : public wxPanel {
|
class AboutDialogLogo : public wxPanel {
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user