-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
119 lines (85 loc) · 2.95 KB
/
CMakeLists.txt
File metadata and controls
119 lines (85 loc) · 2.95 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# Copyright 2024 NVIDIA
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
#
cmake_minimum_required(VERSION 3.22)
project(OSD_lite_tutorials VERSION 1.0.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
#
# Compiler
#
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_COMPILER_IS_CLANGCC 1)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCC 1)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Intel")
set(CMAKE_COMPILER_IS_ICC 1)
endif()
if (MSVC)
add_definitions(/W3 /WX /DNOMINMAX /D_USE_MATH_DEFINES /D_CRT_SECURE_NO_WARNINGS)
else()
if(CMAKE_COMPILER_IS_ICC)
add_definitions(-w2 -wd1572 -wd1418 -wd981 -wd383 -wd193 -wd444)
elseif(CMAKE_COMPILER_IS_CLANGCC OR CMAKE_COMPILER_IS_GNUCC)
add_definitions(-Wall -Wextra)
endif()
add_definitions(-Werror)
endif()
#
# OSD_lite
#
set(osd_lite_lib "osd_lite_static")
if (NOT OSD_lite_ROOT)
if (NOT OSD_lite_git_tag)
set(OSD_lite_git_tag "main" CACHE STRING "Git tag used to fetch OSD_lite")
endif()
include(FetchContent)
FetchContent_Declare(OSD_lite
GIT_REPOSITORY https://github.com/NVIDIA-RTX/OSD-Lite
GIT_TAG "${OSD_lite_git_tag}"
)
FetchContent_MakeAvailable(OSD_lite)
else()
find_package(OSD_lite REQUIRED)
set(osd_lite_lib "osd::${osd_lite_lib}")
endif()
#
# Tutorials
#
include(GNUInstallDirs)
include(CTest)
enable_testing()
macro(osd_add_tutorial NAME)
add_executable(${NAME} ${ARGN})
target_link_libraries(${NAME} PRIVATE tutorials_common_lib)
string(SUBSTRING ${NAME} 0 3 folder_name)
set_target_properties(${NAME} PROPERTIES FOLDER "tutorials/${folder_name}")
add_test(NAME ${NAME} COMMAND "$<TARGET_FILE:${NAME}>")
endmacro()
add_subdirectory(common)
add_subdirectory(far)
add_subdirectory(bfr)
add_subdirectory(tmr)