Commit 615fade6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against q6

parent e41d53ea
......@@ -45,7 +45,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KPIMTEXTEDIT
)
set(QT_REQUIRED_VERSION "5.15.2")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Widgets)
########### Find packages ###########
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
......@@ -82,12 +82,16 @@ set_package_properties(Qt5TextToSpeech PROPERTIES DESCRIPTION
TYPE OPTIONAL
)
if(TARGET Qt5::TextToSpeech)
set(HAVE_TEXT_TO_SPEECH_SUPPORT TRUE)
add_definitions(-DHAVE_TEXT_TO_SPEECH_SUPPORT)
set(HAVE_TEXT_TO_SPEECH_SUPPORT FALSE)
#add_definitions(-DHAVE_TEXT_TO_SPEECH_SUPPORT)
endif()
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
if(BUILD_TESTING)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Test)
add_definitions(-DBUILD_TESTING)
endif()
......@@ -124,7 +128,7 @@ install(EXPORT KF5PimTextEditTargets
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kpimtextedit_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}
COMPONENT Devel
)
......
......@@ -2,9 +2,9 @@
# SPDX-License-Identifier: BSD-3-Clause
include(ECMAddTests)
ecm_add_tests( textutilstest.cpp editorutiltest.cpp emoticonunicodetabtest.cpp NAME_PREFIX "kpimtextedit-" LINK_LIBRARIES Qt::Test Qt::Widgets KF5::Codecs KF5PimTextEdit KF5::TextWidgets KF5::XmlGui)
ecm_add_tests( textutilstest.cpp editorutiltest.cpp emoticonunicodetabtest.cpp NAME_PREFIX "kpimtextedit-" LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::Codecs KF5PimTextEdit KF5::TextWidgets KF5::XmlGui)
ecm_add_test(slidecontainertest.cpp
TEST_NAME slidecontainertest
NAME_PREFIX kpimtextedit-widget
LINK_LIBRARIES Qt::Test Qt::Gui KF5::PimTextEdit Qt::Widgets
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Gui KF5::PimTextEdit Qt${QT_MAJOR_VERSION}::Widgets
)
......@@ -153,7 +153,7 @@ endif()
generate_export_header(KF5PimTextEdit BASE_NAME kpimtextedit)
target_include_directories(KF5PimTextEdit INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit;>")
target_include_directories(KF5PimTextEdit INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KPIMTextEdit;>")
target_include_directories(KF5PimTextEdit PUBLIC "$<BUILD_INTERFACE:${KPimTextEdit_SOURCE_DIR}/src;${KPimTextEdit_BINARY_DIR}/src>")
......@@ -277,12 +277,12 @@ ecm_generate_headers(KPimTextEdit_Camelcasecomposerng_HEADERS
if (HAVE_TEXT_TO_SPEECH_SUPPORT)
install(FILES
${KPimTextEdit_texttospeechs_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/kpimtextedit
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPIMTextEdit/kpimtextedit
COMPONENT Devel
)
install(FILES
${KPimTextEdit_CamelCasetexttospeechs_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/KPIMTextEdit/
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPIMTextEdit/KPIMTextEdit/
COMPONENT Devel
)
endif()
......@@ -296,7 +296,7 @@ install(FILES
${KPimTextEdit_composerng_HEADERS}
${KPimTextEdit_emoticon_HEADERS}
${KPimTextEdit_grantlee_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/kpimtextedit
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPIMTextEdit/kpimtextedit
COMPONENT Devel
)
......@@ -308,11 +308,11 @@ install(FILES
${KPimTextEdit_Camelcasecomposerng_HEADERS}
${KPimTextEdit_CamelCaseemoticon_HEADERS}
${KPimTextEdit_CamelCasegrantlee_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/KPIMTextEdit/
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KPIMTextEdit/KPIMTextEdit/
COMPONENT Devel
)
ecm_generate_pri_file(BASE_NAME KPIMTextEdit LIB_NAME KF5PimTextEdit DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KPIMTextEdit/)
ecm_generate_pri_file(BASE_NAME KPIMTextEdit LIB_NAME KF5PimTextEdit DEPS "" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KPIMTextEdit/)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
if (BUILD_TESTING)
......
......@@ -39,7 +39,7 @@ ecm_add_qtdesignerplugin(kpimtexteditwidgets
KPIMTextEdit::RichTextComposerWidget
LINK_LIBRARIES
KF5::PimTextEdit
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
INSTALL_DESTINATION "${KDE_INSTALL_QTPLUGINDIR}/designer"
COMPONENT Devel
)
......@@ -8,7 +8,7 @@ macro( emoticontest _source )
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(kpimtextedit-${_name})
target_link_libraries( ${_name} Qt::Test Qt::Widgets KF5::Codecs KF5PimTextEdit)
target_link_libraries( ${_name} Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::Codecs KF5PimTextEdit)
endmacro()
emoticontest(emoticontexteditselectortest.cpp)
......
......@@ -3,10 +3,10 @@
add_definitions( -DGRANTLEEBUILDER_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data" )
ecm_add_tests(texthtmlbuildertest.cpp
NAME_PREFIX "kpimtextedit-grantleebuilder-"
LINK_LIBRARIES KF5::PimTextEdit Qt::Test Qt::Widgets
LINK_LIBRARIES KF5::PimTextEdit Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets
)
ecm_add_tests(plaintextmarkupbuildertest.cpp
NAME_PREFIX "kpimtextedit-grantleebuilder-"
LINK_LIBRARIES KF5::PimTextEdit Qt::Test Qt::Widgets
LINK_LIBRARIES KF5::PimTextEdit Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets
)
......@@ -2,5 +2,5 @@
# SPDX-License-Identifier: BSD-3-Clause
ecm_add_tests(plaintexteditortest.cpp
NAME_PREFIX "kpimtextedit-plaintexteditor-"
LINK_LIBRARIES KF5::PimTextEdit KF5::KIOWidgets Qt::Test Qt::Widgets
LINK_LIBRARIES KF5::PimTextEdit KF5::KIOWidgets Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets
)
......@@ -2,5 +2,5 @@
# SPDX-License-Identifier: BSD-3-Clause
add_executable(plaintexteditor_gui plaintexteditor_gui.cpp)
target_link_libraries(plaintexteditor_gui
KF5::PimTextEdit KF5::CoreAddons Qt::Widgets KF5::I18n
KF5::PimTextEdit KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n
)
......@@ -2,5 +2,5 @@
# SPDX-License-Identifier: BSD-3-Clause
ecm_add_tests(richtexteditortest.cpp
NAME_PREFIX "kpimtextedit-richtesteditor-"
LINK_LIBRARIES KF5::PimTextEdit Qt::Test Qt::Widgets
LINK_LIBRARIES KF5::PimTextEdit Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets
)
......@@ -2,6 +2,6 @@
# SPDX-License-Identifier: BSD-3-Clause
add_executable(richtexteditor_gui richtexteditor_gui.cpp)
target_link_libraries(richtexteditor_gui
KF5::PimTextEdit KF5::CoreAddons Qt::Widgets KF5::I18n
KF5::PimTextEdit KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n
)
......@@ -3,7 +3,7 @@
macro(add_kpimtextedit_texttospeech_unittest _source)
ecm_add_test(${_source}
NAME_PREFIX "kpimtextedit-texttospeech-"
LINK_LIBRARIES Qt::Test KF5::PimTextEdit Qt::Widgets
LINK_LIBRARIES Qt${QT_MAJOR_VERSION}::Test KF5::PimTextEdit Qt${QT_MAJOR_VERSION}::Widgets
)
endmacro()
......
......@@ -2,21 +2,21 @@
# SPDX-License-Identifier: BSD-3-Clause
add_executable(texttospeechwidget_gui texttospeechwidget_gui.cpp)
target_link_libraries(texttospeechwidget_gui
KF5::PimTextEdit KF5::CoreAddons Qt::Widgets KF5::I18n
KF5::PimTextEdit KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n
)
add_executable(texttospeechgui texttospeechgui.cpp)
target_link_libraries(texttospeechgui
KF5::PimTextEdit KF5::CoreAddons Qt::Widgets KF5::I18n
KF5::PimTextEdit KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n
)
add_executable(texttospeechconfiggui texttospeechconfiggui.cpp)
target_link_libraries(texttospeechconfiggui
KF5::PimTextEdit KF5::CoreAddons Qt::Widgets KF5::I18n
KF5::PimTextEdit KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n
)
add_executable(texttospeechconfigdialoggui texttospeechconfigdialoggui.cpp)
target_link_libraries(texttospeechconfigdialoggui
KF5::PimTextEdit KF5::CoreAddons Qt::Widgets KF5::I18n
KF5::PimTextEdit KF5::CoreAddons Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n
)
......@@ -3,27 +3,27 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src ${CMAKE_CURRENT_BINARY_DIR}/../src)
#####
add_executable(inserthtmldialog_demo inserthtmldialog_demo.cpp)
set(inserthtmldialog_demo_LIBS KF5PimTextEdit Qt::Widgets KF5::SyntaxHighlighting)
set(inserthtmldialog_demo_LIBS KF5PimTextEdit Qt${QT_MAJOR_VERSION}::Widgets KF5::SyntaxHighlighting)
target_link_libraries(inserthtmldialog_demo ${inserthtmldialog_demo_LIBS})
#####
add_executable(slidecontainer_gui slidecontainer_gui.cpp)
target_link_libraries(slidecontainer_gui
Qt::Core
Qt::Gui
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Core
Qt${QT_MAJOR_VERSION}::Gui
Qt${QT_MAJOR_VERSION}::Widgets
KF5PimTextEdit
)
#####
add_executable(showemoticonunicodetab_gui showemoticonunicodetab_gui.cpp)
set(showemoticonunicodetab_gui_LIBS KF5PimTextEdit Qt::Widgets)
set(showemoticonunicodetab_gui_LIBS KF5PimTextEdit Qt${QT_MAJOR_VERSION}::Widgets)
target_link_libraries(showemoticonunicodetab_gui ${showemoticonunicodetab_gui_LIBS})
#####
add_executable(testgeneratehtmlbuildergui_gui testgeneratehtmlbuildergui.cpp testgeneratehtmlbuildergui.h)
set(testgeneratehtmlbuildergui_gui_LIBS KF5PimTextEdit Qt::Widgets )
set(testgeneratehtmlbuildergui_gui_LIBS KF5PimTextEdit Qt${QT_MAJOR_VERSION}::Widgets )
target_link_libraries(testgeneratehtmlbuildergui_gui ${testgeneratehtmlbuildergui_gui_LIBS})
#####
add_executable(testgenerateplaintextbuilder_gui testgenerateplaintextbuildergui.cpp testgenerateplaintextbuildergui.h)
set(testgenerateplaintextbuilder_gui_LIBS KF5PimTextEdit Qt::Widgets )
set(testgenerateplaintextbuilder_gui_LIBS KF5PimTextEdit Qt${QT_MAJOR_VERSION}::Widgets )
target_link_libraries(testgenerateplaintextbuilder_gui ${testgenerateplaintextbuilder_gui_LIBS})
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