# Cmake build does not include svgz support

**URL:** https://forum.graphviz.org/t/cmake-build-does-not-include-svgz-support/1769
**Category:** Dev
**Created:** [September 7, 2023, 2:14am UTC](https://forum.graphviz.org/t/cmake-build-does-not-include-svgz-support/1769 "2023-09-07T02:14:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zosmac](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/zosmac/32/1185_2.png) [@zosmac](https://forum.graphviz.org/u/zosmac)
#### Post date: [September 7, 2023, 2:14am UTC](https://forum.graphviz.org/t/cmake-build-does-not-include-svgz-support/1769/1 "2023-09-07T02:14:52Z")

</div>

The cmake build scripts set HAVE\_ZLIB when atttempting to build with\_zlib. The existing autogen/configure build uses HAVE\_LIBZ. Hence, the C #define is not enabled. The following changes fix this:

./config-cmake.h.at line 40:  
#cmakedefine HAVE\_LIBZ

./cmake/config\_checks.cmake at line 37:  
set(HAVE\_LIBZ 1)

---

<div class="post-metadata">

### Author: ![zosmac](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/zosmac/32/1185_2.png) [@zosmac](https://forum.graphviz.org/u/zosmac)
#### Post date: [September 7, 2023, 2:22am UTC](https://forum.graphviz.org/t/cmake-build-does-not-include-svgz-support/1769/2 "2023-09-07T02:22:00Z")

</div>

```plaintext
diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake
index 57f9a19ad..6acaf7455 100644
--- a/cmake/config_checks.cmake
+++ b/cmake/config_checks.cmake
@@ -34,7 +34,7 @@ set( HAVE_LIBGD ${GD_FOUND} )
 set( HAVE_GS ${GS_FOUND} )
 set( HAVE_GTS ${GTS_FOUND} )
 if(with_zlib AND ZLIB_FOUND)
- set(HAVE_ZLIB 1)
+ set(HAVE_LIBZ 1)
 endif()
 set(HAVE_PANGOCAIRO ${PANGOCAIRO_FOUND})
 set(HAVE_POPPLER ${POPPLER_FOUND} )
diff --git a/config-cmake.h.in b/config-cmake.h.in
index 188a31e44..1e4e1ab57 100644
--- a/config-cmake.h.in
+++ b/config-cmake.h.in
@@ -37,7 +37,7 @@ typedef SSIZE_T ssize_t;
 #cmakedefine HAVE_GD_FONTCONFIG
 #cmakedefine HAVE_GD_FREETYPE
 #cmakedefine HAVE_GD_GIF
-#cmakedefine HAVE_ZLIB
+#cmakedefine HAVE_LIBZ
 #cmakedefine HAVE_GS
 #cmakedefine HAVE_GTS
 #cmakedefine HAVE_PANGOCAIRO

```

---

<div class="post-metadata">

### Author: ![mark](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/mark/32/84_2.png) [@mark](https://forum.graphviz.org/u/mark)
#### Post date: [September 7, 2023, 11:57am UTC](https://forum.graphviz.org/t/cmake-build-does-not-include-svgz-support/1769/3 "2023-09-07T11:57:25Z")

</div>

Thanks, well spotted. Do you want us to patch in your change or would you like to submit a merge request on gitlab?

---

<div class="post-metadata">

### Author: ![zosmac](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/zosmac/32/1185_2.png) [@zosmac](https://forum.graphviz.org/u/zosmac)
#### Post date: [September 7, 2023, 5:03pm UTC](https://forum.graphviz.org/t/cmake-build-does-not-include-svgz-support/1769/4 "2023-09-07T17:03:16Z")

</div>

Thank you for reaching out. If you wouldn’t mind applying it, I would be grateful.

I have a substantial rewrite of the MacOS code for the Graphviz.app (updated for ARC, other Objective-C features since Snow Leopard, etc.), built on Sonoma with Xcode 15).

Aside from the source code changes, would there be other MacOS specific updates of value I could look into?  
Thank you,  
Keefe (zosmac)
