blob: e470b7dc1a18f4ef349c6eaa0ebdbe1df9b53865 (
plain) (
blame)
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
|
--- thirdparty/CMakeLists.txt.orig 2025-06-26 12:43:44 UTC
+++ thirdparty/CMakeLists.txt
@@ -16,56 +16,70 @@ endfunction ()
include (${ARGV})
endfunction ()
-set (SUBMODULES_MISSING FALSE)
-foreach (path IN ITEMS
- brotli/LICENSE
- gtest/LICENSE
- libbacktrace/LICENSE
- libpng/LICENSE
- snappy/COPYING
- zlib/README
- directxmath/LICENSE
-)
- if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
- message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist")
- set (SUBMODULES_MISSING TRUE)
- endif ()
-endforeach ()
-if (SUBMODULES_MISSING)
- message (FATAL_ERROR "Update Git submodules by running\ngit submodule update --init --depth 1 --recursive")
-endif ()
+#set (SUBMODULES_MISSING FALSE)
+#foreach (path IN ITEMS
+# brotli/LICENSE
+# gtest/LICENSE
+# libbacktrace/LICENSE
+# libpng/LICENSE
+# snappy/COPYING
+# zlib/README
+# directxmath/LICENSE
+#)
+# if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
+# message (SEND_ERROR "error: ${CMAKE_CURRENT_SOURCE_DIR}/${path} does not exist")
+# set (SUBMODULES_MISSING TRUE)
+# endif ()
+#endforeach ()
+#if (SUBMODULES_MISSING)
+# message (FATAL_ERROR "Update Git submodules by running\ngit submodule update --init --depth 1 --recursive")
+#endif ()
-if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND)
- message (STATUS "Using bundled Snappy")
- include_with_scope (snappy.cmake)
-endif ()
+#if (ENABLE_STATIC_SNAPPY OR NOT Snappy_FOUND)
+# message (STATUS "Using bundled Snappy")
+# include_with_scope (snappy.cmake)
+#endif ()
-if (NOT ZLIB_FOUND)
- message (STATUS "Using bundled ZLIB")
- include_with_scope (zlib.cmake)
-endif ()
+#if (NOT ZLIB_FOUND)
+# message (STATUS "Using bundled ZLIB")
+# include_with_scope (zlib.cmake)
+#endif ()
-if (NOT PNG_FOUND)
- message (STATUS "Using bundled PNG")
- include_with_scope (libpng.cmake)
-endif ()
+#if (NOT PNG_FOUND)
+# message (STATUS "Using bundled PNG")
+# include_with_scope (libpng.cmake)
+#endif ()
-if (NOT BROTLIDEC_FOUND OR NOT BROTLIENC_FOUND)
- message (STATUS "Using bundled Brotli")
- include_with_scope (brotli.cmake)
-endif ()
+#if (NOT BROTLIDEC_FOUND OR NOT BROTLIENC_FOUND)
+# message (STATUS "Using bundled Brotli")
+# include_with_scope (brotli.cmake)
+#endif ()
-if (CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
- include_with_scope (libbacktrace.cmake)
-endif ()
+#if (CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+# include_with_scope (libbacktrace.cmake)
+#endif ()
-if (BUILD_TESTING)
- # We use non-standard C++ flags, so we can't just use GTest's CMakeLists.txt
- if (NOT GTEST_FOUND)
- message (STATUS "Using bundled GTest")
- include_with_scope (gtest.cmake)
- endif ()
-endif ()
+#if (BUILD_TESTING)
+# # We use non-standard C++ flags, so we can't just use GTest's CMakeLists.txt
+# if (NOT GTEST_FOUND)
+# message (STATUS "Using bundled GTest")
+# include_with_scope (gtest.cmake)
+# endif ()
+#endif ()
+
+find_path(Snappy_INCLUDE_DIR NAMES snappy.h
+ PATHS ${Snappy_ROOT_DIR} ${Snappy_ROOT_DIR}/include /usr/local/include)
+
+find_library(Snappy_LIBRARIES NAMES snappy
+ PATHS ${Snappy_ROOT_DIR} ${Snappy_ROOT_DIR}/lib /usr/local/lib)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Snappy DEFAULT_MSG Snappy_INCLUDE_DIR Snappy_LIBRARIES)
+
+if(SNAPPY_FOUND)
+ message(STATUS "Found Snappy (include: ${Snappy_INCLUDE_DIR}, library: ${Snappy_LIBRARIES})")
+ mark_as_advanced(Snappy_INCLUDE_DIR Snappy_LIBRARIES)
+endif()
if (MSVC)
add_subdirectory (getopt)
|