cmake_minimum_required(VERSION 3.10)

project(csi_examples)

# find SDK headers and library
if(TARGET CSI)
	set(CSI_TARGETNAME CSI)
else()
	find_package(CSGenICam)
	set(CSI_TARGETNAME CSI::CSI)
endif()

set(sources main.cpp fileDownload.cpp)

set(headers fileDownload.h)

if(MSVC)
	add_executable(file_download ${sources} ${headers} )
else()
	add_executable(file_download ${sources} ${headers})
endif()

target_link_libraries(file_download ${CSI_TARGETNAME})
if(UNIX)
	target_link_libraries(file_download pthread)
endif()

install(TARGETS file_download
	RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT SDK
	LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT SDK)