
find_package(KDE4Workspace)
if(NOT KDE4Workspace_FOUND)
	message(FATAL_ERROR "No KDE Workspace development package found.")
endif(NOT KDE4Workspace_FOUND)

include_directories(${KDE4_INCLUDES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

file(GLOB_RECURSE Sentinella_SRCS *.cpp)
file(GLOB Sentinella_UIS *.ui)

kde4_add_ui_files(Sentinella_SRCS ${Sentinella_UIS})
kde4_add_executable(sentinella ${Sentinella_SRCS})

	# Remember to periodically link with the parameter -Wl,--no-add-needed to check if there are missing libraries in the list below (https://fedoraproject.org/wiki/UnderstandingDSOLinkChange)
target_link_libraries(sentinella -Wl,--as-needed sysactivity ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDE4_PHONON_LIBS} processui ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBS})
install(TARGETS sentinella DESTINATION bin)

	# Installing desktop file
install(FILES sentinella.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
