From fe3702223f0d5c2bd36a3d4d98c423157f422c10 Mon Sep 17 00:00:00 2001 From: Alexandre Bouvier Date: Thu, 2 Nov 2023 18:53:40 +0100 Subject: cmake: prefer system simpleini library --- CMakeModules/FindSimpleIni.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 CMakeModules/FindSimpleIni.cmake (limited to 'CMakeModules') diff --git a/CMakeModules/FindSimpleIni.cmake b/CMakeModules/FindSimpleIni.cmake new file mode 100644 index 000000000..ce75d7690 --- /dev/null +++ b/CMakeModules/FindSimpleIni.cmake @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2023 Alexandre Bouvier +# +# SPDX-License-Identifier: GPL-3.0-or-later + +find_path(SimpleIni_INCLUDE_DIR SimpleIni.h) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SimpleIni + REQUIRED_VARS SimpleIni_INCLUDE_DIR +) + +if (SimpleIni_FOUND AND NOT TARGET SimpleIni::SimpleIni) + add_library(SimpleIni::SimpleIni INTERFACE IMPORTED) + set_target_properties(SimpleIni::SimpleIni PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SimpleIni_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(SimpleIni_INCLUDE_DIR) -- cgit v1.2.3