Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d8bd049352b8
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7a0327e7e906
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Oct 1, 2020

  1. Copy the full SHA
    efc55ce View commit details
  2. Merge pull request #207 from tarunik/about-version

    Add Git hash/version support to the CMakeLists.txt. Fixes #206.
    azonenberg authored Oct 1, 2020
    Copy the full SHA
    7a0327e View commit details
Showing with 19 additions and 1 deletion.
  1. +16 −0 src/glscopeclient/CMakeLists.txt
  2. +2 −1 src/glscopeclient/OscilloscopeWindow.cpp
  3. +1 −0 src/glscopeclient/glscopeclient-version.h.in
16 changes: 16 additions & 0 deletions src/glscopeclient/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
find_package(GLEW REQUIRED)
find_package(OpenGL REQUIRED)

# Git is used for git-describe based version generation if we have it
find_package(Git)

# Additional libraries on Windows
if(WIN32)
set(WIN_LIBS shlwapi)
@@ -14,6 +17,19 @@ endif()
include_directories(${GTKMM_INCLUDE_DIRS} ${SIGCXX_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS})
link_directories(${GTKMM_LIBRARY_DIRS} ${SIGCXX_LIBRARY_DIRS})

#Set up versioning (with a dummy string for now if Git isn't present)
if(Git_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --tags
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GLSCOPECLIENT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
set(GLSCOPECLIENT_VERSION "v0.1-unknown")
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
configure_file(glscopeclient-version.h.in glscopeclient-version.h)

###############################################################################
#C++ compilation
add_executable(glscopeclient
3 changes: 2 additions & 1 deletion src/glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
*/

#include "glscopeclient.h"
#include "glscopeclient-version.h"
#include "../scopehal/Instrument.h"
#include "../scopehal/MockOscilloscope.h"
#include "OscilloscopeWindow.h"
@@ -2566,7 +2567,7 @@ void OscilloscopeWindow::OnAboutDialog()
Gtk::AboutDialog aboutDialog;

aboutDialog.set_logo_default();
aboutDialog.set_version("0.1"); // TODO: CMakeLists trickery for versioning?
aboutDialog.set_version(GLSCOPECLIENT_VERSION);
aboutDialog.set_copyright("Copyright © 2012-2020 Andrew D. Zonenberg");
aboutDialog.set_license(
"Redistribution and use in source and binary forms, with or without modification, "
1 change: 1 addition & 0 deletions src/glscopeclient/glscopeclient-version.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define GLSCOPECLIENT_VERSION "@GLSCOPECLIENT_VERSION@"