33 lines
849 B
CMake
33 lines
849 B
CMake
# C++ Standard
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# Output Directories
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
# Generate compile_commands.json
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
# Definitions
|
|
add_definitions(-DOPENCV_DEPENDENCIES)
|
|
|
|
# Qt6 Setup (Global)
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
# Compiler Specific Options
|
|
if(MSVC)
|
|
# MSVC specific options
|
|
add_compile_options(/utf-8) # Fix C4819 encoding warning
|
|
add_compile_options(/W3) # Warning level 3
|
|
add_compile_options(/MP) # Multi-processor compilation
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS) # Suppress C4996 deprecated warnings
|
|
|
|
add_compile_options($<$<CONFIG:Release>:/O2>) # Maximize speed
|
|
add_compile_options($<$<CONFIG:Release>:/Ob2>) # Inline function expansion
|
|
|
|
|
|
|
|
endif()
|