# Build environment settings for the NateOn client for Linux
# nateon/nateon/CMakeLists.txt
#
# Author: Park "segfault" Joon-Kyu <mastermind@planetmono.org>

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
	${XSCRNSAVER_INCLUDE_DIRS} ${SCRNSAVERPROTO_INCLUDE_DIRS} ${LIBAO_INCLUDE_DIR})

# Source file decl's
set(knateon_buddy_SRCS
	buddy/buddy.cpp
	buddy/buddybase.cpp
	buddy/buddylist.cpp
	buddy/group.cpp
	buddy/grouplist.cpp
	buddy/mylistitem.cpp
)

set(knateon_chat_SRCS
	chat/chatlist.cpp
	chat/chatview.cpp
	chat/chatviewinterface.cpp
	chat/memolist.cpp
	chat/memopopupinterface.cpp
	chat/memopopupview.cpp
	chat/memoview.cpp
	chat/memoviewinterface.cpp
	chat/textminibrowser.cpp
)

set(knateon_dialog_SRCS
	dialog/addbuddies.cpp
	dialog/addbuddyselector.cpp
	dialog/addfriendinterface.cpp
	dialog/addfriendview.cpp
	dialog/allowaddfriend.cpp
	dialog/allowdialoginterface.cpp
	dialog/confirmsavelog.cpp
	dialog/deletebuddyview.cpp
	dialog/emoticonselector.cpp
	dialog/emoticonwindow.cpp
	dialog/filetransfer.cpp
	dialog/filetransferinterface.cpp
	dialog/inputbox.cpp
	dialog/networkwindow.cpp
	dialog/preferencecyid.cpp
	dialog/preferenceinterface.cpp
	dialog/preferenceview.cpp
	dialog/soundconfig.cpp
	dialog/soundconfigview.cpp
	dialog/webviewer.cpp
	dialog/webwindow.cpp
)

set(knateon_network_SRCS
	network/knateonbuffer.cpp
	network/mimemessage.cpp
	network/nateonconnection.cpp
	network/nateondpconnection.cpp
	network/nateondplconnection.cpp
	network/p2pconnection.cpp
	network/p2pserver.cpp
	network/sendfileinfo.cpp
	network/serversocket.cpp
	network/ssconnection.cpp
	network/nomhttpproxy.cpp
	network/nomp2pbase.cpp
	network/nomp2plist.cpp
)

set(knateon_util_SRCS
	util/commandqueue.cpp
	util/common.cpp
	util/emoticon.cpp
	util/md5.cpp
	util/sound.cpp
	util/urlencode.cpp
)

set(knateon_SRCS
	${knateon_buddy_SRCS}
	${knateon_chat_SRCS}
	${knateon_dialog_SRCS}
	${knateon_network_SRCS}
	${knateon_util_SRCS}
	buddylistview.cpp
	account.cpp
	contactbase.cpp
	contactlist.cpp
	contactroot.cpp
	currentaccount.cpp
	hompybutton.cpp
	idletimer.cpp
	knateon.cpp
	knateonmainview.cpp
	knateonmainviewinterface.cpp
	knateonview.cpp
	loginview.cpp
	loginviewinterface.cpp
	logoutview.cpp
	main.cpp
	systemtraywidget.cpp
	toastwindow.cpp
	xautolock.cpp
)

