2011-07-18 14:19:06 +00:00
|
|
|
project( SnoreNotify )
|
2014-03-23 19:19:10 +00:00
|
|
|
cmake_minimum_required( VERSION 2.8.9 )
|
2011-07-18 14:19:06 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_PREFIX_PATH}/share/apps/cmake/modules)
|
2013-07-06 12:12:38 +00:00
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
|
2014-03-23 16:53:49 +00:00
|
|
|
cmake_policy(SET CMP0020 NEW)
|
|
|
|
|
2014-01-14 10:15:43 +00:00
|
|
|
include(GNUInstallDirs)
|
2014-03-23 19:19:10 +00:00
|
|
|
include(CMakeDependentOption)
|
2014-01-14 10:15:43 +00:00
|
|
|
|
2011-07-18 14:19:06 +00:00
|
|
|
|
2011-11-12 18:20:58 +00:00
|
|
|
#######################################################################
|
2014-01-23 12:57:54 +00:00
|
|
|
option(WITH_FRONTENDS "Build frontends currently only useful if WITH_SNORE_DEAMON=ON" OFF)
|
2011-10-07 10:51:37 +00:00
|
|
|
option(WITH_GROWL_BACKEND "Build the Growl backend" ON)
|
2013-07-24 10:34:45 +00:00
|
|
|
option(WITH_SNORE_DEAMON "Build the Snore deamon, which redirects notifications" OFF)
|
2014-03-23 15:11:11 +00:00
|
|
|
option(WITH_QT4 "Use Qt4" ON)
|
2014-03-24 17:18:48 +00:00
|
|
|
cmake_dependent_option(WITH_KDE "Try to build with KDE support if availibe" ON "NOT WITH_QT4" OFF)
|
|
|
|
cmake_dependent_option(WITH_FREEDESKTOP_FRONTEND "Build the freedesktop frontend" OFF "WITH_SNORE_DEAMON" ON)
|
2011-11-12 18:20:58 +00:00
|
|
|
#######################################################################
|
|
|
|
|
2013-07-06 23:52:28 +00:00
|
|
|
set(SNORE_VERSION_MAJOR 0)
|
2014-01-10 17:31:28 +00:00
|
|
|
set(SNORE_VERSION_MINOR 5)
|
|
|
|
set(SNORE_VERSION_SUFFIX "pre")
|
2013-03-13 10:15:48 +00:00
|
|
|
|
2014-03-24 17:18:48 +00:00
|
|
|
if(WITH_KDE)
|
2014-01-14 10:01:22 +00:00
|
|
|
find_package(KDE4)
|
|
|
|
endif()
|
2013-07-06 12:12:38 +00:00
|
|
|
|
2014-03-23 15:11:11 +00:00
|
|
|
set(SNORE_SUFFIX "")
|
2014-03-24 17:22:14 +00:00
|
|
|
set(SNORE_CamelCase_SUFFIX "")
|
2011-07-23 11:14:37 +00:00
|
|
|
if(KDE4_FOUND)
|
2014-01-14 10:01:22 +00:00
|
|
|
add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS} -D_UNICODE)
|
|
|
|
include_directories(${KDE4_INCLUDES})
|
2014-03-23 15:11:11 +00:00
|
|
|
else()
|
2014-03-23 19:19:10 +00:00
|
|
|
if(WITH_QT4)
|
2014-03-23 15:11:11 +00:00
|
|
|
find_package(Qt4 REQUIRED)
|
2014-03-23 19:19:10 +00:00
|
|
|
else()
|
|
|
|
find_package(Qt5Core REQUIRED)
|
|
|
|
find_package(Qt5Widgets REQUIRED)
|
|
|
|
find_package(Qt5Network REQUIRED)
|
2014-03-23 19:35:30 +00:00
|
|
|
find_package(Qt5DBus QUIET)
|
2014-07-03 09:23:14 +00:00
|
|
|
find_package(Qt5Declarative REQUIRED)
|
2014-03-23 19:19:10 +00:00
|
|
|
include(ECMQt4To5Porting)
|
|
|
|
set(SNORE_SUFFIX "-qt5")
|
2014-03-24 17:22:14 +00:00
|
|
|
set(SNORE_CamelCase_SUFFIX "Qt5")
|
2014-03-23 15:11:11 +00:00
|
|
|
endif()
|
|
|
|
include_directories( ${QT_INCLUDES} )
|
2014-01-14 10:01:22 +00:00
|
|
|
include(NoKDE)
|
2014-03-23 15:11:11 +00:00
|
|
|
endif()
|
2011-07-23 11:14:37 +00:00
|
|
|
|
|
|
|
|
2011-07-19 16:18:30 +00:00
|
|
|
find_package( CryptoPP )
|
2011-07-25 15:15:58 +00:00
|
|
|
find_package( Boost COMPONENTS system thread)
|
2011-07-18 14:19:06 +00:00
|
|
|
|
2014-01-20 09:19:52 +00:00
|
|
|
find_package(Doxygen)
|
|
|
|
|
|
|
|
if(DOXYGEN_FOUND)
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in" "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" @only)
|
|
|
|
|
|
|
|
add_custom_target(doc
|
|
|
|
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen" VERBATIM
|
|
|
|
)
|
|
|
|
else(DOXYGEN_FOUND)
|
2014-03-23 19:19:10 +00:00
|
|
|
message(STATUS "No doxygen package found")
|
2014-01-20 09:19:52 +00:00
|
|
|
endif(DOXYGEN_FOUND)
|
|
|
|
|
2011-11-09 22:13:46 +00:00
|
|
|
|
2014-06-20 21:54:11 +00:00
|
|
|
|
|
|
|
set(LIBSNORE_PLUGIN_PATH ${CMAKE_INSTALL_LIBDIR}/libsnore${SNORE_SUFFIX})
|
|
|
|
set(LIBSNORE_FULL_PLUGIN_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/libsnore${SNORE_SUFFIX})
|
|
|
|
|
2014-01-14 10:15:43 +00:00
|
|
|
set(SNORE_PLUGIN_INSTALL_PATH LIBRARY DESTINATION ${LIBSNORE_PLUGIN_PATH})
|
2014-06-20 21:54:11 +00:00
|
|
|
add_definitions(-DLIBSNORE_PLUGIN_PATH="${LIBSNORE_FULL_PLUGIN_PATH}" -DSNORE_SUFFIX="${SNORE_SUFFIX}")
|
2014-01-14 10:15:43 +00:00
|
|
|
message(STATUS "Installing plugins to ${LIBSNORE_PLUGIN_PATH}")
|
2011-07-18 14:19:06 +00:00
|
|
|
|
2014-01-23 12:57:54 +00:00
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
|
|
|
|
2011-07-18 14:19:06 +00:00
|
|
|
add_subdirectory(data)
|
|
|
|
add_subdirectory(share)
|
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
|
|
|