find_package (OpenGL REQUIRED)
include_directories(${CMAKE_SOURCE_DIR}/src/kryonmr/kryonmr ${CMAKE_SOURCE_DIR}/src/kryopart/kryomolcore ${CMAKE_SOURCE_DIR}/src/kryopart/kryomolcore/molecule ${CMAKE_SOURCE_DIR}/src/kryopart/kryomolcore/parsers ${CMAKE_SOURCE_DIR}/src/tools ${CMAKE_SOURCE_DIR}/src/kryopart/kryomolcore/tools 
${CMAKE_CURRENT_BINARY_DIR}/../kryomolcore
${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )

add_definitions(-fexceptions )
########### next target ###############

set(kryomol_LIB_SRCS chimeinterpreter.cpp kryomol.cpp)

kde4_add_plugin(kryomolpart  ${kryomol_LIB_SRCS})

target_link_libraries(kryomolpart ${KDE4_KDECORE_LIBS} 
kryomolcore kryomolecule kryoparsers kryotools
${KDE4_KDEUI_LIBS} ${KDE4_KHTML_LIBS} ${KDE4_KPARTS_LIBS} ${KDE4_KDE3SUPPORT_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} )

install(TARGETS kryomolpart DESTINATION ${PLUGIN_INSTALL_DIR})


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

install(FILES  kryomolpart.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install(FILES  kryomolpart.rc DESTINATION ${DATA_INSTALL_DIR}/kryomol )



#original Makefile.am contents follow:

######## kdevelop will overwrite this part!!! (begin)##########
#lib_LTLIBRARIES = libkryomol.la
#
#METASOURCES = AUTO
#
#INCLUDES = -I$(top_srcdir)/src/kryonmr/kryonmr \
#	-I$(top_srcdir)/src/kryopart/kryomolcore -I$(top_srcdir)/src/kryopart/kryomolcore/molecule \
#	-I$(top_srcdir)/src/kryopart/kryomolcore/parsers -I$(top_srcdir)/src/tools \
#	-I$(top_srcdir)/src/kryopart/kryomolcore/tools $(all_includes)
#
#AM_CXXFLAGS = -fPIC
#KDE_CXXFLAGS = $(USE_EXCEPTIONS)
#
#libkryomol_la_LIBADD = \
#	$(top_builddir)/src/kryopart/kryomolcore/libkryomolcore.la $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KHTML) $(LIB_KPARTS) $(LIB_QT) -lGL \
#	-lGLU
#
#libkryomol_la_LDFLAGS = -avoid-version  $(all_libraries)
#
#
#
#noinst_HEADERS = chimeinterpreter.h kryomol.h
#
#libkryomol_la_SOURCES = chimeinterpreter.cpp kryomol.cpp
#
#rcdir = $(kde_datadir)/kryomol
#rc_DATA =kryomolpart.rc
#
## this is where the desktop file will go 
#partdesktopdir = $(kde_servicesdir)
#partdesktop_DATA = kryomolpart.desktop
#
######## kdevelop will overwrite this part!!! (end)############
## These paths are KDE specific. Use them:
## kde_appsdir         Where your application's menu entry (.desktop) should go to.
## kde_icondir         Where your icon should go to - better use KDE_ICON.
## kde_sounddir        Where your sounds should go to.
## kde_htmldir         Where your docs should go to. (contains lang subdirs)
## kde_datadir         Where you install application data. (Use a subdir)
## kde_locale          Where translation files should go to. (contains lang subdirs)
## kde_cgidir          Where cgi-bin executables should go to.
## kde_confdir         Where config files should go to (system-wide ones with default values).
## kde_mimedir         Where mimetypes .desktop files should go to.
## kde_servicesdir     Where services .desktop files should go to.
## kde_servicetypesdir Where servicetypes .desktop files should go to.
## kde_toolbardir      Where general toolbar icons should go to (deprecated, use KDE_ICON).
## kde_wallpaperdir    Where general wallpapers should go to.
## kde_templatesdir    Where templates for the "New" menu (Konqueror/KDesktop) should go to.
## kde_bindir          Where executables should go to. Use bin_PROGRAMS or bin_SCRIPTS.
## kde_libdir          Where shared libraries should go to. Use lib_LTLIBRARIES.
## kde_moduledir       Where modules (e.g. parts) should go to. Use kde_module_LTLIBRARIES.
## kde_styledir        Where Qt/KDE widget styles should go to (new in KDE 3).
## kde_designerdir     Where Qt Designer plugins should go to (new in KDE 3).
#
#
#
#
#
#
#
#
