How to find if CMakeLists.txt is residing on Jetson Xavier

How to find if CMakeLists.txt is running on Jetson Xavier

Like you can find Cuda in CMakeLists.txt with IF(CUDA_FOUND).

The goal is to set certain variables only if the host device is Jetson Xaviers.

Thanks,
H

Maybe you can use CHECK_LIBRARY_EXISTS to check some /usr/lib/aarch64-linux-gnu/tegra/libnv*.so to tell if it’s Jetson device.

1 Like

You could also check if /etc/nv_tegra_release exists and if you want parse the L4T version from that.

1 Like

Great ideas! Both worked well.

Going with Dusty’s since it aligns better with my future work.

Thank you guys.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.