Hp-Ux

hpux 上的tigervnc 和 cmake:為什麼找不到 zlib?

  • January 27, 2016

我使用這個腳本在 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)

我的腳本錯了嗎?

找到解決方案,必須使用此而不是導出

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 \

引用自:https://unix.stackexchange.com/questions/258107