generated from CoolLibs/library-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
33 lines (27 loc) · 1.06 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
cmake_minimum_required(VERSION 3.8)
set(WARNINGS_AS_ERRORS_FOR_IMGUI_GRADIENT OFF CACHE BOOL "ON iff you want to treat warnings as errors")
add_library(imgui_gradient)
add_library(imgui_gradient::imgui_gradient ALIAS imgui_gradient)
target_compile_features(imgui_gradient PUBLIC cxx_std_11)
# ---Add source files---
if(WARNINGS_AS_ERRORS_FOR_IMGUI_GRADIENT)
target_include_directories(imgui_gradient PUBLIC include)
else()
target_include_directories(imgui_gradient SYSTEM PUBLIC include)
endif()
file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS src/*.cpp)
target_sources(imgui_gradient PRIVATE ${SRC_FILES})
# Set warning level
if(MSVC)
target_compile_options(imgui_gradient PRIVATE /W4)
else()
target_compile_options(imgui_gradient PRIVATE -Wall -Wextra -Wpedantic -pedantic-errors -Wconversion -Wsign-conversion)
endif()
# Maybe enable warnings as errors
if(WARNINGS_AS_ERRORS_FOR_IMGUI_GRADIENT)
if(MSVC)
target_compile_options(imgui_gradient PRIVATE /WX)
else()
target_compile_options(imgui_gradient PRIVATE -Werror)
endif()
endif()