ngscopeclient / scopehal-apps

ngscopeclient and other client applications for libscopehal.
https://www.ngscopeclient.org/
BSD 3-Clause "New" or "Revised" License
534 stars 83 forks source link

Install failure when not building docs #687

Closed rgov closed 4 months ago

rgov commented 4 months ago

I tried building within a Homebrew build context and it failed for being unable to find the manual PDF:

==> cmake -S . -B build -DBUILD_DOCS=NO -DCMAKE_INSTALL_RPATH=@loader_path/../lib
==> cmake --build build
==> cmake --install build
...
-- Install configuration: "Release"
CMake Error at build/doc/cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/tmp/ngscopeclient-20240210-40013-tg2ilb/build/doc/ngscopeclient-manual.pdf":
  No such file or directory.
Call Stack (most recent call first):
  build/cmake_install.cmake:42 (include)

As expected with -DBUILD_DOCS=NO, the build/doc directory is empty.

I suspect how the target is disabled in CMakeLists.txt:

https://github.com/ngscopeclient/scopehal-apps/blob/6d432152e6e75f38fb58343ac35c4b4f5c3129ad/CMakeLists.txt#L192-L196

https://github.com/ngscopeclient/scopehal-docs/blob/4ecb75522297410495cf0c0204bedcdf956e2c73/CMakeLists.txt#L83-L84

The doc/CMakeLists.txt is always included, and it always mandates the installation of the PDF file. Either this install should be OPTIONAL or the doc/CMakeLists.txt should be conditionally included as BUILD_TESTING is.

d235j commented 4 months ago

Fixed in https://github.com/ngscopeclient/scopehal-docs/pull/82.