0

I'm building libzip [version 1.7.3]. The package uses CMake.

I do the following as initial setup:

wget -c https://github.com/nih-at/libzip/releases/download/v1.7.3/libzip-1.7.3.tar.gz
tar -zxf libzip-1.7.3.tar.gz
cd libzip-1.7.3
mkdir build && cd build

And then I run the following:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..

However, Cmake seems unable to find libbz2 as I get the following among the list of messages:

-- Found BZip2: /Library/Frameworks/libbz2.framework (found version "1.0") 

I had previously installed libbz2 [and other dependencies like GnuTLS, Nettle, XZ, etc.] in /usr/local, and I can verify that libbz2.dylib is in /usr/local/lib.

I've tried setting CMAKE_PREFIX_PATH speifically to /usr/local. And I've also tinkered with FindBZip2.cmake, but I'm not a CMake expert so I didn't go beyond changing variable assignments [specifically forcing /usr/local to no avail].

It only works when I delete libbz2.framework, but that isn't a workable solution.

Is there way around this?

ObiHill
  • 11,448
  • 20
  • 86
  • 135

1 Answers1

0
cmake -DCMAKE_IGNORE_PATH=/Library/Frameworks -DCMAKE_INSTALL_PREFIX=/usr/local ..

See cmake docs on CMAKE_IGNORE_PATH for more information.

ObiHill
  • 11,448
  • 20
  • 86
  • 135
  • Setting the variable `CMAKE_IGNORE_PATH` from the command line (with `-D` option for `cmake`) contradicts **intention** of the variable. The documentation states that "it is intended to be set by the project". – Tsyvarev Apr 20 '21 at 22:34
  • @Tsyvarev Yes. However, this is an ideal expectation. Given the differences between various UNIX platforms, and perhaps the project's inability to test all platforms in various circumstances, not every issue in installation can be envisaged beforehand. – ObiHill Apr 21 '21 at 07:59