# Data decl's
set(knateon_emoticons_DATA
	emoticons/Emoticons_u.sm emoticons/Chat_FileCancel.png emoticons/Chat_Warning.png
	emoticons/Chat_Game.png emoticons/Chat_Start.png emoticons/Chat_Exit.png
	emoticons/Chat_Separator.png emoticons/Chat_Flashcon.png emoticons/Chat_GameEnd.png
	emoticons/Chat_Video.png emoticons/emoticon_tab.png emoticons/Chat_ShareEnd.png
	emoticons/Chat_LinkOn.png emoticons/Chat_File.png emoticons/Chat_VideoEnd.png
	emoticons/Chat_SpionEnd.png emoticons/Chat_Share.png emoticons/Chat_Spion.png
	emoticons/01.png emoticons/02.png emoticons/03.png emoticons/04.png emoticons/05.png
	emoticons/06.png emoticons/07.png emoticons/08.png emoticons/09.png emoticons/10.png
	emoticons/11.png emoticons/12.png emoticons/13.png emoticons/14.png emoticons/15.png
	emoticons/16.png emoticons/17.png emoticons/18.png emoticons/19.png emoticons/20.png
	emoticons/21.png emoticons/22.png emoticons/23.png emoticons/24.png emoticons/25.png
	emoticons/26.png emoticons/27.png emoticons/28.png emoticons/29.png emoticons/30.png
	emoticons/31.png emoticons/32.png emoticons/33.png emoticons/34.png emoticons/35.png
	emoticons/36.png emoticons/37.png emoticons/38.png emoticons/39.png emoticons/40.png
	emoticons/41.png emoticons/42.png emoticons/43.png emoticons/44.png emoticons/45.png
	emoticons/46.png emoticons/47.png emoticons/48.png emoticons/49.png emoticons/50.png
	emoticons/51.png emoticons/52.png emoticons/53.png emoticons/54.png emoticons/55.png
	emoticons/56.png emoticons/57.png emoticons/58.png emoticons/59.png emoticons/60.png
	emoticons/61.png emoticons/62.png emoticons/63.png emoticons/64.png emoticons/65.png
	emoticons/66.png emoticons/67.png emoticons/68.png emoticons/69.png emoticons/70.png
	emoticons/71.png emoticons/72.png emoticons/73.png emoticons/74.png emoticons/75.png
	emoticons/76.png emoticons/77.png emoticons/78.png emoticons/79.png emoticons/80.png
	emoticons/81.png emoticons/82.png emoticons/83.png emoticons/84.png emoticons/85.png
	emoticons/86.png emoticons/87.png emoticons/88.png emoticons/89.png emoticons/90.png
	emoticons/91.png emoticons/92.png emoticons/93.png emoticons/94.png emoticons/95.png
	emoticons/96.png emoticons/97.png emoticons/98.png emoticons/99.png emoticons/100.png
	emoticons/101.png emoticons/102.png emoticons/103.png emoticons/104.png emoticons/105.png
	emoticons/106.png emoticons/107.png emoticons/108.png emoticons/109.png emoticons/110.png
	emoticons/111.png emoticons/112.png emoticons/113.png emoticons/114.png emoticons/115.png
	emoticons/116.png emoticons/117.png emoticons/118.png emoticons/119.png emoticons/120.png
	emoticons/121.png emoticons/122.png emoticons/123.png emoticons/124.png emoticons/125.png
	emoticons/126.png emoticons/127.png emoticons/128.png emoticons/129.png emoticons/130.png
	emoticons/131.png emoticons/132.png emoticons/133.png emoticons/134.png emoticons/135.png
	emoticons/136.png emoticons/137.png emoticons/138.png emoticons/139.png emoticons/140.png
	emoticons/141.png emoticons/142.png emoticons/143.png emoticons/144.png emoticons/201.png
	emoticons/202.png emoticons/203.png emoticons/204.png emoticons/205.png emoticons/206.png
)

set(knateon_sound_DATA
	sound/minihompy.wav sound/recv_memo.wav sound/trans_comp.wav sound/login.wav
	sound/buddy_login.wav sound/recv_chat.wav sound/recv_mail.wav
)

