IF(NOT TARGET libtinyply)
    MESSAGE(FATAL_ERROR "Try to link libtinyply but it was not found")
ELSE()
    TARGET_LINK_LIBRARIES(${targetname} PUBLIC libtinyply)
    TARGET_COMPILE_DEFINITIONS(${targetname} PUBLIC COMPILE_WITH_TINYPLY)
ENDIF()