From: Nathan Moinvaziri Date: Sat, 19 Sep 2020 01:41:45 +0000 (-0700) Subject: Check if input variables are defined in cmake scripts. X-Git-Tag: 1.9.9-b1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bafc7db8fe601e8b3408795f9dd34ed1044a9213;p=thirdparty%2Fzlib-ng.git Check if input variables are defined in cmake scripts. --- diff --git a/cmake/run-and-compare.cmake b/cmake/run-and-compare.cmake index 2a6b14f07..8a4c750d1 100644 --- a/cmake/run-and-compare.cmake +++ b/cmake/run-and-compare.cmake @@ -1,4 +1,4 @@ -if(NOT OUTPUT OR NOT COMPARE OR NOT COMMAND) +if(NOT DEFINED OUTPUT OR NOT DEFINED COMPARE OR NOT DEFINED COMMAND) message(FATAL_ERROR "Run and compare arguments missing") endif() diff --git a/cmake/run-and-redirect.cmake b/cmake/run-and-redirect.cmake index 50eee981d..e55fc3a43 100644 --- a/cmake/run-and-redirect.cmake +++ b/cmake/run-and-redirect.cmake @@ -1,5 +1,5 @@ # If no output is specified, discard output -if(NOT OUTPUT) +if(NOT DEFINED OUTPUT) if(WIN32) set(OUTPUT NUL) else() diff --git a/cmake/test-compress.cmake b/cmake/test-compress.cmake index d2a7f33e5..76d45b130 100644 --- a/cmake/test-compress.cmake +++ b/cmake/test-compress.cmake @@ -3,21 +3,21 @@ if(TARGET) set(DECOMPRESS_TARGET ${TARGET}) endif() -if(NOT INPUT OR NOT COMPRESS_TARGET OR NOT DECOMPRESS_TARGET) +if(NOT DEFINED INPUT OR NOT DEFINED COMPRESS_TARGET OR NOT DEFINED DECOMPRESS_TARGET) message(FATAL_ERROR "Compress test arguments missing") endif() # Set default values -if(NOT COMPRESS_ARGS) +if(NOT DEFINED COMPRESS_ARGS) set(COMPRESS_ARGS -c -k) endif() -if(NOT DECOMPRESS_ARGS) +if(NOT DEFINED DECOMPRESS_ARGS) set(DECOMPRESS_ARGS -d -c) endif() -if(NOT GZIP_VERIFY) +if(NOT DEFINED GZIP_VERIFY) set(GZIP_VERIFY ON) endif() -if(NOT SUCCESS_EXIT) +if(NOT DEFINED SUCCESS_EXIT) set(SUCCESS_EXIT 0) endif()