From 5b10a804016e07e705d76e87824f4f6506a3adad Mon Sep 17 00:00:00 2001 From: TellowKrinkle Date: Sun, 16 Apr 2023 00:57:34 -0500 Subject: CMake: Use targets for all optionally-external dependencies --- Source/Core/AudioCommon/CMakeLists.txt | 2 +- Source/Core/Common/CMakeLists.txt | 11 ++++++----- Source/Core/Core/CMakeLists.txt | 14 ++++++-------- Source/Core/DiscIO/CMakeLists.txt | 2 +- Source/Core/InputCommon/CMakeLists.txt | 8 +++++--- Source/Core/UICommon/CMakeLists.txt | 6 +++--- Source/Core/UpdaterCommon/CMakeLists.txt | 2 +- Source/Core/VideoCommon/CMakeLists.txt | 2 +- 8 files changed, 24 insertions(+), 23 deletions(-) (limited to 'Source') diff --git a/Source/Core/AudioCommon/CMakeLists.txt b/Source/Core/AudioCommon/CMakeLists.txt index 18cc67470b..26dc443d90 100644 --- a/Source/Core/AudioCommon/CMakeLists.txt +++ b/Source/Core/AudioCommon/CMakeLists.txt @@ -83,7 +83,7 @@ PUBLIC common PRIVATE - cubeb + cubeb::cubeb SoundTouch FreeSurround) diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index d3a756e6e2..6233f847a0 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -144,16 +144,17 @@ endif() target_link_libraries(common PUBLIC ${CMAKE_THREAD_LIBS_INIT} - enet + enet::enet fmt::fmt - ${MBEDTLS_LIBRARIES} - minizip-ng + MbedTLS::mbedtls + minizip::minizip + sfml-network PRIVATE - ${CURL_LIBRARIES} + CURL::libcurl FatFs Iconv::Iconv - ${spng_target} + spng::spng ${VTUNE_LIBRARIES} ) diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index f6fb444118..b3eb8dac64 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -603,24 +603,23 @@ target_link_libraries(core PUBLIC audiocommon common - cubeb discio - enet + enet::enet expr inputcommon - ${MBEDTLS_LIBRARIES} + MbedTLS::mbedtls pugixml RangeSet::RangeSet sfml-network - sfml-system videonull videoogl videosoftware PRIVATE + cubeb::cubeb FatFs fmt::fmt - ${LZO} + LZO::LZO ZLIB::ZLIB ) @@ -644,9 +643,8 @@ elseif (ANDROID) ) endif() -if(LIBUSB_FOUND) - # Using shared LibUSB - target_link_libraries(core PUBLIC ${LIBUSB_LIBRARIES}) +if(TARGET LibUSB::LibUSB) + target_link_libraries(core PUBLIC LibUSB::LibUSB) target_sources(core PRIVATE IOS/USB/LibusbDevice.cpp IOS/USB/LibusbDevice.h diff --git a/Source/Core/DiscIO/CMakeLists.txt b/Source/Core/DiscIO/CMakeLists.txt index 44d4af95b8..11fb5cf52a 100644 --- a/Source/Core/DiscIO/CMakeLists.txt +++ b/Source/Core/DiscIO/CMakeLists.txt @@ -75,7 +75,7 @@ PUBLIC PRIVATE fmt::fmt - minizip-ng + minizip::minizip pugixml ZLIB::ZLIB ) diff --git a/Source/Core/InputCommon/CMakeLists.txt b/Source/Core/InputCommon/CMakeLists.txt index 0343717a34..ed19e12b74 100644 --- a/Source/Core/InputCommon/CMakeLists.txt +++ b/Source/Core/InputCommon/CMakeLists.txt @@ -81,7 +81,8 @@ PUBLIC PRIVATE fmt::fmt - ${spng_target} + sfml-network + spng::spng ) if(WIN32) @@ -146,7 +147,7 @@ elseif(ANDROID) endif() if(NOT ANDROID) - target_link_libraries(inputcommon PUBLIC ${LIBUSB_LIBRARIES}) + target_link_libraries(inputcommon PUBLIC LibUSB::LibUSB) endif() if(LIBEVDEV_FOUND AND LIBUDEV_FOUND) @@ -174,12 +175,13 @@ if(UNIX) ) endif() -if(SDL2_FOUND) +if(ENABLE_SDL) target_sources(inputcommon PRIVATE ControllerInterface/SDL/SDL.cpp ControllerInterface/SDL/SDL.h ) target_link_libraries(inputcommon PRIVATE SDL2::SDL2) + target_compile_definitions(inputcommon PUBLIC HAVE_SDL2=1) endif() if(MSVC) diff --git a/Source/Core/UICommon/CMakeLists.txt b/Source/Core/UICommon/CMakeLists.txt index 947aeae346..7505f9c9f5 100644 --- a/Source/Core/UICommon/CMakeLists.txt +++ b/Source/Core/UICommon/CMakeLists.txt @@ -29,7 +29,7 @@ target_link_libraries(uicommon PUBLIC common cpp-optparse - minizip-ng + minizip::minizip pugixml PRIVATE @@ -48,8 +48,8 @@ if(ENABLE_X11 AND X11_FOUND) target_link_libraries(uicommon PUBLIC ${XRANDR_LIBRARIES}) endif() -if(LIBUSB_FOUND) - target_link_libraries(uicommon PRIVATE ${LIBUSB_LIBRARIES}) +if(TARGET LibUSB::LibUSB) + target_link_libraries(uicommon PRIVATE LibUSB::LibUSB) endif() if(ENABLE_LLVM) diff --git a/Source/Core/UpdaterCommon/CMakeLists.txt b/Source/Core/UpdaterCommon/CMakeLists.txt index c026cd577d..9bc1f9ab45 100644 --- a/Source/Core/UpdaterCommon/CMakeLists.txt +++ b/Source/Core/UpdaterCommon/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(updatercommon target_link_libraries(updatercommon PRIVATE uicommon - mbedtls + MbedTLS::mbedtls ZLIB::ZLIB ed25519 cpp-optparse diff --git a/Source/Core/VideoCommon/CMakeLists.txt b/Source/Core/VideoCommon/CMakeLists.txt index ed8642fb1e..acb011cbb1 100644 --- a/Source/Core/VideoCommon/CMakeLists.txt +++ b/Source/Core/VideoCommon/CMakeLists.txt @@ -195,7 +195,7 @@ PUBLIC core PRIVATE fmt::fmt - ${spng_target} + spng::spng xxhash imgui implot -- cgit v1.2.3