include_directories(${DEPS_INCLUDE_DIRS}
                    ${CMAKE_SOURCE_DIR}/src)

# =============================================================================
# Prepare a Grilo plugin directory for testing
# =============================================================================

set(grilo_plugin_dir "${CMAKE_CURRENT_BINARY_DIR}/plugins")
add_definitions(-DEXAMPLE_GRILO_PLUGIN_DIR="${grilo_plugin_dir}")

get_target_property(grlmediascanner_LOCATION grlmediascanner LOCATION)

add_custom_target(examplesgriloplugindir DEPENDS grlmediascanner
                  COMMAND mkdir -p ${grilo_plugin_dir}
                  COMMAND ln -sf ${grlmediascanner_LOCATION} ${grilo_plugin_dir}/libgrlmediascanner.so
                  COMMAND ln -sf ${CMAKE_SOURCE_DIR}/src/grlmediascanner/*.xml ${grilo_plugin_dir})

# =============================================================================
# Setup rules for the examples
# =============================================================================

foreach(example
        example-grilo-browse
        example-grilo-search
        example-grilo-search-range-filter
        example-grilo-query
        example-grilo-store)

  add_executable(${example} ${example}.c)
  target_link_libraries(${example} mediascanner)
  add_dependencies(${example} examplesgriloplugindir)
endforeach(example)



