set(Target_Name
		clamp_safety
		)

option(OPTION_ENABLE_COMMUNICATION_PLC "启用和plc通信" ON)

include_directories(
	/usr/local/include/snap7
)

aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/lidar LIDAR_SRC)
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/detect DETECT_SRC)
aux_source_directory(${CMAKE_CURRENT_LIST_DIR}/plc PLC_SRC)

set(Target_source
		${PLC_SRC}
		${LIDAR_SRC}
		${DETECT_SRC}
		${CMAKE_CURRENT_LIST_DIR}/main.cpp
)

set(Target_libary
		zx
		snap7
		-lpthread
)

message(${Target_Name} ":" ${Target_libary})

add_executable(${Target_Name} ${Target_source})
target_link_libraries(${Target_Name} ${Target_libary})
target_compile_definitions(${Target_Name} PRIVATE __VIEW__PCL=0)
# 将库文件，可执行文件，头文件安装到指定目录
install(TARGETS ${Target_Name}
		LIBRARY DESTINATION lib  # 动态库安装路径
		ARCHIVE DESTINATION lib  # 静态库安装路径
		RUNTIME DESTINATION bin  # 可执行文件安装路径
		PUBLIC_HEADER DESTINATION include  # 头文件安装路径
		)

#install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/etc
#		DESTINATION ${CMAKE_INSTALL_PREFIX}
#		)
