From 4d6af2e64e0f416c18eb8d72fdca081831aad672 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 30 Apr 2024 09:44:12 +0200 Subject: [PATCH 1/4] Add cmake option WANT_PERL_DOCS to disable doc generation. Ensure Qt version is reported correctly by cmake. Fix #2634 --- CMakeLists.txt | 29 +++++++++++++++-------------- doc/CMakeLists.txt | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89e8212fce..1a533c544d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -410,6 +410,8 @@ endif() # first check if Qt6 or Qt5 has to be used if(NOT DEFINED QT_VERSION_MAJOR) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +else() + find_package(QT NAMES Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core) endif() # second, detect available modules for the specific Qt version find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets) @@ -770,27 +772,26 @@ else() endif() # Check for Perl support -# (note: needed for user documentation generation) option(WANT_PERL "Compile Perl support" ON) +option(WANT_PERL_DOCS "Use Perl to build documentation" ON) +if(WANT_PERL OR WANT_PERL_DOCS) + find_package(Perl) +endif() -# Perl is needed for documentation, too -find_package(Perl) - -if(WANT_PERL) - if(PERL_FOUND) +if(PERL_FOUND) + if(WANT_PERL) set(COMPILE_PERL_SUPPORT 1) - set(CMAKE_STATUS_PERL_SUPPORT "Yes, used for scripting+doc") - # Perl compilation / linking flags are handled inside perlcore module - else() - set(CMAKE_STATUS_PERL_SUPPORT "No") + set(CMAKE_STATUS_PERL_SUPPORT "Yes, used for scripting") endif() -else() - if(PERL_FOUND) + if(WANT_PERL_DOCS) set(CMAKE_STATUS_PERL_SUPPORT "Used for doc, but scripting disabled by user") - else() - set(CMAKE_STATUS_PERL_SUPPORT "No") endif() + if(WANT_PERL AND WANT_PERL_DOCS) + set(CMAKE_STATUS_PERL_SUPPORT "Yes, used for scripting+doc") + endif() +else() + set(CMAKE_STATUS_PERL_SUPPORT "No") endif() # Check for Python support diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 6d42540f6d..bb212de609 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -10,7 +10,7 @@ if(WIN32) endif() # User documentation -if(PERL_FOUND) +if(WANT_PERL_DOCS AND PERL_FOUND) # The userdocs target is in the normal build process and rebuilds the documentation # only when the revision number changes. This is useful for Git users and package users. From b2779e54e206294bfde1cfeccde3911afdd3fc1f Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 30 Apr 2024 17:12:53 +0200 Subject: [PATCH 2/4] KviApplication::checkGlobalKvircDirectory: don't test for help subdir, it may not exist --- src/kvirc/kernel/KviApplication_setup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kvirc/kernel/KviApplication_setup.cpp b/src/kvirc/kernel/KviApplication_setup.cpp index 5ceeb4be5b..a228b9f2fe 100644 --- a/src/kvirc/kernel/KviApplication_setup.cpp +++ b/src/kvirc/kernel/KviApplication_setup.cpp @@ -63,10 +63,10 @@ static QLibrary * g_pSetupLibrary = nullptr; bool KviApplication::checkGlobalKvircDirectory(const QString szDir) { - //First check if the help subdir exists - QString szHelpDir = szDir; - szHelpDir += KVI_PATH_SEPARATOR "help"; - if(!KviFileUtils::directoryExists(szHelpDir)) + //First check if the config subdir exists + QString szConfigDir = szDir; + szConfigDir += KVI_PATH_SEPARATOR "config"; + if(!KviFileUtils::directoryExists(szConfigDir)) return false; //Then check if the pics subdir exists QString szPicsDir = szDir; From 2b4af7b12ae6e46f1c8f68f43d7e7f71501384ca Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 30 Apr 2024 17:19:32 +0200 Subject: [PATCH 3/4] Cmake: use the imported target for Threads instead of CMAKE_THREAD_LIBS_INIT --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a533c544d..7b8807cdd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,7 +380,7 @@ if(CMAKE_USE_WIN32_THREADS_INIT OR CMAKE_USE_PTHREADS_INIT) list(APPEND CMAKE_KVIRC_BUILD_FLAGS Threads=Win32) else() if(CMAKE_HAVE_THREADS_LIBRARY) - list(APPEND LIBS ${CMAKE_THREAD_LIBS_INIT}) + list(APPEND LIBS Threads::Threads) endif() set(COMPILE_THREADS_USE_POSIX 1) list(APPEND CMAKE_KVIRC_BUILD_FLAGS Threads=POSIX) From 03fb5fb50800d1a49412663fd55c9a0085282ba7 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 1 May 2024 18:07:10 +0200 Subject: [PATCH 4/4] Cmake: always import the Threads target --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b8807cdd7..d5b9b0bbda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,9 +379,7 @@ if(CMAKE_USE_WIN32_THREADS_INIT OR CMAKE_USE_PTHREADS_INIT) set(CMAKE_STATUS_THREADS_SUPPORT "Win32") list(APPEND CMAKE_KVIRC_BUILD_FLAGS Threads=Win32) else() - if(CMAKE_HAVE_THREADS_LIBRARY) - list(APPEND LIBS Threads::Threads) - endif() + list(APPEND LIBS Threads::Threads) set(COMPILE_THREADS_USE_POSIX 1) list(APPEND CMAKE_KVIRC_BUILD_FLAGS Threads=POSIX) if(WANT_IGNORE_SIGALARM)