Building 3rd party libraries


I’m starting to build OpenCV from source and have been sifting through the cmake configuration options. In particular, in the OpenCV documenation, I noticed that “BUILD_PROTOBUF” defaults to “ON”.

My questions:

  1. Is there a reason why BUILD_PROTOBUF is enabled by default?
  2. Is it best practice to install 3rd-party libraries via my system package manager? Or should we favor the bundled libraries?
  3. If I have have already installed protobuf binaries (let’s say from package manager), will I need to explicitly disable “BUILD_” options? Or can cmake detect this?

Thanks for any help.

  1. ppl usually don’t have a previous protobuf installation
  2. entirely up to you, however, the bundled 3rdparty modules are tried & tested. (might save you from linker / runtime errors later)
  3. if you disable BUILD_PROTOBUF, cmake will look for an already installed version
1 Like