--- apitrace-apitrace-e2c4320.orig/cmake/FindSNAPPY.cmake +++ apitrace-apitrace-e2c4320/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-e2c4320.orig/CMakeLists.txt +++ apitrace-apitrace-e2c4320/CMakeLists.txt @@ -137,27 +137,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) - +find_package (ZLIB REQUIRED) include_directories (${ZLIB_INCLUDE_DIRS}) 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_DIR}) -add_definitions (${PNG_DEFINITIONS}) link_libraries (${PNG_LIBRARIES}) # The Qt website provides binaries for Windows and MacOSX, and they are