-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
37 lines (27 loc) · 1.19 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
cmake_minimum_required(VERSION 3.9)
project(learnopengl VERSION 0.1.0)
find_package(fmt REQUIRED)
find_package(glad REQUIRED)
find_package(glfw3 REQUIRED)
find_package(Stb REQUIRED)
find_package(glm REQUIRED)
add_executable(learnopengl
src/main.cpp
src/gl_debug.cpp
src/shader.cpp
src/vendor/stb_image.cpp
)
target_compile_features(learnopengl PUBLIC cxx_std_20)
target_compile_options(learnopengl PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:-Wextra -Wall -pedantic -Wno-c++98-c++11-c++14-c++17-compat-pedantic>)
target_compile_definitions(learnopengl PRIVATE GLFW_INCLUDE_NONE)
target_link_libraries(learnopengl PUBLIC fmt::fmt glad::glad glfw)
option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF)
option(ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF)
if(ENABLE_INCLUDE_WHAT_YOU_USE)
find_program(INCLUDE_WHAT_YOU_USE include-what-you-use REQUIRED)
set_property(TARGET learnopengl PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE})
endif()
if(ENABLE_CLANG_TIDY)
find_program(CLANG_TIDY clang-tidy REQUIRED)
set_property(TARGET learnopengl PROPERTY CXX_CLANG_TIDY ${CLANG_TIDY})
endif()