#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

# libical
pkg_search_module( LIBICAL libical )
if( LIBICAL_FOUND )
  if( LIBICAL_VERSION VERSION_GREATER_EQUAL "4.0.0" )
    # Starting from version 4.0.0, libicalss and libicalvcal
    # have their own package config files.
    pkg_search_module( LIBICAL_EXTRA libicalss libicalvcal )
    if( NOT LIBICAL_EXTRA_FOUND )
      tde_message_fatal( "libicalss/libicalval are required but not found on your system" )
    endif( )
    list(APPEND LIBICAL_INCLUDE_DIRS ${LIBICAL_EXTRA_INCLUDE_DIRS})
    list(APPEND LIBICAL_LIBRARIES    ${LIBICAL_EXTRA_LIBRARIES})
  endif( )
else( )
  tde_message_fatal( "libical is required but not found on your system" )
endif( )
