From 9d727e4e55e1872452b32604e4a3d25277597ac6 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 27 Feb 2026 12:03:32 +0100 Subject: [PATCH] cmake: replace `list(FIND)` with `if(var IN_LIST list)` Available since CMake v3.3. Ref: https://cmake.org/cmake/help/latest/command/if.html#in-list Closes #20758 --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2419de626c..43fb01a48a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2204,8 +2204,7 @@ if(NOT CURL_DISABLE_INSTALL) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) cmake_path(SET _libdir NORMALIZE "${_libdir}") endif() - list(FIND _sys_libdirs "${_libdir}" _libdir_index) - if(_libdir_index LESS 0) + if(NOT _libdir IN_LIST _sys_libdirs) list(APPEND _ldflags "-L${_libdir}") endif() string(REGEX REPLACE "^lib" "" _libname "${_libname}") @@ -2233,8 +2232,7 @@ if(NOT CURL_DISABLE_INSTALL) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20) cmake_path(SET _libdir NORMALIZE "${_libdir}") endif() - list(FIND _sys_libdirs "${_libdir}" _libdir_index) - if(_libdir_index LESS 0) + if(NOT _libdir IN_LIST _sys_libdirs) list(APPEND _ldflags "-L${_libdir}") endif() endforeach()