add_definitions(-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS)

#add_subdirectory( ui ) 
add_subdirectory( icons ) 

message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}: skipped subdir $(WEBCAM)")
include_directories( 
${KOPETE_INCLUDES} 
${CMAKE_CURRENT_BINARY_DIR}/ui/ 
${CMAKE_CURRENT_SOURCE_DIR}/ui/ 
)


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

set(kopete_msn_PART_SRCS ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp webcam.cpp )


file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "//autogenerated file by cmake\n#include \"kdemacros.h\"\nextern \"C\" KDE_EXPORT void *init_libkopete_msn_shared();\nextern \"C\" KDE_EXPORT void *init_kopete_msn() { return init_libkopete_msn_shared(); }\n\n")
kde4_add_plugin(kopete_msn ${kopete_msn_PART_SRCS})


target_link_libraries(kopete_msn  ${KDE4_KDECORE_LIBS} kopete_msn_shared )

install(TARGETS kopete_msn  DESTINATION ${PLUGIN_INSTALL_DIR})


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

set(kopete_msn_ui_SRCS ui/msneditaccountwidget.cpp)

kde4_add_ui_files(kopete_msn_ui_SRCS 
   ui/msnadd.ui 
   ui/msndebugrawcommand_base.ui 
   ui/msninfo.ui 
   ui/msneditaccountui.ui
)

set(kopete_msn_shared_LIB_SRCS 
   ${kopete_msn_ui_SRCS}
   msnprotocol.cpp 
   msnaccount.cpp 
   msnaddcontactpage.cpp 
   msncontact.cpp 
   msnsocket.cpp 
   msnchatsession.cpp 
   msndebugrawcmddlg.cpp 
   msnnotifysocket.cpp 
   msnswitchboardsocket.cpp 
   msnfiletransfersocket.cpp 
   msninvitation.cpp 
   msnsecureloginhandler.cpp 
   msnchallengehandler.cpp 
   dispatcher.cpp 
   p2p.cpp 
   messageformatter.cpp 
   incomingtransfer.cpp 
   outgoingtransfer.cpp 
)

kde4_add_library(kopete_msn_shared SHARED ${kopete_msn_shared_LIB_SRCS})

target_link_libraries(kopete_msn_shared  ${KDE4_KIO_LIBS} kopete  ${QT_QT3SUPPORT_LIBRARY} ${KDE4_KUTILS_LIBS})
if(NOT WIN32)
  target_link_libraries(kopete_msn_shared kopete_videodevice)
endif(NOT WIN32)

set_target_properties(kopete_msn_shared PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
install(TARGETS kopete_msn_shared ${INSTALL_TARGETS_DEFAULT_ARGS})


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

install( FILES kopete_msn.desktop  DESTINATION ${SERVICES_INSTALL_DIR})
install( FILES msnchatui.rc  DESTINATION ${DATA_INSTALL_DIR}/kopete_msn)