set(knateon_pics_DATA
	pics/StatusBigIcons.bmp pics/bd_buddy_add_btn.bmp pics/bd_buddy_add_btn_down.bmp
	pics/bd_buddy_add_btn_ov.bmp pics/bd_group_add_btn.bmp pics/bd_group_add_btn_down.bmp
	pics/bd_group_add_btn_ov.bmp pics/bd_menu_btn.bmp pics/bd_menu_btn_down.bmp
	pics/bd_menu_btn_ov.bmp pics/bd_search_left_bg.bmp pics/bi.bmp pics/bi2.bmp
	pics/bi3.bmp pics/bi4.bmp pics/bt_img_100.bmp pics/bt_img_100_down.bmp
	pics/bt_img_100_ov.bmp pics/bt_img_120.bmp pics/bt_img_120_down.bmp pics/bt_img_120_ov.bmp
	pics/bt_img_140.bmp pics/bt_img_140_down.bmp pics/bt_img_140_ov.bmp pics/bt_img_40.bmp
	pics/bt_img_40_down.bmp pics/bt_img_40_ov.bmp pics/bt_img_60.bmp pics/bt_img_60_down.bmp
	pics/bt_img_60_ov.bmp pics/bt_img_80.bmp pics/bt_img_80_down.bmp pics/bt_img_80_ov.bmp
	pics/bt_img_allrepl_down.bmp pics/bt_img_allrepl_nor.bmp pics/bt_img_allrepl_ov.bmp
	pics/bt_img_cancel_down.bmp pics/bt_img_cancel_nor.bmp pics/bt_img_cancel_ov.bmp
	pics/bt_img_del_down.bmp pics/bt_img_del_nor.bmp pics/bt_img_del_ov.bmp
	pics/bt_img_forw_down.bmp pics/bt_img_forw_nor.bmp pics/bt_img_forw_ov.bmp
	pics/bt_img_fulldown_140.bmp pics/bt_img_fulldown_140_down.bmp
	pics/bt_img_fulldown_140_ov.bmp pics/bt_img_in_down.bmp pics/bt_img_in_nor.bmp
	pics/bt_img_in_ov.bmp pics/bt_img_ok_down.bmp pics/bt_img_ok_nor.bmp pics/bt_img_ok_ov.bmp
	pics/bt_img_out_down.bmp pics/bt_img_out_nor.bmp pics/bt_img_out_ov.bmp
	pics/bt_img_receiver_down.bmp pics/bt_img_receiver_nor.bmp pics/bt_img_receiver_ov.bmp
	pics/bt_img_repl_down.bmp pics/bt_img_repl_nor.bmp pics/bt_img_repl_ov.bmp
	pics/bt_img_rewri_down.bmp pics/bt_img_rewri_nor.bmp pics/bt_img_rewri_ov.bmp
	pics/bt_img_search_down.bmp pics/bt_img_search_nor.bmp pics/bt_img_search_ov.bmp
	pics/bt_img_send_down.bmp pics/bt_img_send_nor.bmp pics/bt_img_send_ov.bmp
	pics/buddylist_bg.bmp pics/chat_fileroom_private_btn.bmp pics/chat_info_btn.bmp
	pics/chat_top2_center_bg.bmp pics/chw_bg_bar_icon.bmp pics/chw_bt_img_send60.bmp
	pics/chw_bt_img_send60_down.bmp pics/chw_bt_img_send60_ov.bmp pics/chw_bt_send_down.bmp
	pics/chw_bt_send_nor.bmp pics/chw_bt_send_ov.bmp pics/chw_emoti_icons_bg.bmp
	pics/chw_emoti_tab_bg.bmp pics/chw_emoti_tab_on.bmp pics/chw_emoti_titleicon.bmp
	pics/chw_emoticon.bmp pics/chw_emoticon_down.bmp pics/chw_emoticon_ov.bmp
	pics/chw_font.bmp pics/chw_font_down.bmp pics/chw_font_ov.bmp pics/chw_fontcolor.bmp
	pics/chw_fontcolor_down.bmp pics/chw_fontcolor_ov.bmp pics/chw_ico_invite.bmp
	pics/chw_ico_invite_down.bmp pics/chw_ico_invite_ov.bmp pics/chw_ico_sendfile.bmp
	pics/chw_ico_sendfile_down.bmp pics/chw_ico_sendfile_ov.bmp pics/chw_nameid_bg.bmp
	pics/comm_checkbox.bmp pics/comm_checkbox_ovre.bmp pics/hotkey_sms_down.bmp
	pics/hotkey_sms_nor.bmp pics/hotkey_sms_ov.bmp pics/list_title_bluebg.bmp
	pics/main_hompy_btn.bmp pics/main_hompy_btn_down.bmp pics/main_hompy_btn_ov.bmp
	pics/main_hompy_new_btn.bmp pics/main_hompy_new_btn_down.bmp pics/main_hompy_new_btn_ov.bmp
	pics/main_list_folder_close.bmp pics/main_list_folder_open.bmp pics/main_list_hompy.bmp
	pics/main_list_hompy_new.bmp pics/main_list_state_meeting.bmp
	pics/main_list_state_offline.bmp pics/main_list_state_online.bmp
	pics/main_list_state_onphone.bmp pics/main_list_state_otherbusiness.bmp
	pics/main_list_state_vacant.bmp pics/main_mail_count_btn.bmp pics/main_memo_count_btn.bmp
	pics/main_memo_count_btn_down.bmp pics/main_memo_count_btn_ov.bmp
	pics/main_memo_count_new_btn.bmp pics/main_memo_count_new_btn_down.bmp
	pics/main_memo_count_new_btn_ov.bmp pics/main_mycyworld_btn.bmp
	pics/main_mycyworld_btn_down.bmp pics/main_mycyworld_btn_ov.bmp
	pics/main_mycyworld_new_btn.bmp pics/main_mycyworld_new_btn_down.bmp
	pics/main_mycyworld_new_btn_ov.bmp pics/main_sms_btn.bmp pics/main_tbox_btn.bmp
	pics/popup_notice_bg.bmp pics/popup_notice_chat.bmp pics/popup_notice_close.bmp
	pics/popup_notice_cy_bg.bmp pics/popup_notice_cy_close.bmp pics/popup_notice_cy_cylogo.bmp
	pics/popup_notice_cy_natelogo.bmp pics/popup_notice_mail.bmp pics/popup_notice_memo.bmp
	pics/popup_notice_title.bmp pics/rogin_bt_login_down.bmp pics/rogin_bt_login_nor.bmp
	pics/rogin_bt_login_cancel_down.bmp pics/rogin_bt_login_cancel_nor.bmp pics/rogin_bt_login_cancel_ov.bmp
	pics/rogin_bt_login_ov.bmp pics/rogin_partline.bmp pics/rogin_title_img.bmp
	pics/search_reset_btn.bmp pics/sett_icon_01.bmp pics/sett_icon_02.bmp pics/sett_icon_03.bmp
	pics/sett_icon_04.bmp pics/sett_icon_05.bmp pics/sett_icon_06.bmp pics/sett_icon_07.bmp
	pics/sett_icon_08.bmp pics/sett_icon_09.bmp pics/sett_icon_10.bmp pics/sett_titl_01.bmp
	pics/sett_titl_02.bmp pics/sett_titl_03.bmp pics/sett_titl_04.bmp pics/sett_titl_05.bmp
	pics/sett_titl_06.bmp pics/sett_titl_07.bmp pics/sett_titl_08.bmp pics/sett_titl_09.bmp
	pics/sett_titl_10.bmp pics/slidewnd_default.bmp pics/slidewnd_login.bmp pics/title_icon.bmp
	pics/title_icon_02.bmp pics/DefTicker.gif pics/away.png pics/busy.png
	pics/chat_fileroom_private_btn.png pics/hi16-app-knateon.png pics/main_list_folder_close.png
	pics/main_list_folder_open.png pics/main_list_hompy.png pics/main_list_hompy_new.png
	pics/main_list_state_cut_offline.png pics/main_list_state_cut_online.png
	pics/main_list_state_meeting.png pics/main_list_state_offline.png
	pics/main_list_state_online.png pics/main_list_state_onphone.png
	pics/main_list_state_otherbusine.png pics/main_list_state_otherbusiness.png
	pics/main_list_state_vacant.png pics/meeting.png pics/offline.png pics/online.png
	pics/onthephone.png
)

