add first Qt6 version of musredit, mupp, etc.

This commit is contained in:
2021-01-22 22:04:11 +01:00
parent 386217b1fe
commit 5dcc962351
358 changed files with 59153 additions and 47 deletions

View File

@ -5,7 +5,7 @@ if (CMAKE_VERSION GREATER_EQUAL 3.12)
cmake_policy(SET CMP0075 NEW)
endif (CMAKE_VERSION GREATER_EQUAL 3.12)
project(musrfit VERSION 1.6.4 LANGUAGES C CXX)
project(musrfit VERSION 1.6.5 LANGUAGES C CXX)
#--- musrfit specific options -------------------------------------------------
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
@ -113,49 +113,58 @@ endif (try_OpenMP AND NOT APPLE)
if (qt_based_tools)
# check for any Qt, i.e. AUTO
if (qt_version STREQUAL AUTO)
# first try Qt5
# Find the QtCore library
# try Qt6
find_package(Qt6Core)
if (Qt6Core_FOUND)
find_package(Qt6Widgets CONFIG REQUIRED)
find_package(Qt6Xml CONFIG REQUIRED)
find_package(Qt6Network CONFIG REQUIRED)
find_package(Qt6Svg CONFIG REQUIRED)
find_package(Qt6PrintSupport CONFIG REQUIRED)
endif (Qt6Core_FOUND)
# try Qt5
find_package(Qt5Core)
if (Qt5Core_FOUND)
# Find the QtWidgets library
if (NOT Qt5Core_FOUND)
find_package(Qt5Widgets CONFIG REQUIRED)
# Find the QtXml library
find_package(Qt5Xml CONFIG REQUIRED)
# Find the QtNetwork library
find_package(Qt5Network CONFIG REQUIRED)
# Find the QtSvg library
find_package(Qt5Svg CONFIG REQUIRED)
# Fing the QtPrintSupport
find_package(Qt5PrintSupport CONFIG REQUIRED)
endif (Qt5Core_FOUND)
endif (NOT Qt5Core_FOUND)
# if Qt5 is not found, try Qt4
if (NOT Qt5Core_FOUND)
# if Qt6 and Qt5 is not found, try Qt4
if (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND)
find_package(Qt4 COMPONENTS QtGui QtWebKit QtXml)
endif (NOT Qt5Core_FOUND)
endif (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND)
# if Qt5 and Qt4 is not found try Qt3. Hopefully you never reach this point
if (NOT Qt5Core_FOUND)
if (NOT Qt4_FOUND)
find_package(Qt3)
endif (NOT Qt4_FOUND)
endif (NOT Qt5Core_FOUND)
# if Qt6, Qt5 and Qt4 is not found try Qt3. Hopefully you never reach this point
if (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND AND Qt4_FOUND)
find_package(Qt3)
endif (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND AND Qt4_FOUND)
endif (qt_version STREQUAL AUTO)
# check specifically for Qt5
# check specifically for Qt6
if (qt_version STREQUAL 6)
find_package(Qt6Core)
if (Qt6Core_FOUND)
find_package(Qt6Widgets CONFIG REQUIRED)
find_package(Qt6Xml CONFIG REQUIRED)
find_package(Qt6Network CONFIG REQUIRED)
find_package(Qt6Svg CONFIG REQUIRED)
find_package(Qt6PrintSupport CONFIG REQUIRED)
else (Qt6Core_FOUND)
message(FATAL_ERROR "Couldn't find the specifically requested Qt6 version.")
endif (Qt6Core_FOUND)
endif (qt_version STREQUAL 6)
# check specifically for Qt5
if (qt_version STREQUAL 5)
# Find the QtCore library
find_package(Qt5Core)
if (Qt5Core_FOUND)
# Find the QtWidgets library
find_package(Qt5Widgets CONFIG REQUIRED)
# Find the QtXml library
find_package(Qt5Xml CONFIG REQUIRED)
# Find the QtNetwork library
find_package(Qt5Network CONFIG REQUIRED)
# Find the QtSvg library
find_package(Qt5Svg CONFIG REQUIRED)
# Fing the QtPrintSupport
find_package(Qt5PrintSupport CONFIG REQUIRED)
else (Qt5Core_FOUND)
message(FATAL_ERROR "Couldn't find the specifically requested Qt5 version.")
@ -182,7 +191,7 @@ endif (qt_based_tools)
#--- if NeXus check also for HDF4, HDF5, and MXML -----------------------------
if (nexus)
find_package(HDF5 COMPONENTS CXX REQUIRED )
find_package(HDF4 REQUIRED)
#as35 find_package(HDF4 REQUIRED)
find_package(NeXus REQUIRED)
add_definitions(-DPNEXUS_ENABLED)
endif (nexus)
@ -236,17 +245,21 @@ endif (nexus)
message("")
if (qt_based_tools)
if (Qt5Core_FOUND)
message(" Qt found in ${Qt5Core_INCLUDE_DIRS} (Version: ${Qt5Core_VERSION})")
else (Qt5Core_FOUND)
if (Qt4_FOUND)
message(" Qt found (Version: ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH})")
else (Qt4_FOUND)
if (QT_FOUND)
message(" Qt found (Version: ${QT_VERSION})")
endif (QT_FOUND)
endif (Qt4_FOUND)
endif (Qt5Core_FOUND)
if (Qt6Core_FOUND)
message(" Qt found in ${Qt6Core_INCLUDE_DIRS} (Version: ${Qt6Core_VERSION})")
else (Qt6Core_FOUND)
if (Qt5Core_FOUND)
message(" Qt found in ${Qt5Core_INCLUDE_DIRS} (Version: ${Qt5Core_VERSION})")
else (Qt5Core_FOUND)
if (Qt4_FOUND)
message(" Qt found (Version: ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH})")
else (Qt4_FOUND)
if (QT_FOUND)
message(" Qt found (Version: ${QT_VERSION})")
endif (QT_FOUND)
endif (Qt4_FOUND)
endif (Qt5Core_FOUND)
endif (Qt6Core_FOUND)
endif (qt_based_tools)
message("")
message(" Features:")
@ -284,25 +297,27 @@ else (BNMRlibs)
endif (BNMRlibs)
if (qt_based_tools)
if (Qt5Core_FOUND)
if (Qt6Core_FOUND)
message("")
message(" Qt6 based tools:")
message(" musredit, musrStep, musrWiz, mupp : yes")
elseif (Qt5Core_FOUND)
message("")
message(" Qt5 based tools:")
message(" musredit, musrStep, musrWiz, mupp : yes")
endif (Qt5Core_FOUND)
if (Qt4_FOUND)
elseif (Qt4_FOUND)
message("")
message(" Qt4 based tools (deprecated):")
message(" musredit : yes")
endif (Qt4_FOUND)
if (QT_FOUND)
else ()
message("")
message(" Qt3 based tools (outdated):")
message(" musrgui : yes")
endif (QT_FOUND)
if (NOT Qt5Core_FOUND AND NOT Qt4_FOUND AND NOT QT_FOUND)
endif ()
if (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND AND NOT Qt4_FOUND AND NOT QT_FOUND)
message("")
message(" NO Qt based tools will be installed since Qt is not found or not installed on the system")
endif (NOT Qt5Core_FOUND AND NOT Qt4_FOUND AND NOT QT_FOUND)
endif (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND AND NOT Qt4_FOUND AND NOT QT_FOUND)
else (qt_based_tools)
message("")
message(" Qt based tools (musredit, musrStep, musrWiz, mupp) have been disabled")