
file(GLOB GUI_FORMS forms/*.ui)

set(GUI_SOURCES
	bitcoin.cpp
	bitcoingui.cpp
	transactiontablemodel.cpp
	addresstablemodel.cpp
	optionsdialog.cpp
	sendcoinsdialog.cpp
	addressbookpage.cpp
	signverifymessagedialog.cpp
	aboutdialog.cpp
	editaddressdialog.cpp
	bitcoinaddressvalidator.cpp
	clientmodel.cpp
	guiutil.cpp
	transactionrecord.cpp
	optionsmodel.cpp
	monitoreddatamapper.cpp
	transactiondesc.cpp
	transactiondescdialog.cpp
	bitcoinstrings.cpp
	bitcoinamountfield.cpp
	transactionfilterproxy.cpp
	transactionview.cpp
	walletmodel.cpp
	walletview.cpp
	walletstack.cpp
	walletframe.cpp
	overviewpage.cpp
	csvmodelwriter.cpp
	sendcoinsentry.cpp
	qvalidatedlineedit.cpp
	bitcoinunits.cpp
	qvaluecombobox.cpp
	askpassphrasedialog.cpp
	notificator.cpp
	paymentserver.cpp
	rpcconsole.cpp
	splashscreen.cpp
	)

include_directories(.)
include_directories(..)
include_directories(${QT_INCLUDES})

include(${QT_USE_FILE})

# As all intermediate files are generated outside the source tree, the header
# file generated by uic will not be located by the compiler. In order to
# handle this, the build directory needs to be added to the list of include
# directories. 
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_subdirectory(locale)

# This is a bit annoying but at least it allows out-of-source 
# building.  We copy the qrc and resource files to the build 
# directory to allow rcc to get the relative paths correct.
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/bitcoin.qrc DESTINATION
	  ${CMAKE_CURRENT_BINARY_DIR})

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/res DESTINATION
	  ${CMAKE_CURRENT_BINARY_DIR})

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/locale DESTINATION
	  ${CMAKE_CURRENT_BINARY_DIR})

# Generate intermediate Qt-specific files from .ui and .h
qt4_wrap_ui(FORMS_HEADERS ${GUI_FORMS})
qt4_add_resources(RESOURCES_RCC ${CMAKE_CURRENT_BINARY_DIR}/bitcoin.qrc)

add_library(protosharesqt
	${GUI_SOURCES}
	${BITCOIN_QM_FILES}
	${FORMS_HEADERS}
	${RESOURCES_RCC}
	)

set_target_properties(protosharesqt PROPERTIES AUTOMOC TRUE)

target_link_libraries(protosharesqt protoshares leveldb
	${CMAKE_THREAD_LIBS_INIT}
	${BDB_LIBRARY}
	${Boost_LIBRARIES}
	${OPENSSL_LIBRARIES}
	)

add_dependencies(protosharesqt protoshares_translations)

qt4_use_modules(protosharesqt Core Gui Network)

add_executable(protoshares-qt bitcoin.cpp)

target_link_libraries(protoshares-qt protosharesqt)
