diff --git a/CMakeLists.txt b/CMakeLists.txt index 70da19d877..79dcac97fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,50 +460,52 @@ if(NOT WITH_SYSTEM_ZLIB) get_target_property(ZLIB_LIBRARY zlib LOCATION) endif() -find_package(PkgConfig) -if(PKG_CONFIG_FOUND AND NOT ANDROID AND NOT APPLE AND NOT LIBRETRO) - pkg_check_modules(AO IMPORTED_TARGET ao) - if(AO_FOUND) - target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LIBAO) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::AO) - endif() +if(NOT WINDOWS_STORE) + find_package(PkgConfig) + if(PKG_CONFIG_FOUND AND NOT ANDROID AND NOT APPLE AND NOT LIBRETRO) + pkg_check_modules(AO IMPORTED_TARGET ao) + if(AO_FOUND) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LIBAO) + target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::AO) + endif() - if(NOT SDL2_FOUND) - pkg_check_modules(LIBEVDEV IMPORTED_TARGET libevdev) - if(LIBEVDEV_FOUND) - target_compile_definitions(${PROJECT_NAME} PRIVATE USE_EVDEV) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBEVDEV) - - pkg_check_modules(LIBUDEV IMPORTED_TARGET libudev) - if(LIBUDEV_FOUND) - target_compile_definitions(${PROJECT_NAME} PRIVATE USE_UDEV) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBUDEV) + if(NOT SDL2_FOUND) + pkg_check_modules(LIBEVDEV IMPORTED_TARGET libevdev) + if(LIBEVDEV_FOUND) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_EVDEV) + target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBEVDEV) + + pkg_check_modules(LIBUDEV IMPORTED_TARGET libudev) + if(LIBUDEV_FOUND) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_UDEV) + target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBUDEV) + endif() endif() endif() - endif() - pkg_check_modules(LIBPULSE IMPORTED_TARGET libpulse) - if(LIBPULSE_FOUND) - target_compile_definitions(${PROJECT_NAME} PRIVATE USE_PULSEAUDIO) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBPULSE) - endif() + pkg_check_modules(LIBPULSE IMPORTED_TARGET libpulse) + if(LIBPULSE_FOUND) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_PULSEAUDIO) + target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBPULSE) + endif() - if(USE_HOST_LIBZIP) - pkg_check_modules(LIBZIP IMPORTED_TARGET libzip) - if(LIBZIP_FOUND) - target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBZIP) + if(USE_HOST_LIBZIP) + pkg_check_modules(LIBZIP IMPORTED_TARGET libzip) + if(LIBZIP_FOUND) + target_link_libraries(${PROJECT_NAME} PRIVATE PkgConfig::LIBZIP) + endif() endif() - endif() - if(ENABLE_OPROFILE) - target_compile_definitions(${PROJECT_NAME} PRIVATE DYNA_OPROF) - target_link_libraries(${PROJECT_NAME} PRIVATE opagent) - endif() + if(ENABLE_OPROFILE) + target_compile_definitions(${PROJECT_NAME} PRIVATE DYNA_OPROF) + target_link_libraries(${PROJECT_NAME} PRIVATE opagent) + endif() - find_package(MiniUPnPc) - if(MINIUPNP_FOUND) - target_include_directories(${PROJECT_NAME} PRIVATE ${MINIUPNP_INCLUDE_DIRS}) - target_link_libraries(${PROJECT_NAME} PRIVATE ${MINIUPNP_LIBRARIES}) + find_package(MiniUPnPc) + if(MINIUPNP_FOUND) + target_include_directories(${PROJECT_NAME} PRIVATE ${MINIUPNP_INCLUDE_DIRS}) + target_link_libraries(${PROJECT_NAME} PRIVATE ${MINIUPNP_LIBRARIES}) + endif() endif() endif()