blob: 39513540925afaa981afd35a34c2452027194262 [file] [log] [blame]
--- 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)