summaryrefslogtreecommitdiff
path: root/CMakeModules
diff options
context:
space:
mode:
authorGravatar Alexandre Bouvier2023-10-12 16:36:26 +0200
committerGravatar Alexandre Bouvier2023-10-25 21:47:32 +0200
commit79ba5d9c260ca4e2890b8e9c9efd79e3df5fe763 (patch)
tree31f33d5ccac863e5584b3be53cd2e07a314c9b8e /CMakeModules
parentMerge pull request #11812 from german77/save_capture (diff)
downloadyuzu-79ba5d9c260ca4e2890b8e9c9efd79e3df5fe763.tar.gz
yuzu-79ba5d9c260ca4e2890b8e9c9efd79e3df5fe763.tar.xz
yuzu-79ba5d9c260ca4e2890b8e9c9efd79e3df5fe763.zip
cmake: prefer system stb headers
Diffstat (limited to 'CMakeModules')
-rw-r--r--CMakeModules/Findstb.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/CMakeModules/Findstb.cmake b/CMakeModules/Findstb.cmake
new file mode 100644
index 000000000..bff998580
--- /dev/null
+++ b/CMakeModules/Findstb.cmake
@@ -0,0 +1,31 @@
1# SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf>
2#
3# SPDX-License-Identifier: GPL-3.0-or-later
4
5find_path(stb_image_INCLUDE_DIR stb_image.h PATH_SUFFIXES stb)
6find_path(stb_image_resize_INCLUDE_DIR stb_image_resize.h PATH_SUFFIXES stb)
7find_path(stb_image_write_INCLUDE_DIR stb_image_write.h PATH_SUFFIXES stb)
8
9include(FindPackageHandleStandardArgs)
10find_package_handle_standard_args(stb
11 REQUIRED_VARS
12 stb_image_INCLUDE_DIR
13 stb_image_resize_INCLUDE_DIR
14 stb_image_write_INCLUDE_DIR
15)
16
17if (stb_FOUND AND NOT TARGET stb::headers)
18 add_library(stb::headers INTERFACE IMPORTED)
19 set_property(TARGET stb::headers PROPERTY
20 INTERFACE_INCLUDE_DIRECTORIES
21 "${stb_image_INCLUDE_DIR}"
22 "${stb_image_resize_INCLUDE_DIR}"
23 "${stb_image_write_INCLUDE_DIR}"
24 )
25endif()
26
27mark_as_advanced(
28 stb_image_INCLUDE_DIR
29 stb_image_resize_INCLUDE_DIR
30 stb_image_write_INCLUDE_DIR
31)