Commit fca56814 authored by Christophe Giboudeaux's avatar Christophe Giboudeaux
Browse files

CMake: Use the imported Boost targets

This reapplies the changes from 65689f19.
Now that we depend on CMake >= 3.5, Boost::boost can
be used.
parent aa7b4ff4
Pipeline #39478 failed with stage
in 28 minutes and 59 seconds
......@@ -79,7 +79,13 @@ option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
set(Boost_MINIMUM_VERSION "1.34.0")
find_package(Boost ${Boost_MINIMUM_VERSION})
# The Boost CMake config files have been incompatible with the CMake files for
# a long time. We'll only use what CMake's FindBoost.cmake module provides
# until the minimum Boost version is raised to 1.70.
set(Boost_NO_BOOST_CMAKE ON)
find_package(Boost ${Boost_MINIMUM_VERSION} MODULE REQUIRED)
set_package_properties(Boost PROPERTIES
DESCRIPTION "Boost C++ Libraries"
URL "https://www.boost.org"
......
......@@ -30,6 +30,7 @@ if(BUILD_TESTING)
find_dependency(Qt5Test "@QT_REQUIRED_VERSION@")
endif()
set(Boost_NO_BOOST_CMAKE ON)
find_dependency(Boost "@Boost_MINIMUM_VERSION@")
include(${CMAKE_CURRENT_LIST_DIR}/KF5AkonadiTargets.cmake)
......
......@@ -16,10 +16,6 @@ option(AKONADI_RUN_PGSQL_ISOLATED_TESTS "Run isolated tests with PostgreSQL as b
kde_enable_exceptions()
include_directories(
${Boost_INCLUDE_DIR}
)
# convenience macro to add akonadi qtestlib unit-tests
macro(add_akonadi_test _source)
set(_test ${_source} ${CMAKE_BINARY_DIR}/src/core/akonadicore_debug.cpp)
......
include_directories(
${Boost_INCLUDE_DIR}
)
include(${CMAKE_SOURCE_DIR}/KF5AkonadiMacros.cmake)
kde_enable_exceptions()
......
include_directories(
${Boost_INCLUDE_DIR}
)
kde_enable_exceptions()
add_library(akonadi_test_searchplugin MODULE testsearchplugin.cpp)
......
......@@ -55,7 +55,7 @@ generate_export_header(KF5AkonadiAgentBase BASE_NAME akonadiagentbase)
add_library(KF5::AkonadiAgentBase ALIAS KF5AkonadiAgentBase)
target_include_directories(KF5AkonadiAgentBase INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiAgentBase;${Boost_INCLUDE_DIR}>")
target_include_directories(KF5AkonadiAgentBase INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiAgentBase>")
target_link_libraries(KF5AkonadiAgentBase
PUBLIC
......
......@@ -298,10 +298,9 @@ add_library(KF5AkonadiCore ${akonadicore_SRCS})
generate_export_header(KF5AkonadiCore BASE_NAME akonadicore)
add_library(KF5::AkonadiCore ALIAS KF5AkonadiCore)
target_include_directories(KF5AkonadiCore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiCore;${Boost_INCLUDE_DIR}>")
target_include_directories(KF5AkonadiCore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiCore>")
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${Akonadi_SOURCE_DIR}/src/core;${Akonadi_BINARY_DIR}/src/core;${Akonadi_BINARY_DIR}/src/private>")
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${Akonadi_BINARY_DIR};${Akonadi_SOURCE_DIR}/src/core/jobs;${Akonadi_SOURCE_DIR}/src/core/models;${Akonadi_SOURCE_DIR}/src/core/attributes>")
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>")
kde_target_enable_exceptions(KF5AkonadiCore PUBLIC)
......@@ -310,6 +309,7 @@ PUBLIC
KF5::CoreAddons # for KJob
KF5::ItemModels
Qt5::Gui # for QColor
Boost::boost
PRIVATE
Qt5::Network
Qt5::Widgets
......
......@@ -105,7 +105,7 @@ generate_export_header(KF5AkonadiWidgets BASE_NAME akonadiwidgets)
add_library(KF5::AkonadiWidgets ALIAS KF5AkonadiWidgets)
target_include_directories(KF5AkonadiWidgets INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiWidgets;${Boost_INCLUDE_DIR}>")
target_include_directories(KF5AkonadiWidgets INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiWidgets>")
target_link_libraries(KF5AkonadiWidgets
PUBLIC
......
......@@ -11,10 +11,6 @@ file(MAKE_DIRECTORY ${TEST_RESULT_OUTPUT_PATH})
kde_enable_exceptions()
include_directories(
${Boost_INCLUDE_DIR}
)
# convenience macro to add akonadi demo application
macro(add_akonadi_demo _source)
set(_test ${_source})
......
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/..
${Boost_INCLUDE_DIR}
)
kde_enable_exceptions()
......
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