Fixed an annoying CMake issue that also broke the macOS build.

This commit is contained in:
Leon Styhre 2020-11-27 20:04:02 +01:00
parent b8de48ae98
commit cc93ca4630
2 changed files with 12 additions and 19 deletions

View file

@ -14,6 +14,8 @@ include(FindPkgMacros)
if(NOT WIN32) if(NOT WIN32)
find_package(PkgConfig) find_package(PkgConfig)
pkg_check_modules(PUGIXML REQUIRED pugixml>=1.09) pkg_check_modules(PUGIXML REQUIRED pugixml>=1.09)
# Set the full path to the library instead of just 'pugixml'.
set(PUGIXML_LIBRARIES ${PUGIXML_LINK_LIBRARIES})
endif(NOT WIN32) endif(NOT WIN32)
if(WIN32) if(WIN32)
@ -39,4 +41,4 @@ endif()
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found. # Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(pugixml DEFAULT_MSG PUGIXML_LIBRARY) find_package_handle_standard_args(Pugixml DEFAULT_MSG PUGIXML_LIBRARY)

View file

@ -64,21 +64,12 @@ if(NOT WIN32)
find_package(CURL REQUIRED) find_package(CURL REQUIRED)
find_package(FreeImage REQUIRED) find_package(FreeImage REQUIRED)
find_package(Freetype REQUIRED) find_package(Freetype REQUIRED)
find_package(Pugixml REQUIRED)
find_package(RapidJSON REQUIRED) find_package(RapidJSON REQUIRED)
find_package(SDL2 REQUIRED) find_package(SDL2 REQUIRED)
find_package(VLC REQUIRED) find_package(VLC REQUIRED)
endif() endif()
if(APPLE)
# For some strange reason, macOS complains about an uppercase 'P' in Pugixml.
# FreeBSD, NetBSD and OpenBSD also complain about this, but applying the same rule to
# these OSs lead to linking issues for some reason, so we'll have to live with those
# warnings for now.
find_package(pugixml REQUIRED)
elseif(UNIX)
find_package(Pugixml REQUIRED)
endif()
# Add libCEC support. # Add libCEC support.
if(CEC) if(CEC)
find_package(libCEC REQUIRED) find_package(libCEC REQUIRED)