From: Viktor Szakats Date: Wed, 7 Aug 2024 21:40:05 +0000 (+0200) Subject: cmake: tidy up more value comparisons X-Git-Tag: curl-8_10_0~328 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d6fb0f58f508921acfa9348f7b0c5de2a813fb3;p=thirdparty%2Fcurl.git cmake: tidy up more value comparisons - unquote numeric value. - `NOT LESS` -> `GREATER_EQUAL`. - replace macro with variable name. It also avoids this error when the variable is undefined: ``` CMake Error at CMakeLists.txt:1529 (if): if given arguments: "GREATER" "4" Unknown arguments specified ``` https://github.com/curl/curl/actions/runs/10289921657/job/28478722584#step:30:356 Follow-up to 72ae0d86a42fea83612d8baf59cff2f945aca22a #14409 Follow-up to acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197 Closes #14449 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e2f931ce58..a7872d18e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1526,7 +1526,7 @@ set(CMAKE_REQUIRED_FLAGS) option(ENABLE_WEBSOCKETS "Set to ON to enable EXPERIMENTAL websockets" OFF) if(ENABLE_WEBSOCKETS) - if(${SIZEOF_CURL_OFF_T} GREATER "4") + if(SIZEOF_CURL_OFF_T GREATER 4) set(USE_WEBSOCKETS ON) else() message(WARNING "curl_off_t is too small to enable WebSockets") diff --git a/docs/libcurl/CMakeLists.txt b/docs/libcurl/CMakeLists.txt index 8073695ba2..e1111081d4 100644 --- a/docs/libcurl/CMakeLists.txt +++ b/docs/libcurl/CMakeLists.txt @@ -38,7 +38,7 @@ function(add_manual_pages _listname) set(_eol "_EOL_") foreach(_file IN LISTS ${_listname} _eol) math(EXPR _file_count "${_file_count} + 1") - if(NOT _file_count LESS ${_files_per_batch} OR _file STREQUAL "_EOL_") + if(_file_count GREATER_EQUAL _files_per_batch OR _file STREQUAL "_EOL_") add_custom_command(OUTPUT ${_rofffiles} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND "${PERL_EXECUTABLE}" "${PROJECT_SOURCE_DIR}/scripts/cd2nroff" -k -d "${CMAKE_CURRENT_BINARY_DIR}" ${_mdfiles}