mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
52e42c2f74
This makes CMake look at the provided libraries before considering system libraries. Enable this by default on Windows. Fixes #830.
28 lines
664 B
CMake
28 lines
664 B
CMake
find_package(PkgConfig QUIET)
|
|
pkg_check_modules(PC_OGG ogg)
|
|
|
|
set_extra_dirs(OGG opus)
|
|
|
|
find_path(OGG_INCLUDEDIR ogg.h
|
|
PATH_SUFFIXES ogg
|
|
HINTS ${HINTS_OGG_INCLUDEDIR} ${PC_OGG_INCLUDEDIR} ${PC_OGG_INCLUDE_DIRS}
|
|
PATHS ${PATHS_OGG_INCLUDEDIR}
|
|
)
|
|
find_library(OGG_LIBRARY
|
|
NAMES ogg
|
|
HINTS ${HINTS_OGG_LIBDIR} ${PC_OGG_LIBDIR} ${PC_OGG_LIBRARY_DIRS}
|
|
PATHS ${PATHS_OGG_LIBDIR}
|
|
)
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(Ogg DEFAULT_MSG OGG_INCLUDEDIR)
|
|
|
|
mark_as_advanced(OGG_INCLUDEDIR OGG_LIBRARY)
|
|
|
|
set(OGG_INCLUDE_DIRS ${OGG_INCLUDEDIR})
|
|
if(OGG_LIBRARY)
|
|
set(OGG_LIBRARIES ${OGG_LIBRARY})
|
|
else()
|
|
set(OGG_LIBRARIES)
|
|
endif()
|