hpux 上的 Tigervnc 和 cmake:为什么找不到 zlib?

hpux 上的 Tigervnc 和 cmake:为什么找不到 zlib?

我使用这个脚本在hpux上配置tigervnc cmake是最新的3.4.3 zlib是最新的2.8 但是脚本失败,为什么?

export PATH=$PATH:/opt/cmake/bin/
export CC="/usr/local/bin/gcc"
export HPUXLDFLAGS='-L/usr/local/lib/hpux32'
export HPUXCFLAGS='-I/usr/local/include' 
export LDFLAGS="$HPUXLDFLAGS"
export CFLAGS="$HPUXCFLAGS"

cmake \
    -G "Unix Makefiles" \
    -DCMAKE_C_FLAGS:STRING="$HPUXCFLAGS" \
    -DCMAKE_LD_FLAGS:STRING="$HPUXLDFLAGS" \
    -DCMAKE_CXX_FLAGS:STRING="$HPUXCFLAGS" \
    -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 \
    ..

脚本因这些行而失败

-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/hpux32/libX11.so
CMake Error at /opt/cmake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.8")
Call Stack (most recent call first):
  /opt/cmake/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /opt/cmake/share/cmake-3.4/Modules/FindZLIB.cmake:124 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:125 (find_package)

我的剧本有错吗?

答案1

找到解决方案,必须使用它而不是导出

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 \

相关内容