Skip to content

Instantly share code, notes, and snippets.

@qrtt1
Created February 2, 2015 02:33
Show Gist options
  • Save qrtt1/6078efdee5937aac8765 to your computer and use it in GitHub Desktop.
Save qrtt1/6078efdee5937aac8765 to your computer and use it in GitHub Desktop.
pkg_check_modules(PC_LIBAO REQUIRED ao)
if(CMAKE_CROSSCOMPILING)
find_path(LIBAO_INCLUDE_DIR
NAMES
ao/ao.h
PATHS
${PC_LIBAO_INCLUDE_DIRS}
NO_DEFAULT_PATH
)
find_library(LIBAO_LIBRARY
NAMES
ao
PATHS
${PC_LIBAO_LIBRARY_DIRS}
NO_DEFAULT_PATH
)
else(CMAKE_CROSSCOMPILING)
find_path(LIBAO_INCLUDE_DIR
NAMES
ao/ao.h
PATHS
${PC_LIBAO_INCLUDE_DIRS}
)
find_library(LIBAO_LIBRARY
NAMES
ao
PATHS
${PC_LIBAO_LIBRARY_DIRS}
)
endif(CMAKE_CROSSCOMPILING)
set(LIBAO_LIBRARIES ${LIBAO_LIBRARY})
set(LIBAO_INCLUDE_DIRS ${LIBAO_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBAO DEFAULT_MSG
LIBAO_LIBRARY LIBAO_INCLUDE_DIR)
mark_as_advanced(LIBAO_LIBRARY LIBAO_INCLUDE_DIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment