Annotation of hatari/cmake/FindPortMidi.cmake, revision 1.1.1.1

1.1       root        1: #
                      2: # Find the native PORTMIDI includes and library
                      3: #
                      4: #  PORTMIDI_INCLUDE_DIR  - where to find portmidi.h, etc.
                      5: #  PORTMIDI_LIBRARY      - List of libraries when using portmidi.
                      6: #  PORTMIDI_FOUND       - True if portmidi found.
                      7: 
                      8: include(FindPackageHandleStandardArgs)
                      9: include(CheckFunctionExists)
                     10: 
                     11: if(PORTMIDI_INCLUDE_DIR)
                     12:   # Already in cache, be silent
                     13:   set(PORTMIDI_FIND_QUIETLY TRUE)
                     14: endif(PORTMIDI_INCLUDE_DIR)
                     15: 
                     16: find_path(PORTMIDI_INCLUDE_DIR portmidi.h)
                     17: 
                     18: find_library(PORTMIDI_LIBRARY NAMES portmidi)
                     19: 
                     20: # handle the QUIETLY and REQUIRED arguments and set PORTMIDI_FOUND to TRUE if 
                     21: # all listed variables are TRUE
                     22: find_package_handle_standard_args(PORTMIDI DEFAULT_MSG
                     23:                                   PORTMIDI_LIBRARY PORTMIDI_INCLUDE_DIR)
                     24: 
                     25: # Check if it's really a portmidi installation...
                     26: if(PORTMIDI_FOUND)
                     27:        set(CMAKE_REQUIRED_LIBRARIES ${PORTMIDI_LIBRARY})
                     28:        check_function_exists(Pm_Initialize HAVE_PM_INITIALIZE)
                     29:        if (NOT HAVE_PM_INITIALIZE)
                     30:                unset (PORTMIDI_FOUND)
                     31:        endif(NOT HAVE_PM_INITIALIZE)
                     32:        set(CMAKE_REQUIRED_LIBRARIES "")
                     33: endif(PORTMIDI_FOUND)
                     34: 
                     35: 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.