blob: 39513540925afaa981afd35a34c2452027194262 (
plain)
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
|
--- apitrace-apitrace-de9f3e5/cmake/FindSNAPPY.cmake
+++ apitrace-apitrace-de9f3e5/cmake/FindSNAPPY.cmake
@@ -0,0 +1,31 @@
+# Find SNAPPY - A fast compressor/decompressor
+#
+# This module defines
+# SNAPPY_FOUND - whether the qsjon library was found
+# SNAPPY_LIBRARIES - the snappy library
+# SNAPPY_INCLUDE_DIR - the include path of the snappy library
+#
+
+if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARIES)
+
+ # Already in cache
+ set (SNAPPY_FOUND TRUE)
+
+else (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARIES)
+
+ find_library (SNAPPY_LIBRARIES
+ NAMES
+ snappy
+ PATHS
+ )
+
+ find_path (SNAPPY_INCLUDE_DIR
+ NAMES
+ snappy.h
+ PATHS
+ )
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(SNAPPY DEFAULT_MSG SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
+
+endif (SNAPPY_INCLUDE_DIR AND SNAPPY_LIBRARIES)
--- apitrace-apitrace-de9f3e5/CMakeLists.txt
+++ apitrace-apitrace-de9f3e5/CMakeLists.txt
@@ -155,27 +155,16 @@
# - on unices to prevent symbol collisions when tracing applications that link
# against other versions of these libraries
-set (ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib)
-set (ZLIB_LIBRARIES z_bundled)
-add_subdirectory (thirdparty/zlib EXCLUDE_FROM_ALL)
-
-include_directories (${ZLIB_INCLUDE_DIRS})
+find_package (ZLIB REQUIRED)
+include_directories (${ZLIB_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib)
link_libraries (${ZLIB_LIBRARIES})
-set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
-set (SNAPPY_LIBRARIES snappy_bundled)
-add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL)
-
+find_package (SNAPPY REQUIRED)
include_directories (${SNAPPY_INCLUDE_DIRS})
link_libraries (${SNAPPY_LIBRARIES})
-set (PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libpng)
-set (PNG_DEFINITIONS "")
-set (PNG_LIBRARIES png_bundled)
-
-add_subdirectory (thirdparty/libpng EXCLUDE_FROM_ALL)
+find_package (PNG REQUIRED)
+include_directories (${PNG_INCLUDE_DIRS})
-include_directories (${PNG_INCLUDE_DIR})
-add_definitions (${PNG_DEFINITIONS})
link_libraries (${PNG_LIBRARIES})
if (MSVC)
|