From 0bc2ef761256b2e75b9812308e3b02d6c14a2699 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Tue, 22 May 2018 15:25:22 +0200 Subject: [PATCH] cmake: start to add the Qt components. No real functionality yet. --- CMakeLists.txt | 10 ++++++---- cmake/musrfit-info.h.in | 4 ++++ src/CMakeLists.txt | 11 +++++------ src/musredit/CMakeLists.txt | 3 +++ src/musredit_qt5/CMakeLists.txt | 13 +++++++++++++ src/musrgui/CMakeLists.txt | 5 +++++ src/musrgui/README | 8 ++++++-- 7 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 cmake/musrfit-info.h.in create mode 100644 src/musredit/CMakeLists.txt create mode 100644 src/musredit_qt5/CMakeLists.txt create mode 100644 src/musrgui/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 4342f82d..164e3eb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,10 +91,12 @@ if (qt_based_tools) # first try Qt5 # Find the QtCore library find_package(Qt5Core) - # Find the QtWidgets library - find_package(Qt5Widgets) - # Find the QtXml library - find_package(Qt5Xml) + if (Qt5Core_FOUND) + # Find the QtWidgets library + find_package(Qt5Widgets CONFIG REQUIRED) + # Find the QtXml library + find_package(Qt5Xml CONFIG REQUIRED) + endif (Qt5Core_FOUND) # if Qt5 is not found, try Qt4 if (NOT Qt5Core_FOUND) diff --git a/cmake/musrfit-info.h.in b/cmake/musrfit-info.h.in new file mode 100644 index 00000000..6b75599d --- /dev/null +++ b/cmake/musrfit-info.h.in @@ -0,0 +1,4 @@ +#--- This file is generated by cmake ------------------------------------------ + +#define MUSRFIT_PREFIX "@CMAKE_INSTALL_PREFIX@" +#define MUSRFIT_DOC_DIR "@CMAKE_INSTALL_PREFIX@/share/doc/musrfit" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73276a6e..e8ba8f90 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,14 +1,13 @@ #--- add further sub-directories ---------------------------------------------- add_subdirectory(classes) add_subdirectory(external) -#[==[ -if (Qt5Core_FOUND OR Qt4_FOUND) +if (Qt5Core_FOUND) + add_subdirectory(musredit_qt5) +elseif (Qt4_FOUND) add_subdirectory(musredit) -endif (Qt5Core_FOUND OR Qt4_FOUND) -if (QT_FOUND) +elseif (QT_FOUND) add_subdirectory(musrgui) -endif (QT_FOUND) -#]==] +endif (Qt5Core_FOUND) #--- define the musrfit libs -------------------------------------------------- set(MUSRFIT_LIBS ${MUSRFIT_LIBS} mud) diff --git a/src/musredit/CMakeLists.txt b/src/musredit/CMakeLists.txt new file mode 100644 index 00000000..cb6d6119 --- /dev/null +++ b/src/musredit/CMakeLists.txt @@ -0,0 +1,3 @@ +#--- musredit for Qt > 4.6 and < 5.0 ------------------------------------------ + +message("debug> will eventually deal with Qt > 4.6 < 5.0 musredit") diff --git a/src/musredit_qt5/CMakeLists.txt b/src/musredit_qt5/CMakeLists.txt new file mode 100644 index 00000000..fbd93886 --- /dev/null +++ b/src/musredit_qt5/CMakeLists.txt @@ -0,0 +1,13 @@ +#--- musredit for Qt > 5.0 ---------------------------------------------------- + +message("debug> will eventually deal with Qt > 5.0 musredit, musrStep, musrWiz, ...") + +#--- create musrfit-info.h ---------------------------------------------------- +configure_file( + ${CMAKE_SOURCE_DIR}/cmake/musrfit-info.h.in + ${CMAKE_CURRENT_BINARY_DIR}/musrfit-info.h +) + +#add_subdirectory(musredit) +#add_subdirectory(musrStep) +#add_subdirectory(musrWiz) diff --git a/src/musrgui/CMakeLists.txt b/src/musrgui/CMakeLists.txt new file mode 100644 index 00000000..f07797b3 --- /dev/null +++ b/src/musrgui/CMakeLists.txt @@ -0,0 +1,5 @@ +#--- musrgui for Qt 3.x ------------------------------------------------------- + +message("musrgui is currently not supported anymore! Please check if not at least") +message("Qt >= 4.6 is available.") + diff --git a/src/musrgui/README b/src/musrgui/README index 3f479383..0f4325a5 100644 --- a/src/musrgui/README +++ b/src/musrgui/README @@ -1,10 +1,14 @@ #--------------------------------------------------------------------- # README -# Andreas Suter, 2010/10/06 +# Andreas Suter, 2018/05/22 #--------------------------------------------------------------------- musrgui requires >= Qt 3.3.x and < Qt 4. If you have Qt 4.6.y or newer, -use musredit instead. +use musredit instead. If you have Qt 5.x, use musredit_qt5 instead. + +musrgui by now should be considered as not only outdated, but it will +be hard to find a platform on which it is still compiling. So, if there +is no urgent need: don't use it! #--------------------------------------------------------------------- # this is the end ...