initial commit
This commit is contained in:
46
CMakeLists.txt
Normal file
46
CMakeLists.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user