Could NOT find Argus Error

I am trying to build a sample application by referring to the CMakeLists.txt which comes along with argus samples. I am currently referring to CMakeLists.txt in “multiSensor” sample as I am trying to do something similar to this sample. My CMakeLists.txt looks like the following :

make_minimum_required(VERSION 2.8)
project( projectname )

set(CMAKE_MODULE_PATH “/home/user/Downloads/argus/cmake” “${CMAKE_MODULE_PATH}”)

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

include_directories(${ARGUS_INCLUDE_DIR} ${EGL_INCLUDE_DIR} ${OPENGLES_INCLUDE_DIR} /home/user/Downloads/samples/utils ${OpenCV_INCLUDE_DIRS} )

pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
include_directories(${GSTREAMER_INCLUDE_DIRS})

#set( CMAKE_VERBOSE_MAKEFILE on )
add_subdirectory(ci)

add_compile_options(-std=c++14)
add_executable( projectname main.cpp )
target_link_libraries( projectname /usr/lib/x86_64-linux-gnu/libcuinj64.so ${OpenCV_LIBS} ${ARGUS_LIBRARIES} ${OPENGLES_LIBRARIES} ${GSTREAMER_LIBRARIES} ci )

In “ci” subdirectory I have the following files:

  1. multiSensor.cpp
  2. CMakeLists.txt which looks like this :

set (ci_source_files
multiSensor.cpp
)

add_compile_options(-std=c++14)
add_library(ci ${ci_source_files})


When I try to build I get the following error :

CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find Argus (missing: ARGUS_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
/home/ubuntu/Downloads/argus/cmake/FindArgus.cmake:55 (find_package_handle_standard_args)
CMakeLists.txt:6 (find_package)

– Configuring incomplete, errors occurred!

Kindly help me by advising where I am making a mistake. When I try to build “argus” samples, they get built successfully. I am not able to figure out how this CMakeLists.txt is different from the one in the samples folder.

Thanks.

Hi dumbogeroge

It’s better to copy or build you code in tegra_multimedia_api/ otherwise you need to handle all the path correctly.

Form you error that show the “Could NOT find Argus (missing: ARGUS_INCLUDE_DIR)” that could be the environment not set well.

@ShaneCCC

I am having the same issue. In my case, moving my source code to accomadate this particular FindArgus.cmake is not a solution. I need my project that relies on Argus to be portable since it needs to be usable as a submodule or subproject. I’m trying to make a portable, easy to use, modern, camera library built on top of Argus.

I can’t tell people using my project “hey, install nvidia-l4t-jetson-multimedia-api, copy my project into the samples dir, and build the thing as root”, which is probably what most people are doing. Yes, they could copy the samples, or I could bundle them, but that creates entirely new issues as well. I’d like to just make a debian package and have it pull in yours as a dependency.

Would it be possible, in the next release of nvidia-l45-jetson-multipmedia-api to install libraries to, say $LIBDIR, headers to $PREFIX/include/argus, cmake files to $LIBDIR/cmake/ and so forths so find_package(Argus ...) “just works”? I understand you have documentation saying “download it here”, but that can be changed to sudo apt install nvidia-l45-jetson-multipmedia-api

As it is, this requirement either to move source files into the Argus samples or roll your own FindArgus.cmake is a serious disincentive to using MMAPI on top of it being C++ 03 with a bunch of things re-implemented that are now part of the STL. A camera class, like that in jetson-utils, but without GStreamer as a middleman is what I’m aiming for.

From J4.4 you can easy install it by below command

sudo apt list -a nvidia-l4t-jetson-multimedia-api
sudo apt install nvidia-l4t-jetson-multimedia-api=32.4.3-20200625213407

@ShaneCCC

The problem isn’t installing them. The problem is build systems finding them and the files not being in standard locations. Instead of being in /usr/include/Argus, for example, the headers are actually in two separate subfolders of /usr/src/jetson_multimedia_api/....

Just today, an unknown coworker accidentially modified the headers in place while trying to use the sample code. This lead to compilation errors requiring a reinstall of the samples. IMO there should be:

  • clear instructions to not edit these files in place (rather, to make a copy in your user’s ~/Projects or similar). Otherwise people will run an editor as root and edit headers all of the filesystem.
  • The headers should be in a standard include path a subfolder of $PREFIX/include. If they’re included with the samples, they can be edited accidentally.
  • The .cmake files should be in a CMAKE_MODULES_PATH location so they’re found by build systems like Cmake, Meson, and more. Right now, the way the Find*.cmake files are written, things only build in-place and that leads back to this same problem. Builds are often run as root. Editors are run as root. Editors open headers when ctrl+clicked, and this can easily lead to even system headers being edited accidentally.

Thanks for your suggestion.
Will check with release team if can have it improve.

For anyone coming across this later, you can do something like this in your CMakeLists.txt to get it to find the correct variables with a system installed version of argus.

find_path(ARGUS_INCLUDE_DIR Argus/Argus.h
          HINTS "/usr/src/jetson_multimedia_api/argus/include")
set(CMAKE_MODULE_PATH "/usr/src/jetson_multimedia_api/argus/cmake" "${CMAKE_MODULE_PATH}")
find_package(Argus REQUIRED)

You probably also will want to include the headers as SYSTEM headers to avoid a ton of pedantic warnings:

include_directories(
  SYSTEM ${ARGUS_INCLUDE_DIR}
)
2 Likes