if (NOT pylon_FOUND)
    find_package(pylon REQUIRED)
endif()

if(NOT WIN32 AND NOT OpenCV_FOUND)
  find_package(OpenCV QUIET)
endif()

add_executable(ConvertPointCloud2DepthMap ConvertPointCloud2DepthMap.cpp)

set (ConvertPointCloud2DepthMap_Dependencies pylon::pylon)
if (NOT WIN32 AND OpenCV_FOUND)
    # The pylon image window is only available on Windows.
    # Therefore, use OpenCV for visualization on other platforms.
    list(APPEND ConvertPointCloud2DepthMap_Dependencies ${OpenCV_LIBS})
    target_compile_definitions(ConvertPointCloud2DepthMap PRIVATE WITH_OPENCV=1)
    target_include_directories(ConvertPointCloud2DepthMap PRIVATE ${OpenCV_INCLUDE_DIRS} )
endif()

target_link_libraries(ConvertPointCloud2DepthMap ${ConvertPointCloud2DepthMap_Dependencies})
