Skip to content

Instantly share code, notes, and snippets.

View XuToTo's full-sized avatar
☝️
win in action

XuToTo

☝️
win in action
View GitHub Profile
#include "mainwindow.h"
#include <QApplication>
#include "mainwindow.h"
#include <QApplication>
#include <QDesktopWidget>
#include <cstdio>
#include <QMessageBox>
typedef struct{
@XuToTo
XuToTo / CMakeLists.txt
Created August 10, 2020 05:57 — forked from rkitover/CMakeLists.txt
cmake: generate version.h from git
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
INCLUDE(GetGitRevisionDescription)
EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD OUTPUT_VARIABLE SHORT_SHA OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(REVISION ${SHORT_SHA} CACHE STRING "git short sha" FORCE)
# only use the plugin to tie the configure state to the sha to force rebuilds
# of files that depend on version.h
include(GetGitRevisionDescription)