-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (29 loc) · 1.43 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.25)
project(mandelbrot)
set(CMAKE_CXX_STANDARD 20)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
qt_standard_project_setup()
set(CMAKE_AUTORCC ON)
set(RESOURCES "QDarkStyleSheet/qdarkstyle/dark/darkstyle.qrc")
add_executable(mandelbrot "main.cpp" "main_window.cpp" "picture.cpp" "perf_helper.cpp"
"workers.cpp" "render_layout.cpp" ${RESOURCES})
target_compile_options(mandelbrot PRIVATE -Wall)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(mandelbrot PRIVATE -Wno-sign-compare -Wshadow-uncaptured-local -pedantic)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
target_compile_options(mandelbrot PRIVATE -Wno-sign-compare -Wshadow=compatible-local -pedantic)
endif ()
option(USE_SANITIZERS "Enable to build with undefined, leak and address sanitizers" OFF)
if (USE_SANITIZERS)
target_compile_options(mandelbrot PUBLIC -fsanitize=address,undefined,leak -fno-sanitize-recover=all)
target_link_options(mandelbrot PUBLIC -fsanitize=address,undefined,leak)
endif ()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(mandelbrot PUBLIC -stdlib=libc++)
endif ()
if (CMAKE_BUILD_TYPE MATCHES "Debug")
target_compile_options(mandelbrot PUBLIC -D_GLIBCXX_DEBUG)
endif ()
set_property(TARGET mandelbrot PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_link_libraries(mandelbrot PUBLIC Qt6::Core Qt6::Widgets)