From b25f6f3911c4d41dcfa0097a125d4d28d85a3a42 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 --- CMakeLists.txt | 8 ++++---- ChangeLog | 9 +++++++++ lmmsversion.h.in | 6 ++++++ src/core/config_mgr.cpp | 2 +- src/core/mmp.cpp | 1 + src/gui/about_dialog.cpp | 2 +- src/gui/main_window.cpp | 1 + 7 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 lmmsversion.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ff1d6439f..376c76eca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,9 +35,8 @@ ENDIF(NOT 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) @@ -362,6 +361,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) # set compiler flags @@ -475,7 +475,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) SET_TARGET_PROPERTIES(lmms PROPERTIES LINK_FLAGS "${LINK_FLAGS} -mwindows") @@ -522,7 +522,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/ChangeLog b/ChangeLog index fdd12f8cf..758540a11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-12-14 Tobias Doerffel + * src/core/config_mgr.cpp: + * src/core/mmp.cpp: + * src/gui/main_window.cpp: + * src/gui/about_dialog.cpp: + * lmmsversion.h.in: + * CMakeLists.txt: + moved version information into separate header file to avoid + the necessity of a complete recompile each time SVN revision changes + * include/midi.h: - added support for MidiMetaEvents to midiEvent - added MidiMetaPanning event 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 f17637776..9d5af1e7f 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 "main_window.h" diff --git a/src/core/mmp.cpp b/src/core/mmp.cpp index ddae92aa9..63dfa7423 100644 --- a/src/core/mmp.cpp +++ b/src/core/mmp.cpp @@ -38,6 +38,7 @@ #include "project_version.h" #include "song_editor.h" #include "effect.h" +#include "lmmsversion.h" diff --git a/src/gui/about_dialog.cpp b/src/gui/about_dialog.cpp index 159c77ff6..32364ffc2 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" diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp index 25c0a63f7..f55466807 100644 --- a/src/gui/main_window.cpp +++ b/src/gui/main_window.cpp @@ -39,6 +39,7 @@ #include +#include "lmmsversion.h" #include "main_window.h" #include "bb_editor.h" #include "song_editor.h"