]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: tidy up more value comparisons
authorViktor Szakats <commit@vsz.me>
Wed, 7 Aug 2024 21:40:05 +0000 (23:40 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 7 Aug 2024 21:41:27 +0000 (23:41 +0200)
- 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

CMakeLists.txt
docs/libcurl/CMakeLists.txt

index e2f931ce583c0aa1cb9a8778caa324bf0e83e360..a7872d18e4978bc7165bceca0b24249c2c9e2adf 100644 (file)
@@ -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")
index 8073695ba2f774f87c85ebbdf857ed6561065228..e1111081d4bbba4b7ffa9e5fa9c759807ddbc6bb 100644 (file)
@@ -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}