Commit 800da4b4 authored by Christophe Giboudeaux's avatar Christophe Giboudeaux

Use the value set in KdepimLibsConfig.cmake. Requires commit 5a929d9

parent 04135ea4
......@@ -6,10 +6,15 @@ add_definitions(-DQT_STRICT_ITERATORS)
option(KALARM_USE_AKONADI "Build to use Akonadi" ON)
# Kalarm from kdepim master needs kdepimlibs 4.7
if(NOT ${KDE_VERSION} VERSION_GREATER 4.6.40)
if(${KDE_VERSION} VERSION_LESS 4.6.40)
set(KALARM_USE_AKONADI FALSE)
endif()
if(KALARM_USE_KRESOURCES AND KALARM_USE_AKONADI)
message(STATUS "Kalarmcal was built without Akonadi support. KAlarm will NOT be built with Akonadi support")
set(KALARM_USE_AKONADI FALSE)
endif()
if(KALARM_USE_AKONADI)
add_definitions(-DUSE_AKONADI)
else(KALARM_USE_AKONADI)
......@@ -218,34 +223,6 @@ else(KALARM_USE_AKONADI)
endif(KALARM_USE_AKONADI)
if(${KDE_VERSION} VERSION_GREATER 4.6.40)
set(_source "#include <kalarmcal/kalarmcal_export.h>
#ifdef KALARMCAL_USE_KRESOURCES
#error error
#endif
int main() { return 0; }")
set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_kalarmcal_akonadi.cpp)
file(WRITE "${_source_file}" "${_source}")
set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${KDE4_INCLUDES}")
set(_try_kalarm_akonadi_compile)
try_compile(HAVE_PIMLIBS_AKONADI ${CMAKE_BINARY_DIR} ${_source_file}
CMAKE_FLAGS "${_include_dirs};${QT_INCLUDE_DIR}"
LINK_DIRECTORIES "-DLINK_DIRECTORIES:STRING=${QT_LIBRARY_DIR}"
LINK_LIBRARIES "-DLINK_LIBRARIES:STRING=${QT4_QTCORE_LIBRARY}"
OUTPUT_VARIABLE _try_kalarm_akonadi_compile )
if(KALARM_USE_AKONADI AND NOT HAVE_PIMLIBS_AKONADI)
message(FATAL_ERROR "\nIncompatible build options between KAlarm and kdepimlibs/kalarmcal.
To use KResources, set KALARM_USE_AKONADI=OFF.
To use Akonadi, rebuild kdepimlibs with KALARM_USE_KRESOURCES=OFF.")
elseif(HAVE_PIMLIBS_AKONADI AND NOT KALARM_USE_AKONADI)
message(FATAL_ERROR "\nIncompatible build options between KAlarm and kdepimlibs/kalarmcal.
To use Akonadi, set KALARM_USE_AKONADI=ON.
To use KResources, rebuild kdepimlibs with KALARM_USE_KRESOURCES=ON.")
endif()
endif()
install(TARGETS kalarm_bin ${INSTALL_TARGETS_DEFAULT_ARGS})
#endif (UNIX)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment