gcontini
2021-05-20 befd75ebbf7fe3b0ce5b91a82bc232e84fc5d3fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#########################################
Integrate Licensecc in your application
#########################################
 
This short guide explain how to integrate `licensecc` in your application.
 
Working examples are provided in the `examples <https://github.com/open-license-manager/examples>`_ project. 
 
Build System - locate and link the licensecc
*********************************************
 
We strongly recommend to use CMake as a build system. 
If this is the case, the easiest way to compile is to configure LicenseCC as a git submodule of your project.
 
Then you can copy the cmake module ``Findlicensecc.cmake`` into your cmake modules directory in order to be able to 
locate the compiled library. 
 
Adding the following lines to your ``CMakeLists.txt``
 
.. code-block:: console
  
  find_package(licensecc 2.0.0 REQUIRED)
  
will make the external target ``licensecc::licensecc_static`` to be available for linking.
 
``Findlicensecc.cmake`` takes the following CMake variables as input.
 
==================== ====================
Cmake variable        Description
==================== ====================
LICENSECC_LOCATION   | If licensecc was not checked out as a git submodule, in this variable you can provide an hint 
                     | to locate the library. It may point to the installation folder or the source folder.
LCC_PROJECT_NAME     | Name of the project (the software where you want to integrate licensecc).  
                     | Alternatively it is possible to specify a component name in the component section of find_package.
==================== ====================
 
 
 
Call Licensecc from your code
*******************************
The file containing the public api is ``include/licensecc/licensecc.h``. Functions in there are considered stable.
 
refer to :ref:`public api <api/public_api:Public api>` to understand how to generate an hardware identifer or validate a license.