include_directories (
		${CMAKE_SOURCE_DIR}/kbabel/common/ 
		${CMAKE_SOURCE_DIR}/kbabel/commonui/ 
                ${CMAKE_BINARY_DIR}/kbabel/commonui/
		${CMAKE_SOURCE_DIR}/kbabel/kbabeldict/
                ${CMAKE_BINARY_DIR}/kbabel/kbabeldict/
		)

add_subdirectory( pics ) 
add_subdirectory( icons ) 




########### next target ###############
set(libkbabel_SRCS 
	kbbookmarkhandler.cpp 
	kbcatalog.cpp 
	headerwidget.cpp
	headereditor.cpp 
	spelldlgwidget.cpp
	spelldlg.cpp 
	gotodialog.cpp
	kbhighlighting.cpp 
	mymultilineedit.cpp 
	hidingmsgedit.cpp  
	fontpreferences.cpp
	colorpreferences.cpp
	editorpreferences.cpp
	editordiffpreferences.cpp
	searchpreferences.cpp
	kbabelpref.cpp      
	kbcatalogview.cpp   
	commentview.cpp     
	contextview.cpp     
	charselectview.cpp
	taglistview.cpp     
	sourceview.cpp      
	kbabelview.cpp 
	kbabelview2.cpp 
	kbabel.cpp 
	kbabelsplash.cpp 
	kbcataloglistview.cpp 
	kbcataloglistviewitem.cpp 
	errorlistview.cpp
)


########### next target ###############

set(kbabel_SRCS main.cpp kbabelinterface.cpp ${libkbabel_SRCS})

kde4_add_ui_files(kbabel_SRCS
                        colorpreferences.ui
                        editorpreferences.ui
                        editordiffpreferences.ui
                        spelldlgwidget.ui
                        fontpreferences.ui
                        searchpreferences.ui
                        headerwidget.ui
                        )

qt4_add_dbus_adaptor(kbabel_SRCS org.kde.kbabel.kbabel.xml kbabelinterface.h KBabelInterface)
qt4_add_dbus_adaptor(kbabel_SRCS ${CMAKE_SOURCE_DIR}/kbabel//kbabeldict/org.kde.kbabel.kbabeldict.xml ${CMAKE_SOURCE_DIR}/kbabel//kbabeldict/kbabeldictbox.h KBabelDictBox)
set(catalog_xml  ${CMAKE_SOURCE_DIR}/kbabel/catalogmanager/org.kde.kbabel.catalogmanager.xml)
QT4_ADD_DBUS_INTERFACE( kbabel_SRCS ${catalog_xml} catalog_interface )



kde4_add_kcfg_files(kbabel_SRCS kbabelsettings.kcfgc)

kde4_automoc(${kbabel_SRCS})

kde4_add_executable(kbabel ${kbabel_SRCS})

target_link_libraries(kbabel  ${KDE4_KDE3SUPPORT_LIBS} kbabelcommon ktexteditor kbabeldictplugin kbabelcommonui)

install(TARGETS kbabel  DESTINATION ${BIN_INSTALL_DIR} )
install(FILES org.kde.kbabel.kbabel.xml DESTINATION ${DBUS_INTERFACES_DIR} )

########### install files ###############

install( FILES kbabel.desktop  DESTINATION  ${XDG_APPS_DIR} )
install( FILES kbabel.kcfg  DESTINATION  ${KCFG_INSTALL_DIR} )
install( FILES kbabelui.rc  DESTINATION  ${DATA_INSTALL_DIR}/kbabel )
install( FILES kbabel-project.upd kbabel-difftoproject.upd  DESTINATION  ${KCONF_UPDATE_INSTALL_DIR} )

kde4_install_icons( ${ICON_INSTALL_DIR}   )




#original Makefile.am contents follow:

## this has all of the subdirectories that make will recurse into.  if
## there are none, comment this out
#SUBDIRS = pics icons
#
## this is the program that gets installed.  it's name is used for all
## of the other Makefile.am variables
#noinst_LTLIBRARIES = libkbabel.la
#bin_PROGRAMS = kbabel
#
## set the include path for X, qt and KDE
#INCLUDES         = -I$(srcdir)/../common -I../common -I$(srcdir)/../commonui -I../commonui -I$(srcdir)/../kbabeldict -I../kbabeldict $(all_includes)
#
#
## which sources should be compiled for kbabel
#libkbabel_la_SOURCES =	kbbookmarkhandler.cpp \
#			kbcatalog.cpp headerwidget.ui headereditor.cpp  \
#			spelldlgwidget.ui spelldlg.cpp gotodialog.cpp\
#			kbhighlighting.cpp mymultilineedit.cpp \
#			hidingmsgedit.cpp 	\
#			kbabelpref.cpp 		\
#			kbcatalogview.cpp	\
#			commentview.cpp 	\
#			contextview.cpp		\
#			charselectview.cpp	\
#			taglistview.cpp		\
#			sourceview.cpp		\
#			kbabelview.cpp kbabelview2.cpp \
#			kbabel.cpp kbabeliface.skel kbabelsplash.cpp \
#			kbabelsettings.kcfgc			\
#			fontpreferences.ui			\
#			editordiffpreferences.ui		\
#			editorpreferences.ui			\
#			searchpreferences.ui			\
#			colorpreferences.ui			\
#			kbcataloglistview.cpp kbcataloglistviewitem.cpp \
#			errorlistview.cpp	
#
#kde_kcfg_DATA=kbabel.kcfg
#
#libkbabel_la_LIBADD =  ../commonui/libkbabelcommonui.la ../kbabeldict/libkbabeldict.la $(LIB_KIO) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KDE3SUPPORT)
#libkbabel_la_LDFLAGS = $(all_libraries)
#
#
#kbabel_SOURCES = main.cpp
#
## the libraries to link against.
#kbabel_LDADD   = libkbabel.la
#kbabel_LDFLAGS = $(all_libraries) $(KDE_RPATH)
#
## these are the headers for your project
#noinst_HEADERS   = kbabel.h kbabelview.h \
#		   kbcatalogview.h	\
#		   commentview.h	\
#		   contextview.h	\
#		   charselectview.h	\
#		   taglistview.h	\
#		   sourceview.h		\
#		   kbabeliface.h kbabelpref.h\
#                   headereditor.h mymultilineedit.h\
#                   gotodialog.h hidingmsgedit.h\
#                   kbcatalog.h spelldlg.h\
#                   kbabelsplash.h kbbookmarkhandler.h \
#		   kbhighlighting.h	\
#		   kbcataloglistview.h	\
#		   kbcataloglistviewitem.h	\
#		   errorlistview.h
#
## let automoc handle all of the meta source files (moc)
#METASOURCES = AUTO
#
#rcdir = $(kde_datadir)/kbabel
#rc_DATA = kbabelui.rc
#
#update_DATA = kbabel-project.upd kbabel-difftoproject.upd
#updatedir = $(kde_datadir)/kconf_update
#
#api:
#	mkdir -p API && kdoc -d API -u $$PWD/API -p  -lkdeui -lkdecore -lqt -ldcop $(noinst_HEADERS)
#
#distclean-local:
#	rm -r -f API
#
#KDE_ICON = kbabel
#
# # this is where the kdelnk file will go
#xdg_apps_DATA = kbabel.desktop
