Building bayerAverageMap with CMake

The goal I’m shooting for with the jetson multimedia API examples is to build/compile; for now, the bayerAverageMap with CMake so I can have a better understanding of what needs to be included in the CMake file

I’m fully aware and capable of using the MakeFiles to build the various examples provided in the jetson multimedia API

I currently have a regular Jetson Nano, not the Orin model, and Jetpack 4.6.2 that came pre-installed with the Linux image that can be downloaded here

Here are the steps that I’ve taken so far

  1. Copied the entire jetson_multimedia_api directory and placed in into the following directory : ~/Desktop/Coding_Folder/jetson_multimedia_api
  2. Created a build directory in the bayerAverageMap directory and can be found here : ~/Desktop/Coding_Folder/jetson_multimedia_api/argus/samples/bayerAverageMap/build
  3. Made some changes to the CMake file that was already in the bayerAverageMap directory to include some header files; please see below
  4. Used cmake .. && make with hopes of building the program but I got the following error

CMake error

/usr/bin/ld: cannot find -largussampleutils
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/argus_bayeraveragemap.dir/build.make:86: argus_bayeraveragemap] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/argus_bayeraveragemap.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

CMake file currently in use

cmake_minimum_required(VERSION 3.12)

project(argus_bayeraveragemap)

find_path(ARGUS_INCLUDE_DIR Argus/Argus.h HINTS "/home/ctnano/Desktop/Coding_Folder/jetson_multimedia_api/include")
set(CMAKE_MODULE_PATH "/home/ctnano/Desktop/Coding_Folder/jetson_multimedia_api/argus/cmake" "${CMAKE_MODULE_PATH}")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")

find_package(Argus REQUIRED)
find_package(OpenGLES REQUIRED)
find_package(EGL REQUIRED)

set(SOURCES
    main.cpp
    )

include_directories(
    ${ARGUS_INCLUDE_DIR}
    ${EGL_INCLUDE_DIR}
    ${OPENGLES_INCLUDE_DIR}
    ${CMAKE_SOURCE_DIR}/samples/utils
    /usr/src/jetson_multimedia_api/argus/samples/utils
    /home/ctnano/Desktop/Coding_Folder/jetson_multimedia_api/argus/include
    /home/ctnano/Desktop/Coding_Folder/jetson_multimedia_api/include/
    /home/ctnano/Desktop/Coding_Folder/jetson_multimedia_api/argus/samples/utils/
    /usr/include/libdrm
    /usr/include/opencv4
    )

add_executable(${PROJECT_NAME} ${SOURCES})

target_link_libraries(${PROJECT_NAME}
    ${ARGUS_LIBRARIES}
    ${OPENGLES_LIBRARIES}
    argussampleutils
    )

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

include(CPack)

The big question I want to ask

I’m aware that I’m missing the argussampleutils library/.so file that’s causing the error, but I was under the assumption that all the shared libraries that I would need to use in the jetson multimedia API directory would had already been built?

When I use the sudo find / -name libargussampleutils.so to search for the missing library I get nothing as the output

Hi,
Please install jetson_multimedia_api packages through SDKManager and you will see the samples in

/usr/src/jetson_multimedia_api/

And please follow the README to build the samples:

/usr/src/jetson_multimedia_api/argus/README.TXT

I already have the jetson_multimedia_api installed on my Jetson Nano after using the image that y’all provide

The README.TXT file doesn’t help me at all when it comes to building my own application so I can get a better understanding of how Argus works

Hi,
We would suggest check

/usr/src/jetson_multimedia_api/argus/CMakeLists.txt

All samples are listed in the cmake file. You can keep only bayerAverageMap and try.

Let me test that out and get back to you

Are the samples found in jetson_multimedia_api/samples can only be built using make?

I was able to build the samples found at /jetson_multimedia_api/argus/samples using CMake

But I’m confused to why the samples found in either directory are built using Makefiles and CMake perspectively rather than just sticking to one ‘methodolgy’

Hi,
jetson_multimedia_api/samples/ uses Makefiles and /jetson_multimedia_api/argus/ uses cmake.