File:  [HATARI the Atari ST Emulator] / hatari / cmake / FindPortMidi.cmake
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 9 08:58:46 2019 UTC (7 years, 1 month ago) by root
Branches: hatari, MAIN
CVS tags: hatari02210, hatari02200, HEAD
hatari 2.2.0

#
# Find the native PORTMIDI includes and library
#
#  PORTMIDI_INCLUDE_DIR  - where to find portmidi.h, etc.
#  PORTMIDI_LIBRARY      - List of libraries when using portmidi.
#  PORTMIDI_FOUND       - True if portmidi found.

include(FindPackageHandleStandardArgs)
include(CheckSymbolExists)

if(PORTMIDI_INCLUDE_DIR)
  # Already in cache, be silent
  set(PORTMIDI_FIND_QUIETLY TRUE)
endif(PORTMIDI_INCLUDE_DIR)

find_path(PORTMIDI_INCLUDE_DIR portmidi.h)

find_library(PORTMIDI_LIBRARY NAMES portmidi)

# handle the QUIETLY and REQUIRED arguments and set PORTMIDI_FOUND to TRUE if 
# all listed variables are TRUE
find_package_handle_standard_args(PORTMIDI DEFAULT_MSG
                                  PORTMIDI_LIBRARY PORTMIDI_INCLUDE_DIR)

# Check if it's really a portmidi installation...
if(PORTMIDI_FOUND)
	set(CMAKE_REQUIRED_LIBRARIES ${PORTMIDI_LIBRARY})
	set(CMAKE_REQUIRED_INCLUDES ${PORTMIDI_INCLUDE_DIR})
	check_symbol_exists(Pm_Initialize "portmidi.h" HAVE_PM_INITIALIZE)
	if (NOT HAVE_PM_INITIALIZE)
		unset (PORTMIDI_FOUND)
	endif(NOT HAVE_PM_INITIALIZE)
	set(CMAKE_REQUIRED_LIBRARIES "")
	set(CMAKE_REQUIRED_INCLUDES "")
endif(PORTMIDI_FOUND)

mark_as_advanced(PORTMIDI_LIBRARY PORTMIDI_INCLUDE_DIR)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.