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

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)
1.1.1.2 ! root        9: include(CheckSymbolExists)
1.1       root       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})
1.1.1.2 ! root       28:        set(CMAKE_REQUIRED_INCLUDES ${PORTMIDI_INCLUDE_DIR})
        !            29:        check_symbol_exists(Pm_Initialize "portmidi.h" HAVE_PM_INITIALIZE)
1.1       root       30:        if (NOT HAVE_PM_INITIALIZE)
                     31:                unset (PORTMIDI_FOUND)
                     32:        endif(NOT HAVE_PM_INITIALIZE)
                     33:        set(CMAKE_REQUIRED_LIBRARIES "")
1.1.1.2 ! root       34:        set(CMAKE_REQUIRED_INCLUDES "")
1.1       root       35: endif(PORTMIDI_FOUND)
                     36: 
                     37: 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.