Skip to content

Commit 9cb3ae7

Browse files
authored
Add build flags to output of lmms --version (LMMS#7780)
1 parent 16296c1 commit 9cb3ae7

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
ADD_SUBDIRECTORY(3rdparty)
22

33
CONFIGURE_FILE("lmmsconfig.h.in" "${CMAKE_BINARY_DIR}/lmmsconfig.h")
4+
5+
# Provide config flags to lmmsversion.h
6+
get_cmake_property(_define_vars VARIABLES)
7+
foreach (_define_var ${_define_vars})
8+
if(_define_var MATCHES "^WANT|LMMS_(HAVE|DEBUG)" )
9+
list(APPEND LMMS_BUILD_OPTIONS "${_define_var}='${${_define_var}}'")
10+
endif()
11+
endforeach()
12+
13+
# Format for readibility
14+
string(REPLACE ";" " " LMMS_BUILD_OPTIONS "${LMMS_BUILD_OPTIONS}")
15+
416
CONFIGURE_FILE("lmmsversion.h.in" "${CMAKE_BINARY_DIR}/lmmsversion.h")
517

618
SET(LMMS_SRCS "")

src/core/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,16 @@ inline void loadTranslation( const QString & tname,
140140

141141
void printVersion( char *executableName )
142142
{
143-
printf( "LMMS %s\n(%s %s, Qt %s, %s)\n\n"
143+
printf("LMMS %s\n(%s %s, Qt %s, %s)\n\n"
144+
"Build options:\n%s\n\n"
144145
"Copyright (c) %s\n\n"
145146
"This program is free software; you can redistribute it and/or\n"
146147
"modify it under the terms of the GNU General Public\n"
147148
"License as published by the Free Software Foundation; either\n"
148149
"version 2 of the License, or (at your option) any later version.\n\n"
149150
"Try \"%s --help\" for more information.\n\n", LMMS_VERSION,
150-
LMMS_BUILDCONF_PLATFORM, LMMS_BUILDCONF_MACHINE, QT_VERSION_STR, LMMS_BUILDCONF_COMPILER_VERSION,
151-
LMMS_PROJECT_COPYRIGHT, executableName );
151+
LMMS_BUILDCONF_PLATFORM, LMMS_BUILDCONF_MACHINE, QT_VERSION_STR, LMMS_BUILDCONF_COMPILER_VERSION, LMMS_BUILD_OPTIONS,
152+
LMMS_PROJECT_COPYRIGHT, executableName);
152153
}
153154

154155

src/lmmsversion.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#define LMMS_VERSION "@VERSION@"
22
#define LMMS_PROJECT_COPYRIGHT "@PROJECT_COPYRIGHT@"
3+
#define LMMS_BUILD_OPTIONS "@LMMS_BUILD_OPTIONS@"

0 commit comments

Comments
 (0)