From 610f01b0f9624edc42985d6b448b7408418ebe09 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 14 Dec 2008 00:54:50 +0000 Subject: [PATCH] moved version information into separate header file to avoid the necessity of a complete recompile each time SVN revision changes git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1913 0778d3d1-df1d-0410-868b-ea421aaaa00d (cherry picked from commit b25f6f3911c4d41dcfa0097a125d4d28d85a3a42) --- CMakeLists.txt | 8 ++++---- lmmsversion.h.in | 6 ++++++ src/core/config_mgr.cpp | 2 +- src/core/main.cpp | 4 ++-- src/core/mmp.cpp | 1 + src/gui/MainWindow.cpp | 1 + src/gui/about_dialog.cpp | 2 +- 7 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 lmmsversion.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9357bf4ba..ff9c62b21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,9 +19,8 @@ SET(VERSION_PATCH "6") #SET(VERSION_SUFFIX "") SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") IF(VERSION_SUFFIX) - SET (VERSION "${VERSION}-${VERSION_SUFFIX}") + SET(VERSION "${VERSION}-${VERSION_SUFFIX}") ENDIF(VERSION_SUFFIX) -ADD_DEFINITIONS(-D'LMMS_VERSION="${VERSION}"') INCLUDE(DetectMachine) @@ -355,6 +354,7 @@ ENDIF(NOT LMMS_HAVE_SAMPLERATE) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/lmmsconfig.h.in ${CMAKE_BINARY_DIR}/lmmsconfig.h) +CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/lmmsversion.h.in ${CMAKE_BINARY_DIR}/lmmsversion.h) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/lmms.rc.in ${CMAKE_BINARY_DIR}/lmms.rc) CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/plugins/zynaddsubfx/zynaddsubfx.rc.in ${CMAKE_BINARY_DIR}/plugins/zynaddsubfx/zynaddsubfx.rc) @@ -430,7 +430,7 @@ LINK_LIBRARIES(${QT_LIBRARIES} ${ASOUND_LIBRARY} ${SDL_LIBRARY} ${PORTAUDIO_LIBR ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/lmms.1.gz COMMAND gzip -c ${CMAKE_SOURCE_DIR}/lmms.1 > ${CMAKE_BINARY_DIR}/lmms.1.gz DEPENDS ${CMAKE_SOURCE_DIR}/lmms.1 COMMENT "Generating lmms.1.gz") -ADD_EXECUTABLE(lmms ${lmms_SOURCES} ${lmms_INCLUDES} ${LIBSAMPLERATE_SOURCES} ${LMMS_ER_H} ${lmms_UI_out} lmmsconfig.h ${WINRC} ${CMAKE_BINARY_DIR}/lmms.1.gz) +ADD_EXECUTABLE(lmms ${lmms_SOURCES} ${lmms_INCLUDES} ${LIBSAMPLERATE_SOURCES} ${LMMS_ER_H} ${lmms_UI_out} lmmsconfig.h lmmsversion.h ${WINRC} ${CMAKE_BINARY_DIR}/lmms.1.gz) IF(LMMS_BUILD_WIN32) @@ -494,7 +494,7 @@ ENDFOREACH(_item ${qm_targets}) # install headers IF(LMMS_BUILD_LINUX) -INSTALL(FILES ${lmms_INCLUDES} ${CMAKE_BINARY_DIR}/lmmsconfig.h ${CMAKE_SOURCE_DIR}/src/gui/embed.cpp DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lmms/) +INSTALL(FILES ${lmms_INCLUDES} ${CMAKE_BINARY_DIR}/lmmsconfig.h ${CMAKE_BINARY_DIR}/lmmsversion.h ${CMAKE_SOURCE_DIR}/src/gui/embed.cpp DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lmms/) IF(NOT LMMS_HAVE_SAMPLERATE) INSTALL(FILES ${CMAKE_SOURCE_DIR}/src/3rdparty/samplerate/samplerate.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lmms/) ENDIF(NOT LMMS_HAVE_SAMPLERATE) diff --git a/lmmsversion.h.in b/lmmsversion.h.in new file mode 100644 index 000000000..09c82ea0f --- /dev/null +++ b/lmmsversion.h.in @@ -0,0 +1,6 @@ +#define LMMS_VERSION_MAJOR @VERSION_MAJOR@ +#define LMMS_VERSION_MINOR @VERSION_MINOR@ +#define LMMS_VERSION_PATCH @VERSION_PATCH@ +#define LMMS_VERSION_SUFFIX "@VERSION_SUFFIX@" +#define LMMS_VERSION "@VERSION@" + diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index c9a66fd17..2c1793f4c 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -31,7 +31,7 @@ #include #include - +#include "lmmsversion.h" #include "config_mgr.h" #include "MainWindow.h" diff --git a/src/core/main.cpp b/src/core/main.cpp index 337f5fd44..d7b1b22f0 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,7 +1,7 @@ /* * main.cpp - just main.cpp which is starting up app... * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2004-2010 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -22,8 +22,8 @@ * */ - #include "lmmsconfig.h" +#include "lmmsversion.h" #include #include diff --git a/src/core/mmp.cpp b/src/core/mmp.cpp index 13a70c7ab..8200aeb50 100644 --- a/src/core/mmp.cpp +++ b/src/core/mmp.cpp @@ -37,6 +37,7 @@ #include "project_version.h" #include "song_editor.h" #include "Effect.h" +#include "lmmsversion.h" diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 01c227c6f..1bbafc0ce 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -37,6 +37,7 @@ #include #include +#include "lmmsversion.h" #include "MainWindow.h" #include "bb_editor.h" #include "song_editor.h" diff --git a/src/gui/about_dialog.cpp b/src/gui/about_dialog.cpp index 819bb7cdf..41a502696 100644 --- a/src/gui/about_dialog.cpp +++ b/src/gui/about_dialog.cpp @@ -23,7 +23,7 @@ */ -#include "lmmsconfig.h" +#include "lmmsversion.h" #include "about_dialog.h" #include "embed.h" #include "engine.h"