all repos — mgba @ c7a1894a99aa7b96d1bef16110be2572002b5386

mGBA Game Boy Advance Emulator

Fix pkg-config overwriting find_package results
Jeffrey Pfau jeffrey@endrift.com
Sat, 25 Oct 2014 01:43:05 -0700
commit

c7a1894a99aa7b96d1bef16110be2572002b5386

parent

a265cf45a92bb76e21d386c0974deb137267ec2e

1 files changed, 11 insertions(+), 7 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -31,12 +31,16 @@ if (NOT ${FEATURE_NAME})

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 @@

# 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)