# -*- cmake -*-

# - Find collada14dom
# Find the colladadom version 1.4 includes and library
# This module defines
#  COLLADADOM_FOUND, System has libcollada14dom.so.
#  COLLADADOM_INCLUDE_DIRS - The collada include directories.
#  COLLADADOM_LIBRARIES - The libraries needed to use libcollada14dom.
#  COLLADADOM_DEFINITIONS - Compiler switches required for using libcollada14dom.

FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_COLLADADOM collada)
SET(COLLADADOM_DEFINITIONS ${PC_COLLADADOM_CFLAGS_OTHER})

FIND_PATH(COLLADADOM_INCLUDE_DIR dae.h
  HINTS ${PC_COLLADADOM_INCLUDE_DIR} ${PC_COLLADADOM_INCLUDE_DIRS}
  PATH_SUFFIXES collada)

FIND_LIBRARY(COLLADADOM_LIBRARY
  NAMES libcollada14dom.so
  HINTS ${PC_COLLADADOM_LIBDIR} ${PC_COLLADADOM_LIBRARY_DIRS}
  PATHS /usr/lib /usr/local/lib)

SET(COLLADADOM_LIBRARIES ${COLLADADOM_LIBRARY})
SET(COLLADADOM_INCLUDE_DIRS ${COLLADADOM_INCLUDE_DIR} ${COLLADADOM_INCLUDE_DIR}/1.4)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COLLADADOM DEFAULT_MSG
  COLLADADOM_LIBRARY COLLADADOM_INCLUDE_DIR)

MARK_AS_ADVANCED(COLLADADOM_LIBRARY COLLADADOM_INCLUDE_DIR)
