Init commit.
This commit is contained in:
51
CMakeLists.txt
Normal file
51
CMakeLists.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(systray LANGUAGES CXX)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
|
||||
|
||||
qt_standard_project_setup()
|
||||
|
||||
# 导出src下的cpp文件
|
||||
file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS src/*.cpp)
|
||||
qt_add_executable(systray ${SRC_FILES})
|
||||
|
||||
set_target_properties(systray PROPERTIES
|
||||
WIN32_EXECUTABLE TRUE
|
||||
MACOSX_BUNDLE TRUE
|
||||
)
|
||||
|
||||
target_link_libraries(systray PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::Widgets
|
||||
)
|
||||
|
||||
# Resources:
|
||||
set(systray_resource_files
|
||||
"images/bad.png"
|
||||
"images/heart.png"
|
||||
"images/trash.png"
|
||||
)
|
||||
|
||||
qt_add_resources(systray "systray"
|
||||
PREFIX
|
||||
"/"
|
||||
FILES
|
||||
${systray_resource_files}
|
||||
)
|
||||
|
||||
install(TARGETS systray
|
||||
BUNDLE DESTINATION .
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
qt_generate_deploy_app_script(
|
||||
TARGET systray
|
||||
OUTPUT_SCRIPT deploy_script
|
||||
NO_UNSUPPORTED_PLATFORM_ERROR
|
||||
)
|
||||
install(SCRIPT ${deploy_script})
|
||||
Reference in New Issue
Block a user