Browse Source

Doc: Add documentation on how to install

Stefan Profanter 5 years ago
parent
commit
49719f350d
4 changed files with 83 additions and 22 deletions
  1. 3 0
      CMakeLists.txt
  2. 4 22
      doc/building.rst
  3. 75 0
      doc/installing.rst
  4. 1 0
      doc/toc.rst

+ 3 - 0
CMakeLists.txt

@@ -1005,6 +1005,9 @@ install(TARGETS open62541
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
         RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
         INCLUDES DESTINATION include)
+# Our default way of installation is the non-amalgamated version.
+# See also https://github.com/open62541/open62541/pull/2292#discussion_r241106424
+install(CODE "MESSAGE(WARNING \"Installation with UA_ENABLE_AMALGAMATION=ON is not recommended.\")")
 endif()
 
 include(CMakePackageConfigHelpers)

+ 4 - 22
doc/building.rst

@@ -119,6 +119,9 @@ The procedure below works on OpenBSD 5.8 with gcc version 4.8.4, cmake version 3
    cmake ..
    make
 
+
+.. _build_options:
+
 Build Options
 -------------
 
@@ -183,7 +186,7 @@ Detailed SDK Features
    Enable dynamic addition and removal of nodes at runtime
 
 **UA_ENABLE_AMALGAMATION**
-   Compile a single-file release into the files :file:`open62541.c` and :file:`open62541.h`
+   Compile a single-file release into the files :file:`open62541.c` and :file:`open62541.h`. Not receommended for installation.
 
 **UA_ENABLE_MULTITHREADING (EXPERIMENTAL)**
    Enable multi-threading support. Work is distributed to a number of worker threads.
@@ -286,24 +289,3 @@ The RAM requirements of a server are mostly due to the following settings:
 - The size of the information model
 - The number of connected clients
 - The configured maximum message size that is preallocated
-
-
-Installation and packaging
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-You can install open62541 using the well known `make install` command.
-This allows you to use pre-built libraries and headers for your own project.
-
-To override the default installation directory use ``cmake -DCMAKE_INSTALL_PREFIX=/some/path``.
-Based on the SDK Features you selected, as described above, these features will also
-be included in the installation. Thus we recommend to enable as many features as possible
-for the installed binary.
-
-In your own CMake project you can then include the open62541 library using:
-
-
-.. code-block:: cmake
-
-   find_package(open62541 0.4.0 REQUIRED COMPONENTS Events DiscoveryMulticast)
-   add_executable(main main.cpp )
-   target_link_libraries(main open62541)

+ 75 - 0
doc/installing.rst

@@ -0,0 +1,75 @@
+.. _installing:
+
+Installing open62541
+====================
+
+Manual installation
+-------------------
+
+You can install open62541 using the well known `make install` command.
+This allows you to use pre-built libraries and headers for your own project.
+
+To override the default installation directory use ``cmake -DCMAKE_INSTALL_PREFIX=/some/path``.
+Based on the SDK Features you selected, as 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.
+
+The recommended cmake options for a default installation are:
+
+.. code-block:: bash
+
+   git submodule update --init --recursive
+   mkdir build && cd build
+   cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_FULL_NS0=ON ..
+   make
+   sudo make install
+
+This will enable the following features in 0.3:
+
+ * Discovery
+ * FullNamespace
+ * Methods
+ * Subscriptions
+
+The following features are not enabled and can be optionally enabled using the build options as described in :ref:`build_options`:
+
+ * Amalgamation
+ * DiscoveryMulticast
+ * Encryption
+ * Multithreading
+ * Subscriptions
+
+.. important::
+   We strongly recommend to not use ``UA_ENABLE_AMALGAMATION=ON`` for your installation. This will only generate a single ``open62541.h`` header file instead of the single header files.
+   We encourage our users to use the non-amalgamated version to reduce the header size and simplify dependency management.
+
+
+In your own CMake project you can then include the open62541 library using:
+
+.. code-block:: cmake
+
+   find_package(open62541 0.3.0 REQUIRED COMPONENTS FullNamespace DiscoveryMulticast)
+   add_executable(main main.cpp)
+   target_link_libraries(main open62541)
+
+
+A full list of enabled features during build time is stored in the CMake Variable ``open62541_COMPONENTS_ALL``
+
+
+Prebuilt packages
+-----------------
+
+
+Prebuild binaries
+^^^^^^^^^^^^^^^^^
+
+You can always find prebuild binaries for every release on our `Github Release Page <https://github.com/open62541/open62541/releases>`_.
+
+
+Nightly single file releases for Linux and Windows of the last 50 commits can be found here: https://open62541.org/releases/
+
+
+OS Specific packages
+^^^^^^^^^^^^^^^^^^^^
+
+This is currently work in progress and we will provide prebuilt .deb packages soon.

+ 1 - 0
doc/toc.rst

@@ -5,6 +5,7 @@ open62541 Documentation
 
    index
    building
+   installing
    tutorials
    protocol
    types