if (NOT pylon_FOUND)
    find_package(pylon 6.2 REQUIRED)
endif()
if (NOT OpenCV_FOUND)
    find_package(OpenCV REQUIRED)
endif()
if (NOT PCL_FOUND)
    find_package(PCL QUIET COMPONENTS common visualization)
endif()

add_executable(ExtrinsicTransformation ExtrinsicTransformation.cpp PlaneUtils.h PlaneUtils.cpp)
target_include_directories(ExtrinsicTransformation PRIVATE ${OpenCV_INCLUDE_DIRS})

if (PCL_FOUND)
	target_link_libraries(ExtrinsicTransformation pylon::pylon ${OpenCV_LIBS}  ${PCL_LIBRARIES})

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

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

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

	target_compile_definitions(ExtrinsicTransformation PRIVATE WITH_PCL=1)
else()
	target_link_libraries(ExtrinsicTransformation pylon::pylon ${OpenCV_LIBS})
endif()



