#############################################################################
##    Kwave                - plugins/codec_mp3/CMakeLists.txt
##                           -------------------
##    begin                : Sat Jun 02 2007
##    copyright            : (C) 2007 by Thomas Eschenbacher
##    email                : Thomas.Eschenbacher@gmx.de
#############################################################################
#
#############################################################################
#                                                                           #
# Redistribution and use in source and binary forms, with or without        #
# modification, are permitted provided that the following conditions        #
# are met:                                                                  #
#                                                                           #
# 1. Redistributions of source code must retain the above copyright         #
#    notice, this list of conditions and the following disclaimer.          #
# 2. Redistributions in binary form must reproduce the above copyright      #
#    notice, this list of conditions and the following disclaimer in the    #
#    documentation and/or other materials provided with the distribution.   #
#                                                                           #
# For details see the accompanying cmake/COPYING-CMAKE-SCRIPTS file.        #
#                                                                           #
#############################################################################

OPTION(WITH_MP3 "enable support for mp3 files [default=on]" ON)
IF (WITH_MP3)
    INCLUDE(FindPkgConfig)
    INCLUDE(UsePkgConfig)

    PKG_CHECK_MODULES(MADLIB REQUIRED mad>=0.15.0)
    PKG_CHECK_MODULES(TAGLIB REQUIRED taglib>=2.0)

    SET(HAVE_MP3  ON CACHE BOOL "enable MP3 codec")

    INCLUDE_DIRECTORIES(
        ${MADLIB_INCLUDE_DIRS}
        ${TAGLIB_INCLUDE_DIRS}
    )

    LINK_DIRECTORIES(
        ${MADLIB_LIBRARY_DIRS}
        ${TAGLIB_LIBRARY_DIRS}
    )

    SET(plugin_codec_mp3_LIB_SRCS
        MP3CodecPlugin.cpp
        MP3Decoder.cpp
        MP3Encoder.cpp
        MP3EncoderDialog.cpp
        MP3EncoderSettings.cpp
        TagLib_PropertyMap.cpp

        MP3CodecPlugin.h
        MP3Decoder.h
        MP3Encoder.h
        MP3EncoderDialog.h
        MP3EncoderSettings.h
        TagLib_PropertyMap.h
        TagLib_QIODeviceStream.h
    )

    SET(plugin_codec_mp3_LIB_UI
        MP3EncoderDialogBase.ui
    )

    SET(plugin_codec_mp3_LIBS
        ${MADLIB_LIBRARIES} ${TAGLIB_LIBRARIES}
    )

    KWAVE_PLUGIN(codec_mp3)

ENDIF (WITH_MP3)

#############################################################################
#############################################################################