# Compile target and parameters
kde3_automoc(${knateon_SRCS})
kde3_add_dcop_skels(knateon_SRCS knateondcop.h)
kde3_add_executable(knateon ${knateon_SRCS})

set_target_properties(knateon PROPERTIES OUTPUT_NAME nateon)

set(nateon_LIBS
kdeui 
kio 
DCOP 
kparts 
khtml
${SQLITE3_LIBRARIES} 
${XSCRNSAVER_LIBRARIES}
gcrypt
${LIBAO_LIBRARY})

target_link_libraries(knateon knateon_shared 
	pthread
	${QT_AND_KDECORE_LIBS}
	-L${KDE3_LIB_DIR}
	${nateon_LIBS}
	# ${KDE3_ARTSC_LIBRARY} ${KDE3_ARTSKDE_LIBRARY}
	# ${SQLITE3_LIBRARIES} ${XSCRNSAVER_LIBRARIES} gcrypt
)

# Install
install(TARGETS knateon DESTINATION ${BIN_INSTALL_DIR})
# kde3_install_icons(hicolor)
# kde3_install_icons(locolor)
SUBDIRS(hicolor locolor)
install(FILES nateon.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}/kde)
install(FILES knateonui.rc DESTINATION ${DATA_INSTALL_DIR}/nateon)
install(FILES ${knateon_emoticons_DATA} DESTINATION ${DATA_INSTALL_DIR}/nateon/emoticons)
install(FILES ${knateon_sound_DATA} DESTINATION ${DATA_INSTALL_DIR}/nateon/sound)
install(FILES ${knateon_pics_DATA} DESTINATION ${DATA_INSTALL_DIR}/nateon/pics)
