NAV

Import the external package

You can import protobuf as usual with PID. In the root CMakelists.txt file of your package, after the package declaration you have to write something like:

PID_Dependency(protobuf)

It will try to install last version of this external package.

If you want a specific version (recommended), for instance the currently last released version:

PID_Dependency(protobuf VERSION 3.7)

Components

libprotobuf

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	libprotobuf
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	libprotobuf
				PACKAGE	protobuf)

libprotobuf-st

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	libprotobuf-st
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	libprotobuf-st
				PACKAGE	protobuf)

libprotobuf-lite

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	libprotobuf-lite
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	libprotobuf-lite
				PACKAGE	protobuf)

libprotobuf-lite-st

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	libprotobuf-lite-st
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	libprotobuf-lite-st
				PACKAGE	protobuf)

libprotoc

exported dependencies:

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	libprotoc
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	libprotoc
				PACKAGE	protobuf)

libprotoc-st

exported dependencies:

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	libprotoc-st
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	libprotoc-st
				PACKAGE	protobuf)

protoc

CMake usage :

In the CMakeLists.txt files of your applications and tests, or those of your libraries that do not export the dependency:

PID_Component_Dependency(
				COMPONENT	your component name
				DEPEND	protoc
				PACKAGE	protobuf)

In the CMakeLists.txt files of libraries exporting the dependency :

PID_Component_Dependency(
				COMPONENT	your component name
				EXPORT	protoc
				PACKAGE	protobuf)