Skip to content

Commit

Permalink
Add cmake option WANT_PERL_DOCS to disable doc generation. Ensure Qt …
Browse files Browse the repository at this point in the history
…version is reported correctly by cmake. Fix #2634
  • Loading branch information
ctrlaltca committed Apr 30, 2024
1 parent 6b25eda commit 4d6af2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4d6af2e

Please sign in to comment.