Browse code

Add project

Robert Cranston authored on 29/12/2021 16:29:52
Showing 5 changed files

1 1
new file mode 100644
... ...
@@ -0,0 +1,39 @@
1
+---
2
+
3
+Checks: >
4
+    *,
5
+    -llvmlibc-*,
6
+    -fuchsia-*,
7
+    -altera-*,
8
+    -clang-diagnostic-unknown-warning-option,
9
+    -clang-diagnostic-ignored-optimization-argument,
10
+
11
+    # "Consider",
12
+    -cppcoreguidelines-avoid-non-const-global-variables,
13
+
14
+    # Reduced verbosity,
15
+    -*-braces-around-statements,
16
+    -*-implicit-bool-conversion,
17
+    -*-static-accessed-through-instance,
18
+
19
+    # Interaction with C,
20
+    -*-cast*,
21
+    -*-vararg,
22
+    -*array-*decay,
23
+
24
+    # Static storage duration throwing constructors,
25
+    -cert-err58-cpp,
26
+
27
+    # Style,
28
+    -*-use-trailing-return-type,
29
+    -*-container-size-empty,
30
+    -*-easily-swappable-parameters,
31
+
32
+    # Backwards compatibility,
33
+    -*-union-access,
34
+
35
+    # -Weffc++,
36
+    -*-redundant-member-init,
37
+
38
+WarningsAsErrors: >
39
+    *,
0 40
new file mode 100644
... ...
@@ -0,0 +1 @@
1
+/_build
0 2
new file mode 100644
... ...
@@ -0,0 +1,35 @@
1
+## CMake
2
+cmake_minimum_required(VERSION 3.14)
3
+if(NOT CMAKE_BUILD_TYPE)
4
+    set(CMAKE_BUILD_TYPE Debug)
5
+endif()
6
+
7
+## Project
8
+project(gltexture
9
+    VERSION 1.0.0
10
+    LANGUAGES CXX
11
+)
12
+
13
+## Main target
14
+add_library(${PROJECT_NAME})
15
+
16
+## C++
17
+include(common.cmake)
18
+common(
19
+    CXX_STANDARD 11
20
+    DISABLE_CPPCHECK
21
+    PACKAGES
22
+        OpenGL
23
+        GLEW
24
+    FETCHCONTENT
25
+        https://git.rcrnstn.net/rcrnstn/globject
26
+        https://git.rcrnstn.net/rcrnstn/cxx-str
27
+    DEPENDENCIES_PUBLIC
28
+        OpenGL::GL
29
+    DEPENDENCIES_PRIVATE
30
+        globject
31
+        cxx-str
32
+    DEPENDENCIES_TESTS
33
+        globject
34
+        GLEW::GLEW
35
+)
... ...
@@ -8,6 +8,95 @@ A [C++11][]/[OpenGL][] [\>=2.0][] [texture][] library.
8 8
 [\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history
9 9
 [texture]: https://www.khronos.org/opengl/wiki/Texture
10 10
 
11
+## Build system
12
+
13
+This project supports [CMake][] and uses [`cmake-common`][]. There are several
14
+ways to use it in other CMake-based projects:
15
+
16
+-   With [`find_package`][]: ([Package][] and) [install][] it on the system.
17
+
18
+-   With [`add_subdirectory`][]: Bundle it.
19
+
20
+-   With [`FetchContent`][]: Download it as part of the CMake configure step.
21
+
22
+-   With [`cmake-common`][]: Use any of the above methods through a simplified
23
+    interface.
24
+
25
+As usual, use [`add_dependencies`][] or [`target_link_libraries`][] (or
26
+`cmake-common`'s `DEPENDENCIES_*`) to declare the dependency.
27
+
28
+[CMake]: https://cmake.org
29
+[`cmake-common`]: https://git.rcrnstn.net/rcrnstn/cmake-common
30
+[`FetchContent`]: https://cmake.org/cmake/help/v3.14/module/FetchContent.html
31
+[`add_subdirectory`]: https://cmake.org/cmake/help/v3.14/command/add_subdirectory.html
32
+[`find_package`]: https://cmake.org/cmake/help/v3.14/command/find_package.html
33
+[Package]: #Package
34
+[Install]: #Install
35
+[`add_dependencies`]: https://cmake.org/cmake/help/v3.14/command/add_dependencies.html
36
+[`target_link_libraries`]: https://cmake.org/cmake/help/v3.14/command/target_link_libraries.html
37
+
38
+### Configure and generate
39
+
40
+To configure and generate a build tree, use `cmake`:
41
+
42
+```sh
43
+cmake -B _build
44
+```
45
+
46
+To set the build type, pass e.g. `-D`[`CMAKE_BUILD_TYPE`][]`=Release`.
47
+
48
+[`cmake`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#generate-a-project-buildsystem
49
+[`CMAKE_BUILD_TYPE`]: https://cmake.org/cmake/help/v3.14/variable/CMAKE_BUILD_TYPE.html
50
+
51
+### Build
52
+
53
+To build, use [`cmake --build`][]:
54
+
55
+```sh
56
+cmake --build _build
57
+```
58
+
59
+To disable building tests, pass `-D`[`BUILD_TESTING`][]`=OFF`.
60
+
61
+[`cmake --build`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#build-a-project
62
+[`BUILD_TESTING`]: https://cmake.org/cmake/help/v3.14/module/CTest.html
63
+
64
+### Test
65
+
66
+To run tests, use [`ctest`][]:
67
+
68
+```sh
69
+(cd _build && ctest)
70
+```
71
+
72
+To show output from failing tests, pass `--output-on-failure`. To show output
73
+from all tests, pass `--verbose`.
74
+
75
+[`ctest`]: https://cmake.org/cmake/help/v3.14/manual/ctest.1.html
76
+
77
+### Package
78
+
79
+To package, use [`cpack`][]:
80
+
81
+```sh
82
+(cd _build && cpack)
83
+```
84
+
85
+[`cpack`]: https://cmake.org/cmake/help/v3.14/manual/cpack.1.html
86
+
87
+### Install
88
+
89
+To install onto the current system, use [`cmake --install`][]:
90
+
91
+```sh
92
+cmake --install _build
93
+```
94
+
95
+To set the prefix, pass e.g. `-D`[`CMAKE_INSTALL_PREFIX`][]`="$HOME/.local"`.
96
+
97
+[`cmake --install`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#install-a-project
98
+[`CMAKE_INSTALL_PREFIX`]: https://cmake.org/cmake/help/v3.14/variable/CMAKE_INSTALL_PREFIX.html
99
+
11 100
 ## License
12 101
 
13 102
 Licensed under the [ISC License][] unless otherwise noted, see the
14 103
new file mode 100644
... ...
@@ -0,0 +1,398 @@
1
+# https://git.rcrnstn.net/rcrnstn/cmake-common
2
+
3
+## CMake modules
4
+include(FetchContent)
5
+include(CMakePackageConfigHelpers)
6
+include(CheckIPOSupported)
7
+include(GNUInstallDirs)
8
+include(CTest)
9
+if(NOT CPack_CMake_INCLUDED)
10
+    include(CPack)
11
+endif()
12
+
13
+function(common)
14
+    ## Arguments
15
+    set(OPTIONS
16
+        DISABLE_WSHADOW
17
+        DISABLE_SANITIZERS
18
+        DISABLE_CPPCHECK
19
+        DISABLE_CLANG_TIDY
20
+        DISABLE_INCLUDE_WHAT_YOU_USE
21
+    )
22
+    set(ONE_VALUE_ARGS
23
+        CXX_STANDARD
24
+    )
25
+    set(MULTI_VALUE_ARGS
26
+        DEFINITIONS
27
+        PACKAGES
28
+        EXTERNAL
29
+        FETCHCONTENT
30
+        DEPENDENCIES_PUBLIC
31
+        DEPENDENCIES_PRIVATE
32
+        DEPENDENCIES_TESTS
33
+    )
34
+    cmake_parse_arguments(PARSE_ARGV 0 ARG
35
+        "${OPTIONS}"
36
+        "${ONE_VALUE_ARGS}"
37
+        "${MULTI_VALUE_ARGS}"
38
+    )
39
+
40
+    ## Variables
41
+    set(TEST_TARGETS)
42
+    set(PROJECT_IS_TOP_LEVEL)
43
+    set(PROJECT_IS_INTERFACE_LIBRARY)
44
+    set(PROJECT_IS_DEBUG)
45
+    get_target_property(PROJECT_TYPE ${PROJECT_NAME} TYPE)
46
+    string(TOLOWER "${CMAKE_BUILD_TYPE}" PROJECT_BUILD_TYPE)
47
+    if("${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
48
+        set(PROJECT_IS_TOP_LEVEL TRUE)
49
+    endif()
50
+    if("${PROJECT_TYPE}" STREQUAL "INTERFACE_LIBRARY")
51
+        set(PROJECT_IS_INTERFACE_LIBRARY TRUE)
52
+    endif()
53
+    if("${PROJECT_BUILD_TYPE}" STREQUAL "debug")
54
+        set(PROJECT_IS_DEBUG TRUE)
55
+    endif()
56
+
57
+    ## Definitions
58
+    add_compile_definitions(${ARG_DEFINITIONS})
59
+
60
+    ## Packages
61
+    foreach(PACKAGE ${ARG_PACKAGES})
62
+        find_package(${PACKAGE} REQUIRED)
63
+    endforeach()
64
+
65
+    ## External
66
+    foreach(EXTERNAL ${ARG_EXTERNAL})
67
+        add_subdirectory(external/${EXTERNAL} EXCLUDE_FROM_ALL)
68
+    endforeach()
69
+
70
+    ## FetchContent
71
+    foreach(FETCHCONTENT ${ARG_FETCHCONTENT})
72
+        get_filename_component(FETCHCONTENT_NAME ${FETCHCONTENT} NAME)
73
+        FetchContent_Declare(${FETCHCONTENT_NAME}
74
+            GIT_REPOSITORY ${FETCHCONTENT}
75
+            GIT_SHALLOW TRUE
76
+            GIT_PROGRESS TRUE
77
+        )
78
+        FetchContent_MakeAvailable(${FETCHCONTENT_NAME})
79
+    endforeach()
80
+
81
+    ## Main target
82
+    file(GLOB_RECURSE SRC CONFIGURE_DEPENDS
83
+        RELATIVE "${PROJECT_SOURCE_DIR}"
84
+        src/*
85
+    )
86
+    file(GLOB_RECURSE INCLUDE CONFIGURE_DEPENDS
87
+        RELATIVE "${PROJECT_SOURCE_DIR}"
88
+        include/*
89
+    )
90
+    if(NOT ("${SRC}" STREQUAL "" AND "${INCLUDE}" STREQUAL ""))
91
+        if(PROJECT_IS_INTERFACE_LIBRARY)
92
+            target_include_directories(${PROJECT_NAME}
93
+                INTERFACE
94
+                    "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
95
+                    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
96
+            )
97
+        else()
98
+            target_sources(${PROJECT_NAME}
99
+                PRIVATE
100
+                    ${SRC}
101
+                    ${INCLUDE}
102
+            )
103
+            target_include_directories(${PROJECT_NAME}
104
+                PUBLIC
105
+                    "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
106
+                    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
107
+                PRIVATE
108
+                    src
109
+            )
110
+            target_link_libraries(${PROJECT_NAME}
111
+                PUBLIC
112
+                    ${ARG_DEPENDENCIES_PUBLIC}
113
+                PRIVATE
114
+                    "$<BUILD_INTERFACE:${ARG_DEPENDENCIES_PRIVATE}>"
115
+            )
116
+        endif()
117
+        if(PROJECT_IS_TOP_LEVEL)
118
+            install(
119
+                DIRECTORY
120
+                    include/
121
+                DESTINATION
122
+                    ${CMAKE_INSTALL_INCLUDEDIR}
123
+            )
124
+            install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME})
125
+            install(EXPORT ${PROJECT_NAME}
126
+                FILE ${PROJECT_NAME}Config.cmake
127
+                DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
128
+            )
129
+            write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake
130
+                COMPATIBILITY SameMajorVersion
131
+            )
132
+            install(
133
+                FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
134
+                DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
135
+            )
136
+        endif()
137
+    endif()
138
+
139
+    ## Test targets
140
+    if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING)
141
+        file(GLOB_RECURSE TESTS_COMMON CONFIGURE_DEPENDS
142
+            tests/common/*
143
+        )
144
+        file(GLOB TESTS CONFIGURE_DEPENDS
145
+            LIST_DIRECTORIES FALSE
146
+            tests/*
147
+        )
148
+        foreach(TEST ${TESTS})
149
+            get_filename_component(TEST_NAME "${TEST}" NAME_WE)
150
+            set(TEST_TARGET "${PROJECT_NAME}-test-${TEST_NAME}")
151
+            add_executable(${TEST_TARGET}
152
+                ${TEST}
153
+                ${TESTS_COMMON}
154
+            )
155
+            target_include_directories(${TEST_TARGET}
156
+                PRIVATE
157
+                    tests
158
+            )
159
+            target_link_libraries(${TEST_TARGET}
160
+                PRIVATE
161
+                    ${PROJECT_NAME}
162
+                    ${ARG_DEPENDENCIES_TESTS}
163
+            )
164
+            add_test(
165
+                NAME    ${TEST_TARGET}
166
+                COMMAND ${TEST_TARGET}
167
+            )
168
+            list(APPEND TEST_TARGETS ${TEST_TARGET})
169
+        endforeach()
170
+    endif()
171
+
172
+    ## Assets
173
+    file(REMOVE_RECURSE
174
+        ${CMAKE_BINARY_DIR}/assets
175
+    )
176
+    file(GLOB_RECURSE ASSETS CONFIGURE_DEPENDS
177
+        RELATIVE "${PROJECT_SOURCE_DIR}"
178
+        assets/*
179
+    )
180
+    if(NOT "${ASSETS}" STREQUAL "")
181
+        add_custom_target(${PROJECT_NAME}-assets)
182
+        add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}-assets)
183
+    endif()
184
+    foreach(ASSET ${ASSETS})
185
+        get_filename_component(ASSET_DIR ${ASSET} DIRECTORY)
186
+        add_custom_command(
187
+            DEPENDS
188
+                ${PROJECT_SOURCE_DIR}/${ASSET}
189
+            OUTPUT
190
+                ${CMAKE_BINARY_DIR}/${ASSET}
191
+            COMMAND
192
+                ${CMAKE_COMMAND} -E make_directory
193
+                    ${CMAKE_BINARY_DIR}/${ASSET_DIR}
194
+            COMMAND
195
+                ${CMAKE_COMMAND} -E create_symlink
196
+                    ${PROJECT_SOURCE_DIR}/${ASSET}
197
+                    ${CMAKE_BINARY_DIR}/${ASSET}
198
+            VERBATIM
199
+        )
200
+        set_property(TARGET ${PROJECT_NAME}-assets APPEND PROPERTY
201
+            SOURCES ${CMAKE_BINARY_DIR}/${ASSET}
202
+        )
203
+        if(NOT "${ASSET}" MATCHES "/tests/")
204
+            install(
205
+                FILES
206
+                    ${PROJECT_SOURCE_DIR}/${ASSET}
207
+                DESTINATION
208
+                    ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/${ASSET_DIR}
209
+            )
210
+        endif()
211
+    endforeach()
212
+
213
+    ## Documentation
214
+    if(PROJECT_IS_TOP_LEVEL)
215
+        file(GLOB_RECURSE DOCS CONFIGURE_DEPENDS
216
+            RELATIVE "${PROJECT_SOURCE_DIR}"
217
+            doc/*
218
+        )
219
+        file(GLOB DOCS_ROOT CONFIGURE_DEPENDS
220
+            RELATIVE "${PROJECT_SOURCE_DIR}"
221
+            README*
222
+            LICENSE*
223
+            COPYING*
224
+            CHANGELOG*
225
+            CHANGES*
226
+            HISTORY*
227
+            NEWS*
228
+            RELEASES*
229
+            AUTHORS*
230
+            ACKNOWLEDGMENTS*
231
+            CONTRIBUTORS*
232
+            CONTRIBUTING*
233
+            CODE_OF_CONDUCT*
234
+            SECURITY*
235
+            SUPPORT*
236
+        )
237
+        list(APPEND DOCS ${DOCS_ROOT})
238
+        foreach(DOC ${DOCS})
239
+            get_filename_component(DOC_DIR ${DOC} DIRECTORY)
240
+            install(
241
+                FILES
242
+                    ${PROJECT_SOURCE_DIR}/${DOC}
243
+                DESTINATION
244
+                    ${CMAKE_INSTALL_DOCDIR}/${DOC_DIR}
245
+            )
246
+        endforeach()
247
+    endif()
248
+
249
+    ## Man pages
250
+    if(PROJECT_IS_TOP_LEVEL)
251
+        file(GLOB_RECURSE MANS CONFIGURE_DEPENDS
252
+            RELATIVE "${PROJECT_SOURCE_DIR}"
253
+            man/*
254
+        )
255
+        foreach(MAN ${MANS})
256
+            get_filename_component(MAN_DIR ${MAN} DIRECTORY)
257
+            install(
258
+                FILES
259
+                    ${PROJECT_SOURCE_DIR}/${MAN}
260
+                DESTINATION
261
+                    ${CMAKE_INSTALL_MANDIR}/${MAN_DIR}
262
+            )
263
+        endforeach()
264
+    endif()
265
+
266
+    ## Language version
267
+    if(PROJECT_IS_TOP_LEVEL AND NOT PROJECT_IS_INTERFACE_LIBRARY)
268
+        set_target_properties(${PROJECT_NAME} ${TEST_TARGETS} PROPERTIES
269
+            CXX_STANDARD          "${ARG_CXX_STANDARD}"
270
+            CXX_STANDARD_REQUIRED ON
271
+            CXX_EXTENSIONS        OFF
272
+        )
273
+    endif()
274
+
275
+    ## Build options
276
+    if(PROJECT_IS_TOP_LEVEL AND NOT PROJECT_IS_INTERFACE_LIBRARY)
277
+        if(MSVC)
278
+            set(COMPILE_OPTIONS
279
+                /permissive-
280
+                /WX
281
+                /W4
282
+            )
283
+        elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|.*Clang")
284
+            set(SANITIZE_OPTIONS)
285
+            if(PROJECT_IS_DEBUG AND NOT ARG_DISABLE_SANITIZERS)
286
+                set(SANITIZE_OPTIONS
287
+                    $<$<CONFIG:Debug>:
288
+                        -g -fno-omit-frame-pointer
289
+                        -fsanitize=address,leak,undefined
290
+                        -fsanitize=float-divide-by-zero
291
+                        -fsanitize=float-cast-overflow
292
+                        # -fsanitize=pointer-compare
293
+                        # -fsanitize=pointer-subtract
294
+                        # -fsanitize=implicit-conversion
295
+                        -fno-sanitize-recover=all
296
+                    >
297
+                )
298
+            endif()
299
+            set(WSHADOW_OPTION)
300
+            if(NOT ARG_DISABLE_WSHADOW)
301
+                set(WSHADOW_OPTION -Wshadow=local)
302
+            endif()
303
+            set(COMPILE_OPTIONS
304
+                -pedantic
305
+                -Werror -Wfatal-errors
306
+                -Wall -Wextra
307
+                -Wno-missing-braces -Wmissing-field-initializers
308
+                -Wconversion -Wsign-conversion
309
+                -Wdouble-promotion
310
+                -Wimplicit-fallthrough
311
+                -Wvla
312
+                -Wzero-as-null-pointer-constant
313
+                -Weffc++
314
+                ${WSHADOW_OPTION}
315
+                ${SANITIZE_OPTIONS}
316
+            )
317
+            set(LINK_OPTIONS
318
+                ${SANITIZE_OPTIONS}
319
+            )
320
+            check_ipo_supported(RESULT INTERPROCEDURAL_OPTIMIZATION)
321
+        endif()
322
+        set_property(TARGET ${PROJECT_NAME} ${TEST_TARGETS} APPEND PROPERTY
323
+            COMPILE_OPTIONS "${COMPILE_OPTIONS}"
324
+        )
325
+        set_property(TARGET ${PROJECT_NAME} ${TEST_TARGETS} APPEND PROPERTY
326
+            LINK_OPTIONS "${LINK_OPTIONS}"
327
+        )
328
+        set_property(TARGET ${PROJECT_NAME} ${TEST_TARGETS} APPEND PROPERTY
329
+            INTERPROCEDURAL_OPTIMIZATION "${INTERPROCEDURAL_OPTIMIZATION}"
330
+        )
331
+    endif()
332
+
333
+    ## Sanitizer environment variables
334
+    set(SAN_STRIP_PATH_PREFIX strip_path_prefix=${PROJECT_BINARY_DIR})
335
+    set(ASAN_OPTIONS  "${SAN_STRIP_PATH_PREFIX}")
336
+    set(LSAN_OPTIONS  "${SAN_STRIP_PATH_PREFIX}")
337
+    set(UBSAN_OPTIONS "${SAN_STRIP_PATH_PREFIX}")
338
+    file(GLOB ASAN_SUPP CONFIGURE_DEPENDS
339
+        .asan.supp
340
+    )
341
+    file(GLOB LSAN_SUPP CONFIGURE_DEPENDS
342
+        .lsan.supp
343
+    )
344
+    file(GLOB UBSAN_SUPP CONFIGURE_DEPENDS
345
+        .ubsan.supp
346
+    )
347
+    if(NOT "${ASAN_SUPP}" STREQUAL "")
348
+        set(ASAN_OPTIONS "${ASAN_OPTIONS},suppressions=${ASAN_SUPP}")
349
+    endif()
350
+    if(NOT "${LSAN_SUPP}" STREQUAL "")
351
+        set(LSAN_OPTIONS "${LSAN_OPTIONS},suppressions=${LSAN_SUPP}")
352
+    endif()
353
+    if(NOT "${UBSAN_SUPP}" STREQUAL "")
354
+        set(UBSAN_OPTIONS "${UBSAN_OPTIONS},suppressions=${UBSAN_SUPP}")
355
+    endif()
356
+    # set(ASAN_OPTIONS "${ASAN_OPTIONS},detect_leaks=1")
357
+    # set(UBSAN_OPTIONS "${UBSAN_OPTIONS},print_stacktrace=1")
358
+    set_property(TEST ${TEST_TARGETS} APPEND PROPERTY
359
+        ENVIRONMENT
360
+            ASAN_OPTIONS=${ASAN_OPTIONS}
361
+            LSAN_OPTIONS=${LSAN_OPTIONS}
362
+            UBSAN_OPTIONS=${UBSAN_OPTIONS}
363
+    )
364
+
365
+    ## Tools
366
+    if(
367
+        PROJECT_IS_TOP_LEVEL AND
368
+        PROJECT_IS_DEBUG AND
369
+        NOT PROJECT_IS_INTERFACE_LIBRARY
370
+    )
371
+        find_program(CPPCHECK             cppcheck)
372
+        find_program(CLANG_TIDY           clang-tidy)
373
+        find_program(INCLUDE_WHAT_YOU_USE include-what-you-use)
374
+        if(CPPCHECK AND NOT ARG_DISABLE_CPPCHECK)
375
+            set(CXX_CPPCHECK ${CPPCHECK}
376
+                --enable=warning,style
377
+                --inline-suppr
378
+                --template "{file}:{line}: ({severity} {id}) {message}"
379
+                --error-exitcode=1
380
+            )
381
+        endif()
382
+        if(CLANG_TIDY AND NOT ARG_DISABLE_CLANG_TIDY)
383
+            set(CXX_CLANG_TIDY ${CLANG_TIDY}
384
+                --extra-arg=-Wno-error=unknown-warning-option
385
+                --extra-arg=-Wno-error=ignored-optimization-argument
386
+            )
387
+        endif()
388
+        if(INCLUDE_WHAT_YOU_USE AND NOT ARG_DISABLE_INCLUDE_WHAT_YOU_USE)
389
+            set(CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE})
390
+        endif()
391
+        set_target_properties(${PROJECT_NAME} ${TEST_TARGETS} PROPERTIES
392
+            EXPORT_COMPILE_COMMANDS  ON
393
+            CXX_CPPCHECK             "${CXX_CPPCHECK}"
394
+            CXX_CLANG_TIDY           "${CXX_CLANG_TIDY}"
395
+            CXX_INCLUDE_WHAT_YOU_USE "${CXX_INCLUDE_WHAT_YOU_USE}"
396
+        )
397
+    endif()
398
+endfunction()