Solução encontrada, deve usar isso em vez de exportar
cmake \
-G "Unix Makefiles" \
-DCMAKE_C_FLAGS:STRING="$HPUXCFLAGS" \
-DCMAKE_LD_FLAGS:STRING="$HPUXLDFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$HPUXCFLAGS" \
-DZLIB_LIBRARY="/usr/local/lib/hpux32" \
-DZLIB_INCLUDE_DIR="/usr/local/include" \
-Wno-dev \
-DCMAKE_INSTALL_PREFIX=/opt/tigervnc \
-DMAN_INSTALL_DIR=/opt/tigervnc/man \
-DSYSCONF_INSTALL_DIR=/etc/opt/tigervnc \
-DENABLE_PAM:BOOL=OFF \
-DBUILD_JAVA:BOOL=ON \