Vision Works cmake

Jetson TX2
OpenCV 3.4.1
Jetpack 4.2

Trying to compile one of the VisionWorks samples with the following CMakeFile:

cmake_minimum_required(VERSION 3.0)
project(immediate_mode_stabilizer)

find_package(OpenCV 3.4.1 REQUIRED core imgproc video highgui calib3d)
find_package(VisionWorks REQUIRED)

file(GLOB SOURCES "*.cpp" "*.c" "*.h" "*.hpp")

set(NVXIO_INCLUDE "/usr/share/visionworks/sources/nvxio/include")
set(OVX_LIB "/usr/lib/libovx.a")
set(NVX_LIB "/usr/lib/libnvx.a")

MESSAGE( STATUS "VisionWorks libs: " ${VisionWorks_LIBRARIES})
MESSAGE( STATUS "VisionWorks include: " ${VisionWorks_INCLUDE_DIRS})
MESSAGE( STATUS "NVXIO include: " ${VisionWorks-NVXIO_INCLUDE_DIRS})
MESSAGE( STATUS "OpenCV libs: " ${OpenCV_LIBS})
MESSAGE( STATUS "OpenCV include: " ${OpenCV_INCLUDE_DIRS})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -march=native")

include_directories(
	${VisionWorks_INCLUDE_DIRS} 
	${OpenCV_INCLUDE_DIRS} 
	${NVXIO_INCLUDE})

add_executable(immediate_mode_stabilizer ${SOURCES})

target_link_libraries(immediate_mode_stabilizer 
	${OpenCV_LIBS} 
	${VisionWorks_LIBRARIES}
	${NVX_LIB}	 
	${OVX_LIB}
	cudart
	pthread					
	)

cmake output:

-- VisionWorks libs: visionworks
-- VisionWorks include: /usr/include
-- NVXIO include: 
-- OpenCV libs: opencv_coreopencv_imgprocopencv_videoopencv_highguiopencv_calib3d
-- OpenCV include: /usr/local/include/usr/local/include/opencv
-- Configuring done
-- Generating done
-- Build files have been written to: /build

the more linking errors i try to solve the worse it seems to get.

[ 25%] Linking CXX executable immediate_mode_stabilizer
/usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/7/../../../../lib/libovx.a(OpenGL.o): undefined reference to symbol 'glIsShader'
//usr/lib/aarch64-linux-gnu/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/immediate_mode_stabilizer.dir/build.make:159: recipe for target 'immediate_mode_stabilizer' failed
make[2]: *** [immediate_mode_stabilizer] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/immediate_mode_stabilizer.dir/all' failed
make[1]: *** [CMakeFiles/immediate_mode_stabilizer.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Any help would be greatly appreciated

I should note that i can successfully compile the demos/samples within VisionWorks but have had no sucess with cmake.

Hi,

Please check this comment for information:
https://devtalk.nvidia.com/default/topic/1037512/jetson-tx2/problem-to-compile-visionworks-example/post/5272305/#5272305

Thanks.