mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-30 15:39:59 +01:00
Build with qt6 and cmake
First build with qt6 and cmake. QET compil, but a lot of things don't work. Build tested on debian sid and ubuntu 25.04. Dependency needed under debian and ubuntu : qtcreator cmake qt6-tools-dev qt6-svg-dev libsqlite3-dev libkf6coreaddons-dev extra-cmake-modules libkf6widgetsaddons-dev
This commit is contained in:
@@ -62,10 +62,15 @@ message("PROJECT_SOURCE_DIR :" ${PROJECT_SOURCE_DIR})
|
||||
message("QET_DIR :" ${QET_DIR})
|
||||
message("GIT_COMMIT_SHA :" ${GIT_COMMIT_SHA})
|
||||
|
||||
if(BUILD_WITH_KF5)
|
||||
message("KF5_GIT_TAG :" ${KF5_GIT_TAG})
|
||||
else()
|
||||
add_definitions(-DBUILD_WITHOUT_KF5)
|
||||
if(BUILD_WITH_KF6 AND BUILD_KF6)
|
||||
message("KF6_GIT_TAG :" ${KF6_GIT_TAG})
|
||||
endif()
|
||||
if(NOT BUILD_WITH_KF6)
|
||||
add_definitions(-DBUILD_WITHOUT_KF6)
|
||||
endif()
|
||||
message("QET_COMPONENTS :" ${QET_COMPONENTS})
|
||||
message("QT_VERSION_MAJOR :" ${QT_VERSION_MAJOR})
|
||||
message("Qt version :" ${Qt6_VERSION})
|
||||
|
||||
if(QMFILES_AS_RESOURCE)
|
||||
add_definitions(-DQMFILES_AS_RESOURCE)
|
||||
endif()
|
||||
|
||||
@@ -31,5 +31,8 @@ add_definitions(-DQT_MESSAGELOGCONTEXT)
|
||||
# In order to do so, uncomment the following line.
|
||||
#add_definitions(-DTODO_LIST)
|
||||
|
||||
# Build with KF5
|
||||
option(BUILD_WITH_KF5 "Build with KF5" ON)
|
||||
# Build with KF6
|
||||
option(BUILD_WITH_KF6 "Build with KF6" ON)
|
||||
|
||||
# Use translations as a Qt resource
|
||||
option(QMFILES_AS_RESOURCE "Use .qm files as Qt resource" ON)
|
||||
|
||||
@@ -14,54 +14,47 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
message(" - fetch_kdeaddons")
|
||||
message(STATUS "fetch_kdeaddons")
|
||||
|
||||
if(DEFINED BUILD_WITH_KF5)
|
||||
Include(FetchContent)
|
||||
if(BUILD_WITH_KF6)
|
||||
option(BUILD_KF6 "Build KF6 libraries, use system ones otherwise" OFF)
|
||||
block(PROPAGATE KF6_GIT_TAG)
|
||||
set(BUILD_TESTING OFF)
|
||||
set(KDE_SKIP_TEST_SETTINGS ON)
|
||||
set(BUILD_DESIGNERPLUGIN OFF)
|
||||
set(KCOREADDONS_USE_QML OFF)
|
||||
set(BUILD_QCH OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
find_package(ECM 6.8.0 REQUIRED NO_MODULE)
|
||||
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
||||
|
||||
option(BUILD_KF5 "Build KF5 libraries, use system ones otherwise" YES)
|
||||
if(BUILD_KF6)
|
||||
Include(FetchContent)
|
||||
|
||||
if(BUILD_KF5)
|
||||
|
||||
if(NOT DEFINED KF5_GIT_TAG)
|
||||
#https://qelectrotech.org/forum/viewtopic.php?pid=13924#p13924
|
||||
set(KF5_GIT_TAG v5.77.0)
|
||||
if(NOT DEFINED KF6_GIT_TAG)
|
||||
set(KF6_GIT_TAG v6.8.0)
|
||||
endif()
|
||||
|
||||
# Fix stop the run autotests of kcoreaddons
|
||||
# see
|
||||
# https://invent.kde.org/frameworks/kcoreaddons/-/blob/master/CMakeLists.txt#L98
|
||||
# issue:
|
||||
# CMake Error at /usr/share/ECM/modules/ECMAddTests.cmake:89 (add_executable):
|
||||
# Cannot find source file:
|
||||
# see
|
||||
# https://qelectrotech.org/forum/viewtopic.php?pid=13929#p13929
|
||||
set(KDE_SKIP_TEST_SETTINGS "TRUE")
|
||||
set(BUILD_TESTING "0")
|
||||
FetchContent_Declare(
|
||||
ecm
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/extra-cmake-modules.git
|
||||
GIT_TAG ${KF5_GIT_TAG})
|
||||
FetchContent_MakeAvailable(ecm)
|
||||
|
||||
FetchContent_Declare(
|
||||
kcoreaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kcoreaddons.git
|
||||
GIT_TAG ${KF5_GIT_TAG})
|
||||
GIT_TAG ${KF6_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kcoreaddons)
|
||||
get_target_property(kca_version KF6::CoreAddons VERSION)
|
||||
|
||||
FetchContent_Declare(
|
||||
kwidgetsaddons
|
||||
GIT_REPOSITORY https://invent.kde.org/frameworks/kwidgetsaddons.git
|
||||
GIT_TAG ${KF5_GIT_TAG})
|
||||
FetchContent_MakeAvailable(kwidgetsaddons)
|
||||
else()
|
||||
find_package(KF5CoreAddons REQUIRED)
|
||||
find_package(KF5WidgetsAddons REQUIRED)
|
||||
find_package(KF6CoreAddons REQUIRED)
|
||||
set(kca_version ${KF6CoreAddons_VERSION})
|
||||
endif()
|
||||
|
||||
set(KF5_PRIVATE_LIBRARIES
|
||||
KF5::WidgetsAddons
|
||||
KF5::CoreAddons
|
||||
get_target_property(kwa_type KF6::CoreAddons TYPE)
|
||||
|
||||
message(NOTICE "ecm version : " ${ECM_VERSION})
|
||||
message(NOTICE "kcoreaddons library : " ${kca_type})
|
||||
message(NOTICE "kcoreaddons version : " ${kca_version})
|
||||
endblock()
|
||||
|
||||
set(KF6_PRIVATE_LIBRARIES
|
||||
KF6::CoreAddons
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
message(" - qet_compilation_vars")
|
||||
|
||||
set(QET_COMPONENTS
|
||||
Core
|
||||
Gui
|
||||
LinguistTools
|
||||
PrintSupport
|
||||
Xml
|
||||
@@ -109,6 +111,12 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/borderproperties.h
|
||||
${QET_DIR}/sources/bordertitleblock.cpp
|
||||
${QET_DIR}/sources/bordertitleblock.h
|
||||
# ${QET_DIR}/sources/colorbutton.cpp
|
||||
# ${QET_DIR}/sources/colorbutton.h
|
||||
# ${QET_DIR}/sources/colorcombobox.cpp
|
||||
# ${QET_DIR}/sources/colorcombobox.h
|
||||
# ${QET_DIR}/sources/colorcomboboxdelegate.cpp
|
||||
# ${QET_DIR}/sources/colorcomboboxdelegate.h
|
||||
${QET_DIR}/sources/conductorautonumerotation.cpp
|
||||
${QET_DIR}/sources/conductorautonumerotation.h
|
||||
${QET_DIR}/sources/conductornumexport.cpp
|
||||
@@ -726,19 +734,17 @@ set(TS_FILES
|
||||
${QET_DIR}/lang/qet_mn.ts
|
||||
${QET_DIR}/lang/qet_nb.ts
|
||||
${QET_DIR}/lang/qet_nl.ts
|
||||
${QET_DIR}/lang/qet_nl_BE.ts
|
||||
${QET_DIR}/lang/qet_nl_BE.ts
|
||||
${QET_DIR}/lang/qet_no.ts
|
||||
${QET_DIR}/lang/qet_pl.ts
|
||||
${QET_DIR}/lang/qet_pt.ts
|
||||
${QET_DIR}/lang/qet_pt_BR.ts
|
||||
${QET_DIR}/lang/qet_ro.ts
|
||||
${QET_DIR}/lang/qet_rs.ts
|
||||
${QET_DIR}/lang/qet_ru.ts
|
||||
${QET_DIR}/lang/qet_sk.ts
|
||||
${QET_DIR}/lang/qet_sl.ts
|
||||
${QET_DIR}/lang/qet_sr.ts
|
||||
${QET_DIR}/lang/qet_sv.ts
|
||||
${QET_DIR}/lang/qet_tr.ts
|
||||
${QET_DIR}/lang/qet_uk.ts
|
||||
${QET_DIR}/lang/qet_zh.ts
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user