From 04b1c78166571458234fe2f57f46ad0b543ded8c Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Tue, 10 Aug 2021 16:16:02 +0200 Subject: [PATCH] cmake: Add checks for projects using dynarmic as subproject --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aee640fb..13e8434e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,16 +121,16 @@ if (NOT TARGET boost) target_include_directories(boost SYSTEM INTERFACE ${Boost_INCLUDE_DIRS}) endif() -if (DYNARMIC_NO_BUNDLED_FMT) +if (DYNARMIC_NO_BUNDLED_FMT AND NOT TARGET fmt) find_package(fmt REQUIRED) add_library(fmt ALIAS fmt::fmt) endif() -if (DYNARMIC_NO_BUNDLED_ROBIN_MAP) +if (DYNARMIC_NO_BUNDLED_ROBIN_MAP AND NOT TARGET tsl::robin_map) find_package(tsl-robin-map REQUIRED) endif() -if (DYNARMIC_NO_BUNDLED_XBYAK) +if (DYNARMIC_NO_BUNDLED_XBYAK AND NOT TARGET xbyak) if (ARCHITECTURE STREQUAL "x86" OR ARCHITECTURE STREQUAL "x86_64") find_package(xbyak REQUIRED) add_library(xbyak ALIAS xbyak::xbyak) @@ -152,7 +152,7 @@ if (DYNARMIC_TESTS_USE_UNICORN) find_package(Unicorn REQUIRED) endif() -if (DYNARMIC_TESTS AND DYNARMIC_NO_BUNDLED_CATCH) +if (DYNARMIC_TESTS AND DYNARMIC_NO_BUNDLED_CATCH AND NOT TARGET catch) find_package(Catch2 REQUIRED) add_library(catch ALIAS Catch2::Catch2) endif()