File: FindZstd.cmake

package info (click to toggle)
libpappsomspp 0.11.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,032 kB
  • sloc: cpp: 78,332; xml: 44,164; python: 668; sql: 186; sh: 33; makefile: 31
file content (43 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (5)
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
find_path(Zstd_INCLUDE_DIRS zstd.h
  PATHS /usr/local/include /usr/include)


find_library(Zstd_LIBRARY NAMES zstd
  HINTS /usr/lib /usr/local/lib)

if(Zstd_INCLUDE_DIRS AND Zstd_LIBRARY)

  mark_as_advanced(Zstd_INCLUDE_DIRS)
  mark_as_advanced(Zstd_LIBRARY)

  set(Zstd_FOUND TRUE)

endif()

if(Zstd_FOUND)

  if(NOT Zstd_FIND_QUIETLY)
    message(STATUS "Found Zstd_LIBRARY: ${Zstd_LIBRARY}")
  endif()

  if(NOT TARGET Zstd::Zstd)

    add_library(Zstd::Zstd UNKNOWN IMPORTED)

    set_target_properties(Zstd::Zstd PROPERTIES
      IMPORTED_LOCATION             "${Zstd_LIBRARY}"
      INTERFACE_INCLUDE_DIRECTORIES "${Zstd_INCLUDE_DIRS}")

  endif()

else()

  if(Zstd_FIND_REQUIRED)

    message(FATAL_ERROR "Could not find libzstd. Please do specify the
    Zstd_INCLUDE_DIRS and Zstd_LIBRARY variables using cmake!")

  endif()

endif()