Directory Layout and Build#

This page summarizes a typical UDDF driver tree layout on disk and how it ties into the CMake build for GMSL camera drivers.

UDDF Directory Layout#

Module MyModule with sensor, serializer, EEPROM; plus standalone deserializer and power drivers.

sipl/uddf/
├── coSerDes/
│   ├── common/                        # ModuleUbb.hpp base
│   └── modules/MyModule/
│       ├── MyModule.hpp / .cpp
│       └── CMakeLists.txt             # -> static .a
├── drivers/
│   ├── common/                        # DeviceUbb, SensorUbb ...
│   ├── sensors/MySensor/
│   │   ├── MySensor.hpp / .cpp
│   │   ├── MySensorDefs.hpp           # constants
│   │   ├── MySensorHsl.py             # PyHSL source
│   │   └── CMakeLists.txt             # -> static .a
│   ├── serializers/MySerializer/
│   │   ├── MySerializer.hpp / .cpp
│   │   ├── MySerializerHsl.py
│   │   └── CMakeLists.txt
│   ├── eeproms/MyEeprom/
│   │   ├── MyEeprom.hpp / .cpp
│   │   └── MyEepromHsl.py
│   ├── deserializers/MyDeser/         # standalone .so
│   │   ├── MyDeser.hpp / .cpp
│   │   ├── MyDeserHsl.py
│   │   └── CMakeLists.txt
│   └── powerControllers/MyPower/      # standalone .so
│       ├── MyPower.hpp / .cpp
│       ├── MyPowerHsl.py
│       └── CMakeLists.txt
└── libraries/                         # shared .so entry pts
    ├── moduleMyModule/
    │   ├── MyModuleLibrary.cpp        # uddf_discover_drivers
    │   └── CMakeLists.txt             # links module+sensor+ser+eeprom
    ├── deserMyDeser/
    │   ├── MyDeserLibrary.cpp
    │   └── CMakeLists.txt             # links deser driver
    └── powerControlMyPower/
        ├── MyPowerLibrary.cpp
        └── CMakeLists.txt

green = PyHSL • Module .so bundles sensor+ser+eeprom • Deser & Power are separate .so files

Note

Some CMake target aliases still use the uddf-cdd:: namespace. The source tree in the JP 7.2 release package is sipl/uddf/.

Build Target Renames#

For JP 7.2, use all_drivers to build the driver set. Older instructions that reference the samples target should be updated. For Eagle-specific builds, use the public CMake targets eagle_driver and eagle_library; older eagleAIO references are stale.

CMake Build Layout (CMakeLists)#

Sensor Driver (Static Library)#

# drivers/sensors/MySensor/CMakeLists.txt
add_library(sensor_mysensor_driver MySensor.cpp)
add_library(uddf-cdd::sensor_mysensor_driver
    ALIAS sensor_mysensor_driver)

target_compile_features(sensor_mysensor_driver PUBLIC cxx_std_17)
target_include_directories(sensor_mysensor_driver PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR} ${UDDF_CDD_DRIVER})
target_link_libraries(sensor_mysensor_driver PUBLIC uddf::uddf)

# HSL compilation — turns .py -> constexpr .hpp
hsl_add_driver_sources(sensor_mysensor_driver
    SOURCES  MySensorHsl.py
    NAMESPACE uddf::cdd::mysensor::hsl)

Module Driver (Static Library)#

# coSerDes/modules/MyModule/CMakeLists.txt
add_library(mymodule_driver MyModule.cpp)
add_library(uddf-cdd::mymodule_driver ALIAS mymodule_driver)

target_compile_features(mymodule_driver PUBLIC cxx_std_17)
target_include_directories(mymodule_driver PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${UDDF_CDD_COSERDES} ${UDDF_CDD_DRIVER})
target_link_libraries(mymodule_driver PUBLIC uddf::uddf)

Module Library (Shared .so File)#

# libraries/moduleMyModule/CMakeLists.txt
add_library(uddf_mymodule_library SHARED
    MyModuleLibrary.cpp)
add_library(uddf-cdd::uddf_mymodule_library
    ALIAS uddf_mymodule_library)

target_compile_features(uddf_mymodule_library PUBLIC cxx_std_17)
target_include_directories(uddf_mymodule_library PUBLIC
    ${UDDF_CDD_DRIVER} ${UDDF_CDD_COSERDES})

target_link_libraries(uddf_mymodule_library PUBLIC
    uddf::uddf
    uddf-cdd::mymodule_driver         # module .a
    uddf-cdd::sensor_mysensor_driver  # sensor .a
    uddf-cdd::ser_myserializer_driver # serializer .a
    uddf-cdd::eeprom_myeeprom_driver) # eeprom .a
# -> uddf_mymodule_library.so