From fd07589ebb0d89162322194e1bf556c7162b7ed7 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sat, 26 Sep 2015 21:12:12 +0200 Subject: [PATCH] Separated config.h and version.h This prevents unnecessary recompilation of some files when version number changes --- src/CMakeLists.txt | 1 + src/app/app.cpp | 2 +- src/app/main.cpp | 1 + src/app/signal_handlers.cpp | 2 +- src/common/config.h.cmake | 5 ----- src/common/version.h.cmake | 6 ++++++ src/ui/screen/screen.cpp | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 src/common/version.h.cmake diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b8d69879..5e445a98 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,6 +54,7 @@ endif() # Configure file configure_file(common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h) +configure_file(common/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/version.h) set(OPENAL_SRC "") diff --git a/src/app/app.cpp b/src/app/app.cpp index 1ab3caa1..502e60a4 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -19,7 +19,7 @@ #include "app/app.h" -#include "common/config.h" +#include "common/version.h" #include "app/controller.h" #include "app/input.h" diff --git a/src/app/main.cpp b/src/app/main.cpp index b732adf1..cf0283ca 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -23,6 +23,7 @@ */ #include "common/config.h" +#include "common/version.h" #include "app/app.h" #include "app/signal_handlers.h" diff --git a/src/app/signal_handlers.cpp b/src/app/signal_handlers.cpp index d2a7bf52..f00a8d84 100644 --- a/src/app/signal_handlers.cpp +++ b/src/app/signal_handlers.cpp @@ -19,7 +19,7 @@ #include "app/signal_handlers.h" -#include "common/config.h" +#include "common/version.h" #include "common/resources/resourcemanager.h" diff --git a/src/common/config.h.cmake b/src/common/config.h.cmake index 05af962f..2d3dbe1e 100644 --- a/src/common/config.h.cmake +++ b/src/common/config.h.cmake @@ -26,10 +26,5 @@ #cmakedefine PORTABLE @PORTABLE@ -#define COLOBOT_FULLNAME "Colobot: Gold Edition @COLOBOT_VERSION_FULL@" -#define COLOBOT_VERSION_DISPLAY "@COLOBOT_VERSION_DISPLAY@" - #define COLOBOT_DEFAULT_DATADIR "@COLOBOT_INSTALL_DATA_DIR@" #define COLOBOT_I18N_DIR "@COLOBOT_INSTALL_I18N_DIR@" - -#define BUILD_NUMBER @BUILD_NUMBER@ diff --git a/src/common/version.h.cmake b/src/common/version.h.cmake new file mode 100644 index 00000000..5749421e --- /dev/null +++ b/src/common/version.h.cmake @@ -0,0 +1,6 @@ +#pragma once + +#define COLOBOT_FULLNAME "Colobot: Gold Edition @COLOBOT_VERSION_FULL@" +#define COLOBOT_VERSION_DISPLAY "@COLOBOT_VERSION_DISPLAY@" + +#define BUILD_NUMBER @BUILD_NUMBER@ diff --git a/src/ui/screen/screen.cpp b/src/ui/screen/screen.cpp index 6eb508a8..7adc5df8 100644 --- a/src/ui/screen/screen.cpp +++ b/src/ui/screen/screen.cpp @@ -19,7 +19,7 @@ #include "ui/screen/screen.h" -#include "common/config.h" +#include "common/version.h" #include "app/app.h"