From: Matthew Fernandez Date: Sat, 5 Nov 2022 21:05:01 +0000 (-0700) Subject: CMake: avoid referencing 'EXPAT_FOUND' when 'with_expat' is not set X-Git-Tag: 7.0.1~1^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78cff44f5cb106d904198a62a881ab51bf11a61f;p=graphviz CMake: avoid referencing 'EXPAT_FOUND' when 'with_expat' is not set CMake when using `--warn-uninitialized -Werror=dev` notices that this variable is being incorrectly referenced when `-Dwith_expat=OFF`: CMake Error (dev) at cmake/config_checks.cmake:40 (set): uninitialized variable 'EXPAT_FOUND' Call Stack (most recent call first): CMakeLists.txt:197 (include) Gitlab: #2291 --- diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index 4b9ab3e0c..e9a6ed6ac 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -37,7 +37,9 @@ check_type_size( intptr_t INTPTR_T ) # Library checks set( HAVE_ANN ${ANN_FOUND} ) -set( HAVE_EXPAT ${EXPAT_FOUND} ) +if(with_expat AND EXPAT_FOUND) + set(HAVE_EXPAT 1) +endif() set( HAVE_LIBGD ${GD_FOUND} ) set( HAVE_ZLIB ${ZLIB_FOUND} )