Skip to content

Commit

Permalink
cmake: do not check PkgConfig availability for uwp
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam committed Nov 24, 2023
1 parent b4edada commit b3a7fc8
Showing 1 changed file with 38 additions and 36 deletions.
74 changes: 38 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b3a7fc8

Please sign in to comment.