+4
-1
@@ -54,7 +54,7 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
set(OLIVE_DEFINITIONS -DAPPVERSION="${PROJECT_VERSION}" -DQT_DEPRECATED_WARNINGS)
|
||||
set(OLIVE_DEFINITIONS -DQT_DEPRECATED_WARNINGS)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
@@ -157,6 +157,7 @@ else()
|
||||
endif()
|
||||
|
||||
# Generate Git hash
|
||||
set(PROJECT_LONG_VERSION ${PROJECT_VERSION})
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
find_package(Git)
|
||||
if(GIT_FOUND)
|
||||
@@ -165,6 +166,8 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
OUTPUT_VARIABLE GIT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
set(PROJECT_LONG_VERSION ${PROJECT_VERSION}-${GIT_HASH})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
+6
-1
@@ -67,7 +67,7 @@ add_library(olive-version-obj
|
||||
)
|
||||
target_link_libraries(olive-version-obj PRIVATE Qt5::Core)
|
||||
if(DEFINED GIT_HASH)
|
||||
target_compile_options(olive-version-obj PRIVATE -DGITHASH="${GIT_HASH}")
|
||||
target_compile_options(olive-version-obj PRIVATE -DAPPVERSION="${PROJECT_VERSION}" -DAPPVERSIONLONG="${PROJECT_LONG_VERSION}" )
|
||||
endif()
|
||||
|
||||
# Add main library
|
||||
@@ -112,6 +112,11 @@ elseif(APPLE)
|
||||
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/packaging/macos/MacOSXBundleInfo.plist.in
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER org.olivevideoeditor.Olive
|
||||
MACOSX_BUNDLE_ICON_FILE olive.icns
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
|
||||
MACOSX_BUNDLE_BUNDLE_NAME "Olive"
|
||||
MACOSX_BUNDLE_INFO_STRING "Olive ${PROJECT_LONG_VERSION}"
|
||||
MACOSX_BUNDLE_COPYRIGHT "©2018-2021 Olive Studios LLC and others. Published under the GNU General Public License version 3.0."
|
||||
RESOURCE "${OLIVE_ICON}"
|
||||
OUTPUT_NAME "Olive"
|
||||
)
|
||||
|
||||
+2
-12
@@ -59,22 +59,12 @@ int main(int argc, char *argv[])
|
||||
// Set up debug handler
|
||||
qInstallMessageHandler(olive::DebugHandler);
|
||||
|
||||
// Generate version string
|
||||
QString app_version = APPVERSION;
|
||||
if (!olive::kGitHash.isEmpty()) {
|
||||
// Anything after the hyphen is considered "unimportant" information. Text BEFORE the hyphen is
|
||||
// used in version checking project files and config files
|
||||
app_version.append("-");
|
||||
app_version.append(olive::kGitHash);
|
||||
}
|
||||
|
||||
// Set application metadata
|
||||
QCoreApplication::setOrganizationName("olivevideoeditor.org");
|
||||
QCoreApplication::setOrganizationDomain("olivevideoeditor.org");
|
||||
QCoreApplication::setApplicationName("Olive");
|
||||
QGuiApplication::setDesktopFileName("org.olivevideoeditor.Olive");
|
||||
|
||||
QCoreApplication::setApplicationVersion(app_version);
|
||||
QCoreApplication::setApplicationVersion(olive::kAppVersionLong);
|
||||
|
||||
|
||||
//
|
||||
@@ -150,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (version_option->IsSet()) {
|
||||
// Print version
|
||||
printf("%s\n", app_version.toUtf8().constData());
|
||||
printf("%s\n", QCoreApplication::applicationVersion().toUtf8().constData());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,35 +2,31 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleLongVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleGetInfoString</key>
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
+2
-5
@@ -22,10 +22,7 @@
|
||||
|
||||
namespace olive {
|
||||
|
||||
#ifdef GITHASH
|
||||
QString kGitHash = QStringLiteral(GITHASH);
|
||||
#else
|
||||
QString kGitHash;
|
||||
#endif
|
||||
QString kAppVersion = QStringLiteral(APPVERSION);
|
||||
QString kAppVersionLong = QStringLiteral(APPVERSIONLONG);
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -25,7 +25,8 @@
|
||||
|
||||
namespace olive {
|
||||
|
||||
extern QString kGitHash;
|
||||
extern QString kAppVersion;
|
||||
extern QString kAppVersionLong;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user