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

if (NOT PCL_FOUND)
    find_package(PCL QUIET REQUIRED COMPONENTS common visualization)
endif()

add_executable(ShowPointCloud_PCL ShowPointCloud_PCL.cpp)
target_link_libraries(ShowPointCloud_PCL pylon::pylon ${PCL_LIBRARIES})

# Suppress warnings from PCL/VTK header files.
target_compile_options(ShowPointCloud_PCL PRIVATE $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-comment>)

string(STRIP "${PCL_DEFINITIONS}" PCL_DEFINITIONS)
target_compile_definitions(ShowPointCloud_PCL PRIVATE ${PCL_DEFINITIONS})

target_include_directories(ShowPointCloud_PCL PRIVATE ${PCL_INCLUDE_DIRS})
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13")
    target_link_directories(ShowPointCloud_PCL PRIVATE ${PCL_LIBRARY_DIRS})
else()
    link_directories(${PCL_LIBRARY_DIRS})
endif()
