Skip to content

Commit

Permalink
refactor(doc): Prefer pkg-config for using open62541 as a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfr committed May 13, 2024
1 parent b3c7a60 commit c359019
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions doc/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,25 @@ described in :ref:`build_options`, these features will also be included in the
installation. Thus we recommend to enable as many non-experimental features as
possible for the installed binary.

In your own CMake project you can then include the open62541 library using:
In your own CMake project you can then include the open62541 library. A simple
CMake project definition looks as follows:

.. code-block:: cmake
find_package(open62541 REQUIRED)
add_executable(main main.c)
target_link_libraries(main open62541::open62541)
cmake_minimum_required(VERSION 3.5)
project("open62541SampleApplication")
add_executable(main main.c)
# Linux/Unix configuration using pkg-config
find_package(PkgConfig)
pkg_check_modules(open62541 REQUIRED open62541)
target_link_libraries(main open62541)
# Alternative CMake-based library definition.
# This might not be included in some package distributions.
#
# find_package(open62541 REQUIRED)
# target_link_libraries(main open62541::open62541)
Building with CMake on Windows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit c359019

Please sign in to comment.