mirror of https://github.com/mgba-emu/mgba.git
Fix pkg-config overwriting find_package results
This commit is contained in:
parent
a265cf45a9
commit
c7a1894a99
|
@ -31,12 +31,16 @@ function(find_feature FEATURE_NAME FEATURE_REQUIRES)
|
|||
return()
|
||||
endif()
|
||||
foreach(REQUIRE ${FEATURE_REQUIRES})
|
||||
find_package(${REQUIRE} QUIET)
|
||||
pkg_search_module(${REQUIRE} ${REQUIRE})
|
||||
if (NOT ${REQUIRE}_FOUND)
|
||||
message(WARNING "Requested module ${REQUIRE} missing for feature ${FEATURE_NAME}. Feature disabled.")
|
||||
set(${FEATURE_NAME} OFF PARENT_SCOPE)
|
||||
return()
|
||||
if(NOT ${REQUIRE}_FOUND)
|
||||
find_package(${REQUIRE} QUIET)
|
||||
if(NOT ${REQUIRE}_FOUND)
|
||||
pkg_search_module(${REQUIRE} ${REQUIRE})
|
||||
if (NOT ${REQUIRE}_FOUND)
|
||||
message(WARNING "Requested module ${REQUIRE} missing for feature ${FEATURE_NAME}. Feature disabled.")
|
||||
set(${FEATURE_NAME} OFF PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
string(TOUPPER ${REQUIRE} UREQUIRE)
|
||||
set(${UREQUIRE}_CFLAGS_OTHER ${${REQUIRE}_CFLAGS_OTHER} PARENT_SCOPE)
|
||||
|
@ -78,7 +82,7 @@ add_definitions(-DBINARY_NAME="${BINARY_NAME}" -DPROJECT_NAME="${PROJECT_NAME}"
|
|||
# Feature dependencies
|
||||
find_feature(USE_CLI_DEBUGGER "libedit")
|
||||
find_feature(USE_FFMPEG "libavcodec;libavformat;libavutil")
|
||||
find_feature(USE_PNG "PNG;ZLIB")
|
||||
find_feature(USE_PNG "ZLIB;PNG")
|
||||
find_feature(USE_LIBZIP "libzip")
|
||||
|
||||
include(CheckFunctionExists)
|
||||
|
|
Loading…
Reference in New Issue