Commit 9d0884c3 authored by Christophe Giboudeaux's avatar Christophe Giboudeaux
Browse files

CMake: replace most include_directories calls

parent 95b768bb
Pipeline #54878 failed with stage
in 7 minutes and 41 seconds
......@@ -6,7 +6,6 @@ project(Akonadi VERSION ${PIM_VERSION})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# ECM setup
set(KF5_MIN_VERSION "5.80.0")
......@@ -322,6 +321,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
src
)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055100)
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DQT_NO_EMIT)
......
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${Akonadi_SOURCE_DIR}/src/akonadicontrol
${Akonadi_BINARY_DIR}/src/akonadicontrol)
macro(add_unit_test _source)
set(_test ${_source}
${Akonadi_BINARY_DIR}/src/akonadicontrol/akonadicontrol_debug.cpp
......@@ -11,6 +8,7 @@ macro(add_unit_test _source)
get_filename_component(_name ${_source} NAME_WE)
ecm_add_test(TEST_NAME ${_name} NAME_PREFIX "AkonadiControl-" ${_test})
add_dependencies(${_name} akonadi_control)
target_include_directories(${_name} BEFORE PRIVATE $<BUILD_INTERFACE:$<TARGET_PROPERTY:akonadi_control,INTERFACE_INCLUDE_DIRECTORIES>>)
if (ENABLE_ASAN)
set_tests_properties(AkonadiControl-${_name} PROPERTIES
ENVIRONMENT ASAN_OPTIONS=symbolize=1
......
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${Akonadi_SOURCE_DIR}/src/private
${Akonadi_BINARY_DIR}/src/private)
macro(add_unit_test _source)
set(_test ${_source})
get_filename_component(_name ${_source} NAME_WE)
......
......@@ -5,10 +5,6 @@ remove_definitions(-DQT_GUI_LIB)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/src/server
${Akonadi_SOURCE_DIR}/src/server)
akonadi_run_xsltproc(
XSL ${Akonadi_SOURCE_DIR}/src/server/storage/schema.xsl
XML ${CMAKE_CURRENT_SOURCE_DIR}/dbtest_data/unittest_schema.xml
......
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${Akonadi_SOURCE_DIR}/src/shared)
macro(add_unit_test _source)
set(_test ${_source})
get_filename_component(_name ${_source} NAME_WE)
......
......@@ -105,6 +105,14 @@ find_package_handle_standard_args( Sqlite DEFAULT_MSG
SQLITE_VERSION_OK
SQLITE_HAS_UNLOCK_NOTIFY)
if(Sqlite_FOUND AND NOT TARGET Sqlite::Sqlite)
add_library(Sqlite::Sqlite UNKNOWN IMPORTED)
set_target_properties(Sqlite::Sqlite PROPERTIES
IMPORTED_LOCATION "${SQLITE_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${SQLITE_INCLUDE_DIR}"
)
endif()
# show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view
mark_as_advanced( SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
########### next target ###############
set(control_SRCS
......@@ -23,7 +21,6 @@ ecm_qt_declare_logging_category(control_SRCS HEADER akonadicontrol_debug.h IDENT
EXPORT AKONADI
)
qt5_add_dbus_adaptor(control_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.AgentManager.xml agentmanager.h AgentManager)
qt5_add_dbus_adaptor(control_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.ControlManager.xml controlmanager.h ControlManager)
qt5_add_dbus_adaptor(control_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.AgentManagerInternal.xml agentmanager.h AgentManager)
......@@ -72,7 +69,6 @@ endif()
install(TARGETS akonadi_control
${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
configure_file(org.freedesktop.Akonadi.Control.service.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Akonadi.Control.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.Akonadi.Control.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
########### next target ###############
set(akonadictl_SRCS
......
add_subdirectory(protocolgen)
# TODO: Use LibLZMA::LibLZMA when we'll require CMake >= 3.14
include_directories(${LIBLZMA_INCLUDE_DIRS})
if(NOT XMLLINT_EXECUTABLE)
......
......@@ -8,11 +8,10 @@ message(STATUS "Building QSQLITE3 driver")
set(QSQLITE_INSTALL_PREFIX "${KDE_INSTALL_PLUGINDIR}/sqldrivers")
# TODO KF6: Use Qt6::CorePrivate and Qt6::SqlPrivate
include_directories(
${Qt5Core_PRIVATE_INCLUDE_DIRS}
${Qt5Sql_PRIVATE_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/src
${SQLITE_INCLUDE_DIR}
)
add_library(qsqlite3 SHARED ${QSqlite_SRCS} ${QSqlite_MOC_SRCS})
......@@ -22,7 +21,7 @@ set_target_properties(qsqlite3 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINA
target_link_libraries(qsqlite3
Qt5::Core
Qt5::Sql
${SQLITE_LIBRARIES}
Sqlite::Sqlite
)
INSTALL(TARGETS qsqlite3
......
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
########### next target ###############
set(AKONADI_DB_SCHEMA "${CMAKE_CURRENT_SOURCE_DIR}/storage/akonadidb.xml")
......
......@@ -6,9 +6,9 @@ set_package_properties(LibXml2 PROPERTIES
TYPE OPTIONAL
)
# Turn exceptions on
if (LIBXML2_FOUND)
add_definitions(-DHAVE_LIBXML2)
# TODO: Use LibXml2::LibXml2 when we'll require CMake >= 3.12
include_directories(${LIBXML2_INCLUDE_DIR})
endif ()
......
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