filesystemexplorer: Provide proper metadata for macOS
While at it, also remove hardcoded application version in main.cpp: Qt can retrieve this from the application metdata. Also use camel-case for the project name, according to https://contribute.qt-project.org/quips/13 Pick-to: 6.10 Change-Id: If73fd741e330b66ae5367a61c65ccc65653cdab6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
161464abf6
commit
305d65ab87
|
@ -2,7 +2,7 @@
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(filesystemexplorer LANGUAGES CXX)
|
project(FileSystemExplorer VERSION 1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
if (ANDROID OR IOS)
|
if (ANDROID OR IOS)
|
||||||
message(FATAL_ERROR "Platform is not supported")
|
message(FATAL_ERROR "Platform is not supported")
|
||||||
|
@ -10,18 +10,13 @@ if (ANDROID OR IOS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickControls2 Svg)
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick QuickControls2 Svg)
|
||||||
|
|
||||||
qt_standard_project_setup(REQUIRES 6.8)
|
qt_standard_project_setup(REQUIRES 6.8)
|
||||||
|
|
||||||
qt_add_executable(filesystemexplorer
|
qt_add_executable(filesystemexplorer
|
||||||
main.cpp
|
main.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(filesystemexplorer
|
|
||||||
PROPERTIES
|
|
||||||
WIN32_EXECUTABLE TRUE
|
|
||||||
MACOSX_BUNDLE TRUE
|
|
||||||
)
|
|
||||||
|
|
||||||
set_source_files_properties(qml/Colors.qml
|
set_source_files_properties(qml/Colors.qml
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
QT_QML_SINGLETON_TYPE TRUE
|
QT_QML_SINGLETON_TYPE TRUE
|
||||||
|
@ -68,6 +63,23 @@ target_link_libraries(filesystemexplorer
|
||||||
Qt6::Svg
|
Qt6::Svg
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_target_properties(filesystemexplorer
|
||||||
|
PROPERTIES
|
||||||
|
WIN32_EXECUTABLE TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set_target_properties(filesystemexplorer PROPERTIES
|
||||||
|
OUTPUT_NAME "File System Explorer"
|
||||||
|
MACOSX_BUNDLE TRUE
|
||||||
|
MACOSX_BUNDLE_BUNDLE_NAME "File System Explorer"
|
||||||
|
MACOSX_BUNDLE_COPYRIGHT "Copyright (C) The Qt Company Ltd. and other contributors."
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER "io.qt.examples.fsexplorer"
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS filesystemexplorer
|
install(TARGETS filesystemexplorer
|
||||||
BUNDLE DESTINATION .
|
BUNDLE DESTINATION .
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
|
|
@ -21,7 +21,7 @@ ApplicationWindow {
|
||||||
visible: true
|
visible: true
|
||||||
color: Colors.background
|
color: Colors.background
|
||||||
flags: Qt.Window | Qt.FramelessWindowHint
|
flags: Qt.Window | Qt.FramelessWindowHint
|
||||||
title: qsTr("File System Explorer Example")
|
title: qsTr("File System Explorer")
|
||||||
|
|
||||||
function getInfoText() : string {
|
function getInfoText() : string {
|
||||||
let out = root.currentFilePath
|
let out = root.currentFilePath
|
||||||
|
|
|
@ -13,7 +13,6 @@ int main(int argc, char *argv[])
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
QGuiApplication::setOrganizationName("QtProject");
|
QGuiApplication::setOrganizationName("QtProject");
|
||||||
QGuiApplication::setApplicationName("File System Explorer");
|
QGuiApplication::setApplicationName("File System Explorer");
|
||||||
QGuiApplication::setApplicationVersion(QT_VERSION_STR);
|
|
||||||
QGuiApplication::setWindowIcon(QIcon(":/qt/qml/FileSystemModule/icons/app_icon.svg"));
|
QGuiApplication::setWindowIcon(QIcon(":/qt/qml/FileSystemModule/icons/app_icon.svg"));
|
||||||
|
|
||||||
// Setup the parser and parse the command-line arguments.
|
// Setup the parser and parse the command-line arguments.
|
||||||
|
|
Loading…
Reference in New Issue