include_directories(
  ${CMAKE_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${TDE_INCLUDE_DIR}
  ${TQT_INCLUDE_DIRS}
  ${CMAKE_BINARY_DIR}
)

link_directories(
  ${TQT_LIBRARY_DIRS}
  ${TDE_LIB_DIR}
)


##### kplayernoinst (static)

tde_add_library( kplayernoinst STATIC_PIC AUTOMOC

  SOURCES
        kplayerpropertiesgeneral.ui
        kplayerpropertiessize.ui
        kplayerpropertiessubtitles.ui
        kplayerpropertiesaudio.ui
        kplayerpropertiesvideo.ui
        kplayerpropertiesadvanced.ui
        x11.cpp
        kplayerwidget.cpp
        kplayerslideraction.cpp
        kplayerprocess.cpp
        kplayersettings.cpp
        kplayerproperties.cpp
        kplayeractionlist.cpp
        kplayerengine.cpp
        kplayersource.cpp
        kplayernode.cpp
        kplayerpropertiesdialog.cpp
  LINK
     tdeio-shared
     tdeui-shared
     tdecore-shared
)


##### libkplayerpart (kpart)

tde_add_kpart( libkplayerpart AUTOMOC

  SOURCES
        kplayerpart.cpp
  LINK
     tdeio-shared
     tdeui-shared
     tdecore-shared
     tdeparts-shared
     kplayernoinst-static
  
  DESTINATION ${PLUGIN_INSTALL_DIR}
)

##### kplayer (executable)

tde_add_executable( ${PROJECT_NAME} AUTOMOC

  SOURCES
        kplayerpropertiesgeneral.ui
        kplayerpropertiessize.ui
        kplayerpropertiessubtitles.ui
        kplayerpropertiesaudio.ui
        kplayerpropertiesvideo.ui
        kplayerpropertiesadvanced.ui
        kplayerpropertiesdevice.ui
        kplayersettingssubtitles.ui
        kplayersettingsbrightness.ui
        kplayersettingsvolume.ui
        kplayersettingssaturation.ui
        kplayersettingsprogress.ui
        kplayersettingshue.ui
        kplayersettingscontrols.ui
        kplayersettingssliders.ui
        kplayersettingscontrast.ui
        kplayersettingsvideo.ui
        kplayersettingsaudio.ui
        kplayersettingsadvanced.ui
        kplayersettingsgeneral.ui
        kplayer.cpp
        main.cpp
        kplayernodeaction.cpp
        kplayernodeview.cpp
        kplayerplaylist.cpp
        kplayersettingsdialog.cpp
        kplayerlogwindow.cpp
  LINK
     tdeio-shared
     tdeui-shared
     tdecore-shared
     tdeparts-shared
     kplayernoinst-static 
     
  DESTINATION ${BIN_INSTALL_DIR}
)

##### icons

tde_install_icons( ${PROJECT_NAME} )


##### other data

tde_create_translated_desktop(
    SOURCE
      kplayer-play-queue.desktop
      kplayer-next.desktop
      kplayer-directory.desktop
      kplayer-actions.desktop

    DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus
)

tde_create_translated_desktop(
    SOURCE kplayerpart.desktop
    DESTINATION ${SERVICES_INSTALL_DIR}
)

tde_create_translated_desktop( ${PROJECT_NAME}.desktop )

install(
    FILES input.conf kplayerui.rc kplayerpartui.rc
    DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME}
)
