-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathCMakeLists.txt
29 lines (20 loc) · 877 Bytes
/
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
cmake_minimum_required(VERSION 3.12...3.26)
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT is_multi_config AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE}))
set(CMAKE_BUILD_TYPE Release CACHE STRING "Release default")
endif()
project(tinyrenderer LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
option(iwyu "Run include-what-you-use")
if(iwyu)
find_program(IWYU_EXE NAMES include-what-you-use REQUIRED)
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXE})
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU|Intel")
add_compile_options(-Wall)
endif()
find_package(OpenMP COMPONENTS CXX)
set(SOURCES main.cpp model.cpp our_gl.cpp tgaimage.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE $<$<BOOL:${OpenMP_CXX_FOUND}>:OpenMP::OpenMP_CXX>)
file(GENERATE OUTPUT .gitignore CONTENT "*")