Files
hfut-bishe/CMakeLists.txt
2026-04-07 20:55:30 +08:00

47 lines
1005 B
CMake
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
cmake_minimum_required(VERSION 3.16)
project(LandscapeInteractiveTool
VERSION 0.1.0
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# 开启较严格的编译告警(包含未使用变量等)
if (MSVC)
add_compile_options(/W4 /permissive-)
else()
add_compile_options(
-Wall
-Wextra
-Wpedantic
-Wconversion
-Wsign-conversion
-Wunused
-Wunused-const-variable=2
-Wunused-parameter
-Wshadow
)
endif()
# 尝试优先使用 Qt6其次 Qt5
set(QT_REQUIRED_COMPONENTS Widgets Gui Core Network)
find_package(Qt6 COMPONENTS ${QT_REQUIRED_COMPONENTS} QUIET)
if(Qt6_FOUND)
message(STATUS "Configuring with Qt6")
set(QT_PACKAGE Qt6)
else()
find_package(Qt5 COMPONENTS ${QT_REQUIRED_COMPONENTS} REQUIRED)
message(STATUS "Configuring with Qt5")
set(QT_PACKAGE Qt5)
endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
add_subdirectory(client)