ukoethe / vigra

a generic C++ library for image analysis
http://ukoethe.github.io/vigra/
Other
407 stars 191 forks source link

add BUILD_TESTS and BUILD_DOCS CMake option variables #497

Closed Crghilardi closed 2 years ago

Crghilardi commented 3 years ago

Hello, I was recently trying to compile vigra as a shared library to link with another program. I did not have Doxygen in my build environment but did not need documentation or tests.

This PR adds two options to the top level CMakeLists.txt - BUILD_DOCS and BUILD_TESTS (both ON by default) that allow a user to specify if they want to compile those directories such as:

cmake .. -DBUILD_TESTS=OFF -DBUILD_DOCS=ON ...

hmeine commented 2 years ago

Looks useful and clean enough to merge, even to a CMake non-expert like myself. The flag names seem to be not unusual for this purpose, based on a quick web search, so :+1:.

ArchangeGabriel commented 2 years ago

Seems something was missed somewhere, because if I build with -DBUILD_DOCS=OFF, I get:

CMake Error at CMakeLists.txt:334 (ADD_DEPENDENCIES):
  The dependency target "doc_cpp" of target "PACKAGE_SRC_TAR" does not exist.