How to build License manager

Prerequisites

The build system used is cmake which is included in cc-linux. You will need to install the CCLinux SDK for target display you want to use LM with. See the online documentation.

Before building anything you should make sure to set the project name which you do in CMakeLists.txt, change the line
SET(LCC_PROJECT_NAME xxx)
And replace xxx with the project name for your software. This will initialize a projects folder with the needed private and public keys for building the static library.

Dependencies

  1. Cmake

  2. OpenSSL

  3. Boost (only for lccgen)

  4. Valgrind

  5. SDK for cc_hw_id installed in VM

    • /opt/crosscontrol/x86_64/vm/lib/libcc-hw-id.a

    • /opt/crosscontrol/arm/imx8/lib/libcc-hw-id.a

    • /opt/crosscontrol/include/cc_hw_id.h

If missing openssl, boost or valgrind, use

sudo apt-get install libssl-dev libboost-all-dev valgrind

Actions needed

  1. Install sdk for target (V700 or V1000/V1200)

  2. Set project name in CMakeLists.txt

  3. Build for VM first to also build the lccgen (key generator tool) which will be used for creating the private & public keys

  4. Build for target (V700 or V1000/V1200)

  5. Keep the generated projects folder safe which is generated and includes private/public keys plus some other files.

  6. Keep track of where your install folders are located

Build VM

From folder with License manager project

mkdir build-vm  
cd build-vm
cmake .. -DCMAKE_INSTALL_PREFIX=../install
make -j6
make install

Notice where the install folder is.

Build iMX8 (for V700, change V1X00 to V700)

From folder with License manager project

mkdir build-imx8
cd build-imx8
source /opt/V1X00/environment-setup-cortexa35-poky-linux
cmake .. -DCMAKE_INSTALL_PREFIX=../install-imx8
make -j6
make install

Notice where the install folder is.

Install folders

You will have one install folder for VM and one for each target display (V700 and V1000/V1200) Below is the one created for VM if you followed the steps above. In the example below we used the project name LicenseDemoApp Notice the liblicensecc_static.a library created.

install
├── bin
│   ├── lccgen
│   └── LicenseDemoApp
│       └── lccinspector
├── include
│   └── licensecc
│       ├── datatypes.h
│       ├── licensecc.h
│       └── LicenseDemoApp
│           ├── licensecc_properties.h
│           └── public_key.h
└── lib
    ├── cmake
    │   ├── lccgen
    │   │   ├── lccgen-config.cmake
    │   │   ├── license_generator.cmake
    │   │   └── license_generator-noconfig.cmake
    │   └── licensecc
    │       ├── licensecc-config.cmake
    │       └── licensecc-config-version.cmake
    └── licensecc
        └── LicenseDemoApp
            ├── cmake
            │   ├── licensecc.cmake
            │   └── licensecc-noconfig.cmake
            └── liblicensecc_static.a

Note that the lccgen is only built for VM and will not show up in install folder for other targets.

When you later integrate the static library into your own software you need to have the path to the install folder ready.

Projects folder

In the same folder as License manager you should now have a projects folder. This one is needed when you need to issue new license files or rebuild the static library in the steps above. Keep it safe!

projects  
	└── DEFAULT       #(your project name)  
	    ├── include  
	    │   └── licensecc
	    │       └── DEFAULT
	    │           ├── licensecc_properties.h
	    │           └── public_key.h
	    ├── licenses
	    │   └── test.lic
	    └── private_key.rsa

Keep a safe copy of project map

You should keep a safe copy of the projects folder described earlier. If you loose this one you cannot create new license files for your software that linked the static library created in the build step. If rebuilding the static library without the projects folder you will generate a new one with new secret and public keys and old license files would not work.