cmake_minimum_required(VERSION 2.6)

project (kflickr)
find_package(KDE4 REQUIRED)
include_directories(${KDE4_INCLUDES})

set(CMAKE_INCLUDE_CURRENT_DIR ON)

add_subdirectory( po )
add_subdirectory( pics )

set(kflickr_SRCS
  main.cpp
  mainwindow.cpp
  flickrcomm.cpp
  previewmgr.cpp
  sqlphototablemodel.cpp
  editorwidget.cpp
  batchwidget.cpp
  photodelegate.cpp
  uploaddlg.cpp
  exif.cpp
)

kde4_add_ui_files(kflickr_SRCS
   mainwidget.ui
   authcomplete.ui
   authquestiondlg.ui
   editorwidget.ui
   removeuser.ui
   uploaddlg.ui
)

if(QT_QTSQL_FOUND)
  message(STATUS "Found Qt4 SQL module")
else(QT_QTSQL_FOUND)
  message(STATUS "No Qt4 SQL module found")
  message(STATUS "")
  message(SEND_ERROR "kflickr needs the SQL module of Qt4")
  message(STATUS "You need to install a package containing the module with support for sqlite3.")
  message(STATUS "")
endif(QT_QTSQL_FOUND)

kde4_add_executable(kflickr ${kflickr_SRCS})
target_link_libraries(kflickr ${QT_QTSQL_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS})

install(TARGETS kflickr DESTINATION ${BIN_INSTALL_DIR})
install(FILES kflickrui.rc DESTINATION ${DATA_INSTALL_DIR}/kflickr)
