File: FindPORTMIDI.cmake

package info (click to toggle)
csound 1%3A6.18.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 63,220 kB
  • sloc: ansic: 192,643; cpp: 14,149; javascript: 9,654; objc: 9,181; python: 3,376; java: 3,337; sh: 1,840; yacc: 1,255; xml: 985; perl: 635; lisp: 411; tcl: 341; lex: 217; makefile: 128
file content (49 lines) | stat: -rw-r--r-- 1,198 bytes parent folder | download | duplicates (2)
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
#  PORTMIDI_FOUND - system has libportmidi
#  PORTMIDI_INCLUDE_DIRS - the libportmidi include directory
#  PORTMIDI_LIBRARIES - Link these to use libportmidi

if (PORTMIDI_LIBRARIES AND PORTMIDI_INCLUDE_DIRS)
  # in cache already
  set(PORTMIDI_FOUND TRUE)
else ()
  find_path(PORTMIDI_INCLUDE_DIR
    NAMES
      portmidi.h
    PATHS
      /usr/include
      /usr/local/include
      /opt/local/include
      /sw/include
  )

  find_library(PORTMIDI_LIBRARY
    NAMES
      portmidi
      portmidi_s
    PATHS
      /usr/lib
      /usr/local/lib
      /opt/local/lib
      /sw/lib
  )

  set(PORTMIDI_INCLUDE_DIRS ${PORTMIDI_INCLUDE_DIR})
  set(PORTMIDI_LIBRARIES ${PORTMIDI_LIBRARY})

  if (PORTMIDI_INCLUDE_DIRS AND PORTMIDI_LIBRARIES)
    set(PORTMIDI_FOUND TRUE)
  endif ()

  if (PORTMIDI_FOUND)
    if (NOT Portmidi_FIND_QUIETLY)
      message(STATUS "Found PortMidi: ${PORTMIDI_LIBRARIES}")
    endif ()
  else ()
    if (Portmidi_FIND_REQUIRED)
      message(FATAL_ERROR "Could not find PortMidi")
    endif ()
  endif()

  # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view
  mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
endif()