From e687994e85672f71770a05188d61ff41f5ccf465 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Fri, 14 Jun 2024 23:33:29 +0200 Subject: [PATCH] CMake: Add FindLibJuice module --- cmake/Modules/FindLibJuice.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cmake/Modules/FindLibJuice.cmake diff --git a/cmake/Modules/FindLibJuice.cmake b/cmake/Modules/FindLibJuice.cmake new file mode 100644 index 0000000..2a01c48 --- /dev/null +++ b/cmake/Modules/FindLibJuice.cmake @@ -0,0 +1,17 @@ +if (NOT TARGET LibJuice::LibJuice) + find_path(JUICE_INCLUDE_DIR juice/juice.h) + find_library(JUICE_LIBRARY NAMES juice) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(LibJuice DEFAULT_MSG JUICE_LIBRARY JUICE_INCLUDE_DIR) + + if (LibJuice_FOUND) + add_library(LibJuice::LibJuice UNKNOWN IMPORTED) + set_target_properties(LibJuice::LibJuice PROPERTIES + IMPORTED_LOCATION "${JUICE_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${JUICE_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${JUICE_LIBRARIES}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C") + endif () +endif () +