From 133e36d187c50baa9a963370c82f43b9aa94a458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselme=20FRAN=C3=87OIS?= Date: Sat, 4 Jun 2016 14:47:18 +0200 Subject: [PATCH] added version string --- CMakeLists.txt | 7 +++++++ src/main.cpp | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8fc226..36e24ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ project(PixelWars) cmake_minimum_required(VERSION 2.8) +set(VERSION_MAJOR 1) +set(VERSION_MINOR 0) + # choose source file file(GLOB EXEC_SRC_LIST src/*.cpp) file(GLOB RESOURCES_FILES src/*.h resources.qrc src/*.ui shaders/*.glsl) @@ -22,4 +25,8 @@ set(QT_MODULE core gui widgets opengl) set(CMAKE_TEMPLATE_PATH "../CMakeTemplate") +if(CMAKE_BUILD_TYPE MATCHES "Debug") + add_definitions(-DDEBUG_MODE) +endif() + include(${CMAKE_TEMPLATE_PATH}/template.cmake) diff --git a/src/main.cpp b/src/main.cpp index 4c1847a..dc471c0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,10 +2,13 @@ #include #include #include +#include "Version.h" int main(int argc, char *argv[]) { - +#ifdef DEBUG_MODE + printf("Starting PixelWars %d.%d\n", VERSION_MAJOR, VERSION_MINOR); +#endif QSurfaceFormat format; format.setMinorVersion(3); format.setMajorVersion(3);