Added version number and optional build number to build system
parent
f3249b8720
commit
eff3b42cb0
|
@ -5,7 +5,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||
include(cmake/conan.cmake)
|
||||
conan_cmake_run(CONANFILE conanfile.txt
|
||||
BASIC_SETUP
|
||||
BUILD missing)
|
||||
BUILD missing
|
||||
)
|
||||
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
cmake_minimum_required(VERSION 3.6)
|
||||
|
||||
project(ESGRAF48 LANGUAGES CXX)
|
||||
set(BUILD_VERSION_MAJOR_MINOR 0.1)
|
||||
|
||||
if ($ENV{BUILD_NUMBER})
|
||||
set(BUILD_VERSION_PATCH $ENV{BUILD_NUMBER})
|
||||
else()
|
||||
set(BUILD_VERSION_PATCH 0)
|
||||
endif()
|
||||
|
||||
project(ESGRAF48
|
||||
VERSION ${BUILD_VERSION_MAJOR_MINOR}.${BUILD_VERSION_PATCH}
|
||||
DESCRIPTION "ESGRAF 4-8"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
configure_file(
|
||||
version.h.in
|
||||
version.h
|
||||
)
|
||||
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5PrintSupport REQUIRED)
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
#include "mainwindow.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QCoreApplication::setApplicationName("ESGRAF 4-8");
|
||||
QCoreApplication::setApplicationVersion("0.1");
|
||||
QCoreApplication::setApplicationName(ESGRAF48_DESCRIPTION);
|
||||
QCoreApplication::setApplicationVersion(ESGRAF48_VERSION);
|
||||
|
||||
QCommandLineParser cmdParser;
|
||||
cmdParser.setApplicationDescription("ESGRAF 4-8");
|
||||
cmdParser.setApplicationDescription(ESGRAF48_DESCRIPTION);
|
||||
cmdParser.addHelpOption();
|
||||
cmdParser.addVersionOption();
|
||||
cmdParser.addPositionalArgument("filename", "file to open");
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#define ESGRAF48_VERSION "@PROJECT_VERSION@"
|
||||
#define ESGRAF48_DESCRIPTION "@PROJECT_DESCRIPTION@"
|
Loading…
Reference in New Issue