# EDCC Module
# Author: Leosocy
# Email: leosocy@163.com
# Usage from an external project:
#   In your CMakeLists.txt, add these lines:
#   
#   FIND_PACKAGE(EDCC REQUIRED)
#   INCLUDE_DIRECTORIES(${EDCC_INCLUDE_DIRS})
#   TARGET_LINK_LIBRARIES(MY_TARGET_NAME ${EDCC_LIBS})

SET(EDCC_VERSION 1.0.1)
SET(EDCC_VERSION_MAJOR 1)
SET(EDCC_VERSION_MINOR 0)
SET(EDCC_VERSION_PATCH 1)

FIND_PATH(EDCC_INCLUDE_DIRS edcc.h /usr/local/include/edcc /usr/include/edcc)
FIND_LIBRARY(EDCC_LIBS NAMES edcc PATH /usr/local/lib /usr/lib)

IF(EDCC_INCLUDE_DIRS AND EDCC_LIBS)
	SET(EDCC_FOUND TRUE)
ENDIF()

IF(EDCC_FOUND)
	IF(NOT EDCC_FIND_QUIETLY)
		MESSAGE(STATUS "Found EDCC Headers: ${EDCC_INCLUDE_DIRS}")
		MESSAGE(STATUS "Found EDCC Libs: ${EDCC_LIBS}")
	ENDIF()
ELSE()
	IF(EDCC_FIND_REQUIRED)
		MESSAGE(FATAL_ERROR "Cound not find EDCC library!")
	ENDIF()
ENDIF()
