File: FindLibmagic.cmake

package info (click to toggle)
createrepo-c 0.17.0-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 3,288 kB
  • sloc: ansic: 28,398; python: 4,667; xml: 1,420; sh: 369; makefile: 19; perl: 7
file content (25 lines) | stat: -rw-r--r-- 680 bytes parent folder | download
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
#
# Find libmagic.so (part of the 'file' package)
# (C) 2009 by Lorenzo Villani. Licensed under LGPL license.
#

include(LibFindMacros)


# Include dir
find_path(Libmagic_INCLUDE_DIR
  NAMES magic.h
  PATHS ${CMAKE_INCLUDE_PATH}
)

# Finally the library itself
find_library(Libmagic_LIBRARY
  NAMES magic
  PATHS ${CMAKE_LIBRARY_PATH}
)

# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(Libmagic_PROCESS_INCLUDES Libmagic_INCLUDE_DIR Libmagic_INCLUDE_DIRS)
set(Libmagic_PROCESS_LIBS Libmagic_LIBRARY Libmagic_LIBRARIES)
libfind_process(Libmagic)