cmake_minimum_required(VERSION 3.15
project(星尘传说 VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

file(GLOB_RECURSE SRC_FILES "*.cpp")
file(GLOB_RECURSE HEADER_FILES "*.h")

include_directories(.)
include_directories(audio
include_directories(bearer
include_directories(build
include_directories(iconengines
include_directories(imageformats
include_directories(mediaservice
include_directories(mp3
include_directories(platforminputcontexts
include_directories(platforms
include_directories(playlistformats
include_directories(png
include_directories(qmltooling
include_directories(QtGraphicalEffects
include_directories(QtQuick
include_directories(QtQuick.2
include_directories(saves
include_directories(scenegraph
include_directories(styles
include_directories(virtualkeyboard
include_directories(星尘传说

add_executable(${PROJECT_NAME} ${SRC_FILES} ${HEADER_FILES})

target_link_libraries(${PROJECT_NAME})

install(TARGETS ${PROJECT_NAME} DESTINATION bin)
检测到 Qt 项目，添加 Qt 支持...

set(CMAKE_AUTOMOC ON
set(CMAKE_AUTOUIC ON
set(CMAKE_AUTORCC ON

find_package(Qt5 COMPONENTS Core Widgets Gui REQUIRED)

target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui)