From 9de76a5a0fb7eb90e469244a4fed32ebed1da954 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Fri, 7 Feb 2020 22:13:18 +0300 Subject: [PATCH] add version to start message --- CMakeLists.txt | 6 +++--- src/CMakeLists.txt | 1 + src/main.cpp | 3 ++- src/project.h | 11 +++++++++++ src/project.h.in | 11 +++++++++++ 5 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 src/project.h create mode 100644 src/project.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 5945163..84d7360 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,9 @@ # Refer to the LICENSE file included. # # libnx CMake template for Nintendo Switch homebrew development. -project(screenuploader) -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.8) +project(screenuploader) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) include(options) @@ -45,7 +45,7 @@ set(APP_AUTHOR "bakatrouble") set(VERSION_MAJOR 0) set(VERSION_MINOR 0) -set(VERSION_MICRO 1) +set(VERSION_MICRO 8) set(APP_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7269f90..24c7126 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,6 @@ set(SOURCE_DIR ${PROJECT_SOURCE_DIR}/src) +configure_file(${SOURCE_DIR}/project.h.in ${SOURCE_DIR}/project.h) file(GLOB SOURCE_FILES RELATIVE ${SOURCE_DIR} "*.c" "*.cc" diff --git a/src/main.cpp b/src/main.cpp index e6fd477..a71569b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include "upload.hpp" #include "utils.hpp" #include "config.hpp" +#include "project.h" using namespace std; @@ -114,7 +115,7 @@ int main(int argc, char **argv) { cerr.rdbuf(log.rdbuf()); cout << "=============================" << endl << endl << endl; - cout << "ScreenUploader is starting..." << endl; + cout << "ScreenUploader v" << APP_VERSION << " is starting..." << endl; Result rc; CapsAlbumStorage storage; diff --git a/src/project.h b/src/project.h new file mode 100644 index 0000000..8635e32 --- /dev/null +++ b/src/project.h @@ -0,0 +1,11 @@ +#ifndef INCLUDE_GUARD +#define INCLUDE_GUARD + +#define APP_TITLE "screenuploader" +#define APP_AUTHOR "bakatrouble" +#define APP_VERSION "0.0.8" +#define VERSION_MAJOR "0" +#define VERSION_MINOR "0" +#define VERSION_MICRO "8" + +#endif // INCLUDE_GUARD diff --git a/src/project.h.in b/src/project.h.in new file mode 100644 index 0000000..caa694f --- /dev/null +++ b/src/project.h.in @@ -0,0 +1,11 @@ +#ifndef INCLUDE_GUARD +#define INCLUDE_GUARD + +#define APP_TITLE "@APP_TITLE@" +#define APP_AUTHOR "@APP_AUTHOR@" +#define APP_VERSION "@APP_VERSION@" +#define VERSION_MAJOR "@VERSION_MAJOR@" +#define VERSION_MINOR "@VERSION_MINOR@" +#define VERSION_MICRO "@VERSION_MICRO@" + +#endif // INCLUDE_GUARD