From e794669affc97617db8381c106a72ab327ac94e8 2017-05-24 15:47:28 From: mperrinel Date: 2017-05-24 15:47:28 Subject: [PATCH] Mise à jour de la config pour plus de fonctionnel Changement de sqpXXX vers XXX Ajout des inclusions de dépendances dans les modules Création de la classe sqpapplication et de la classe DataSourceController dans le but de tester les loggers et QTest --- diff --git a/cmake/sciqlop_applications.cmake b/cmake/sciqlop_applications.cmake index 94dc1cb..b4fb446 100644 --- a/cmake/sciqlop_applications.cmake +++ b/cmake/sciqlop_applications.cmake @@ -10,9 +10,15 @@ SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) # # Compile the diffents modules # -ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpcore") -#ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpgui") -ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpapp") +set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}") +ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core") + +set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}") +ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui") + +ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app") # # Code formatting diff --git a/sqpapp/CMakeLists.txt b/sqpapp/CMakeLists.txt deleted file mode 100644 index f0c8b80..0000000 --- a/sqpapp/CMakeLists.txt +++ /dev/null @@ -1,144 +0,0 @@ - -## sciqlop - CMakeLists.txt -SET(EXECUTABLE_NAME "sciqlop") -SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) -SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) -SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src) -SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) - -# -# Find Qt modules -# -SCIQLOP_FIND_QT(Core Widgets) - -# -# Find dependent libraries -# ======================== -SET(LIBRARIES) -SET(EXTERN_LIBRARIES) -SET(EXTERN_SHARED_LIBRARIES) - -# Add sqpcore to the list of libraries to use -list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME}) - -# Include sqpcore directory -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../sqpcore/src") - -# Add dependent shared libraries -list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES}) - -# Retrieve the location of the dynamic library to copy it to the output path -#get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION) -list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation}) - -# -# Compile the application -# -FILE (GLOB_RECURSE APPLICATION_SOURCES - ${SOURCES_DIR}/*.c - ${SOURCES_DIR}/*.cpp - ${SOURCES_DIR}/*.h) - -# Headers files (.h) -FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) - -# Ui files -FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) - -# Resources files -FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) - -# Retrieve resources files -FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc) - -QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} ) - -QT5_WRAP_UI(UIS_HDRS - ${PROJECT_FORMS} -) - - -ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS}) -set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14) -set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) - -target_link_libraries(${EXECUTABLE_NAME} - ${LIBRARIES}) - -# Link with Qt5 modules -qt5_use_modules(${EXECUTABLE_NAME} Core Widgets) - - -# Add the files to the list of files to be analyzed -LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES}) -SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) -# Vera++ exclusion files -#LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) -SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) - -# -# Compile the tests -# -IF(BUILD_TESTS) - INCLUDE_DIRECTORIES(${SOURCES_DIR}) - FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) - FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) - SET( TEST_LIBRARIES ${LIBRARIES} ${EXTERN_LIBRARIES}) - - FOREACH( testFile ${TESTS_SOURCES} ) - GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) - GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) - - # Add to the list of sources files all the sources in the same - # directory that aren't another test - FILE (GLOB currentTestSources - ${testDirectory}/*.c - ${testDirectory}/*.cpp - ${testDirectory}/*.h) - LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) - LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) - - ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) - TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) - qt5_use_modules(${testName} Test) - - ADD_TEST( NAME ${testName} COMMAND ${testName} ) - - SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) - ENDFOREACH( testFile ) - - LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) - LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) - LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) - SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) -ENDIF(BUILD_TESTS) - -# -# Set the files that must be formatted by clang-format. -# -LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES}) -SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) - -# -# Set the directories that doxygen must browse to generate the -# documentation. -# -# Source directories: -LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") -LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") -SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) -# Source directories to exclude from the documentation generation -#LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") -SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) - -# -# Set the directories with the sources to analyze and propagate the -# modification to the parent scope -# -# Source directories to analyze: -LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") -LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") -SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) -# Source directories to exclude from the analysis -#LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") -SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) diff --git a/sqpapp/resources/qlopapp.qrc b/sqpapp/resources/qlopapp.qrc deleted file mode 100644 index fa7e3c3..0000000 --- a/sqpapp/resources/qlopapp.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - sciqlopLOGO.svg - - diff --git a/sqpapp/resources/sciqlopLOGO.svg b/sqpapp/resources/sciqlopLOGO.svg deleted file mode 100644 index 2231dd0..0000000 --- a/sqpapp/resources/sciqlopLOGO.svg +++ /dev/null @@ -1,664 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sqpapp/src/main.cpp b/sqpapp/src/main.cpp deleted file mode 100644 index 5b8c8ca..0000000 --- a/sqpapp/src/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the QLop Software --- Copyright (C) 2015, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@member.fsf.org -----------------------------------------------------------------------------*/ -#include "mainwindow.h" -#include -#include -#include -//#include -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QApplication::setOrganizationName("LPP"); - QApplication::setOrganizationDomain("lpp.fr"); - QApplication::setApplicationName("SciQLop"); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/sqpapp/src/mainwindow.cpp b/sqpapp/src/mainwindow.cpp deleted file mode 100644 index bf9315d..0000000 --- a/sqpapp/src/mainwindow.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the QLop Software --- Copyright (C) 2015, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@member.fsf.org -----------------------------------------------------------------------------*/ -#include "mainwindow.h" -#include "ui_mainwindow.h" -#include -#include -#include -#include -#include -//#include -//#include -//#include -//#include -//#include -//#include -//#include "qlopcore.h" -//#include "qlopcodecmanager.h" -//#include "cdfcodec.h" -//#include "amdatxtcodec.h" -//#include - - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) -{ - ui->setupUi(this); - /* QLopGUI::registerMenuBar(menuBar()); - this->setWindowIcon(QIcon(":/sciqlopLOGO.svg")); - this->m_progressWidget = new QWidget(); - this->m_progressLayout = new QVBoxLayout(this->m_progressWidget); - this->m_progressWidget->setLayout(this->m_progressLayout); - this->m_progressWidget->setWindowModality(Qt::WindowModal); - m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int)); - for(int i=0;im_progress.append(new QProgressBar(this->m_progressWidget)); - this->m_progress.last()->setMinimum(0); - this->m_progress.last()->setMaximum(100); - this->m_progressLayout->addWidget(this->m_progress.last()); - this->m_progressWidget->hide(); - this->m_progressThreadIds[i] = -1; - } - this->m_progressWidget->setWindowTitle("Loading File"); - const QListServicesToLoad=QList() - << QLopCore::self() - << QLopPlotManager::self() - << QLopCodecManager::self() - << FileDownloader::self() - << QLopDataBase::self() - << SpaceData::self(); - - CDFCodec::registerToManager(); - AMDATXTCodec::registerToManager(); - - - for(int i=0;iserviceName(); - ServicesToLoad.at(i)->initialize(); //must be called before getGUI - QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI(); - if(wdgt) - { - wdgt->setAllowedAreas(Qt::AllDockWidgetAreas); - this->addDockWidget(Qt::TopDockWidgetArea,wdgt); - } - PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i)); - }*/ -} - -MainWindow::~MainWindow() -{ - delete ui; -} - - -void MainWindow::changeEvent(QEvent *e) -{ - QMainWindow::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} diff --git a/sqpapp/src/mainwindow.h b/sqpapp/src/mainwindow.h deleted file mode 100644 index a349a21..0000000 --- a/sqpapp/src/mainwindow.h +++ /dev/null @@ -1,60 +0,0 @@ -/*------------------------------------------------------------------------------ --- This file is a part of the QLop Software --- Copyright (C) 2015, Plasma Physics Laboratory - CNRS --- --- This program is free software; you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program; if not, write to the Free Software --- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------*/ -/*-- Author : Alexis Jeandet --- Mail : alexis.jeandet@member.fsf.org -----------------------------------------------------------------------------*/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include -#include -#include -#include -//#include "../Core/qlopservice.h" -//#include "../Core/qlopgui.h" - - -namespace Ui { -class MainWindow; -} - -class MainWindow : public QMainWindow { - Q_OBJECT - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); -public slots: - -protected: - void changeEvent(QEvent *e); - -private: - Ui::MainWindow *ui; - QList m_progress; - int *m_progressThreadIds; - QWidget *m_progressWidget; - QVBoxLayout *m_progressLayout; - // QList m_qlopServices; -}; - -#endif // MAINWINDOW_H diff --git a/sqpapp/src/mainwindow.ui b/sqpapp/src/mainwindow.ui deleted file mode 100644 index 581352a..0000000 --- a/sqpapp/src/mainwindow.ui +++ /dev/null @@ -1,56 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - QLop - - - true - - - - true - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - - - 0 - 0 - 800 - 45 - - - - - - - Index Viewer - - - - - - - diff --git a/sqpcore/CMakeLists.txt b/sqpcore/CMakeLists.txt deleted file mode 100644 index 1f3e6de..0000000 --- a/sqpcore/CMakeLists.txt +++ /dev/null @@ -1,123 +0,0 @@ - -## sqpcore - CMakeLists.txt -STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) -SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_sqpcore${DEBUG_SUFFIX}") -SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/") - -# Set a variable to display a warning in the version files. -SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.") -# Generate the version file from the cmake version variables. The version -# variables are defined in the cmake/sciqlop_version.cmake file. -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in" - "${SOURCES_DIR}/Version.h") -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in" - "${SOURCES_DIR}/Version.cpp") - -# -# Find Qt modules -# -SCIQLOP_FIND_QT(Core) - -# -# Compile the library library -# -FILE (GLOB_RECURSE MODULE_SOURCES - ${SOURCES_DIR}/*.c - ${SOURCES_DIR}/*.cpp - ${SOURCES_DIR}/*.h) - -ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES}) -set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) -set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${EXTERN_LIBRARIES}) -qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core) - -# From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html -# Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. -# The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") -ELSE() - TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") -ENDIF() - -# Set the variable to parent scope so that the other projects can copy the -# dependent shared libraries -SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME) - -# Copy extern shared libraries to the lib folder -SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) - -# Add the files to the list of files to be analyzed -LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) -SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) -# Vera++ exclusion files -#LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) -SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) - -# -# Compile the tests -# -IF(BUILD_TESTS) - INCLUDE_DIRECTORIES(${SOURCES_DIR}) - FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) - FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) - SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME} ${EXTERN_LIBRARIES}) - - FOREACH( testFile ${TESTS_SOURCES} ) - GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) - GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) - - # Add to the list of sources files all the sources in the same - # directory that aren't another test - FILE (GLOB currentTestSources - ${testDirectory}/*.c - ${testDirectory}/*.cpp - ${testDirectory}/*.h) - LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) - LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) - - ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) - TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) - qt5_use_modules(${testName} Test) - - ADD_TEST( NAME ${testName} COMMAND ${testName} ) - - SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) - ENDFOREACH( testFile ) - - LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) - LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) - LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) - SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) -ENDIF(BUILD_TESTS) - -# -# Set the files that must be formatted by clang-format. -# -LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) -SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) - -# -# Set the directories that doxygen must browse to generate the -# documentation. -# -# Source directories: -LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") -LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") -SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) -# Source directories to exclude from the documentation generation -#LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") -SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) - -# -# Set the directories with the sources to analyze and propagate the -# modification to the parent scope -# -# Source directories to analyze: -LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") -LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") -SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) -# Source directories to exclude from the analysis -#LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") -SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) diff --git a/sqpcore/resources/Version.cpp.in b/sqpcore/resources/Version.cpp.in deleted file mode 100644 index 2a27649..0000000 --- a/sqpcore/resources/Version.cpp.in +++ /dev/null @@ -1,78 +0,0 @@ -#include "Version.h" - -/*************************************************** - * @SCIQLOP_CMAKE_GENERATION_WARNING@ * - ***************************************************/ - -#include -#include - -namespace sciqlop { - -const char *Version::VERSION_SUFFIX = "@SCIQLOP_VERSION_SUFFIX@"; - -/** - * From the C99 standard: - * __DATE__: The date of translation of the preprocessing translation unit: - * a character string literal of the form "Mmm dd yyyy", where the names of - * the months are the same as those generated by the asctime function, and - * the first character of dd is a space character if the value is less than - * 10. If the date of translation is not available, an - * implementation-defined valid date shall be supplied. - */ -const char *Version::BUILD_DATE = __DATE__; -/** - * From the C99 standard: - * __TIME__: The time of translation of the preprocessing translation unit: - * a character string literal of the form "hh:mm:ss" as in the time - * generated by the asctime function. If the time of translation is not - * available, an implementation-defined valid time shall be supplied. - */ -const char *Version::BUILD_TIME = __TIME__; - -QDateTime Version::buildDateTime() -{ - static QDateTime buildDateTime; - if (!buildDateTime.isValid()) { - // Convert BUILD_DATE to a QDate - // The __DATE__ macro return the month name with the asctime() function, - // which doesn't support localization, the month names returned are - // always the same. On the contrary, the "MMM" format on - // QDate::fromString() is localized, so this method can't be used to - // retrieve the month and we must manually do it instead. - QString buildDateStr = QString(BUILD_DATE); - QString buildMonthStr = buildDateStr.left(3); - QString buildDayAndYearStr = buildDateStr.mid(4).trimmed(); - - QDate buildDate = QDate::fromString(buildDayAndYearStr, "d yyyy"); - QStringList monthList = QStringList() << "Jan" - << "Feb" - << "Mar" - << "Apr" - << "May" - << "Jun" - << "Jul" - << "Aug" - << "Sep" - << "Oct" - << "Nov" - << "Dec"; - for (int i = 0; i < monthList.size(); ++i) { - if (buildMonthStr == monthList.at(i)) { - buildDate.setDate(buildDate.year(), i + 1, buildDate.day()); - break; - } - } - - // Convert BUILD_TIME to a QTime - QTime buildTime = QTime::fromString(BUILD_TIME, "hh:mm:ss"); - - // Set the buildDateTime - buildDateTime.setDate(buildDate); - buildDateTime.setTime(buildTime); - } - - return buildDateTime; -} - -} // namespace sciqlop diff --git a/sqpcore/resources/Version.h.in b/sqpcore/resources/Version.h.in deleted file mode 100644 index cf7a260..0000000 --- a/sqpcore/resources/Version.h.in +++ /dev/null @@ -1,98 +0,0 @@ -// TODO copyright -/** - * @file Version.h - */ -#ifndef SCIQLOP_VERSION_H -#define SCIQLOP_VERSION_H - -/*************************************************** - * @SCIQLOP_CMAKE_GENERATION_WARNING@ * - ***************************************************/ - -//#include "SciqlopExport.h" -#include - -class QDateTime; - -namespace sciqlop { - -/** - * Holds the version of Sciqlop. - * - * @attention Don't update this class directly, it is generated from the - * `resources/Version.h.in` and `resources/Version.cpp.in` files, along with - * the cmake variables defined in the `cmake/sciqlop_version.cmake` file. - * - * To change the Sciqlop version number, update the `cmake/sciqlop_version.cmake` - * file, and to change this class other than to change the version number, - * update the `resources/Version.h.in` and `resources/Version.cpp.in` files. - * @ingroup Utils - */ -class /*SCIQLOP_API*/ Version { -public: - /** - * Retrieve the version of Sciqlop. - * - * The version is of the form MAJOR.MINOR.PATCH. If a suffix has been - * provided to the version, it is appended after the PATCH. - * - * The version can be modified by updating the cmake/sciqlop_version.cmake - * file. - * - * @return The version of Sciqlop as a QString. - */ - static QString version() - { - static const QString v("@SCIQLOP_VERSION@"); - return v; - } - - /** - * @return The datetime of the build. - */ - static QDateTime buildDateTime(); - - /** - * Major version. - */ - static const int VERSION_MAJOR = @SCIQLOP_VERSION_MAJOR@; - /** - * Minor version. - */ - static const int VERSION_MINOR = @SCIQLOP_VERSION_MINOR@; - /** - * Patch version. - */ - static const int VERSION_PATCH = @SCIQLOP_VERSION_PATCH@; - /** - * Suffix version. - */ - static const char *VERSION_SUFFIX; - - /** - * Compile date computed with the __DATE__ macro. - * - * From the C99 standard: - * __DATE__: The date of translation of the preprocessing translation unit: - * a character string literal of the form "Mmm dd yyyy", where the names of - * the months are the same as those generated by the asctime function, and - * the first character of dd is a space character if the value is less than - * 10. If the date of translation is not available, an - * implementation-defined valid date shall be supplied. - */ - static const char *BUILD_DATE; - /** - * Compile time computed with the __TIME__ macro. - * - * From the C99 standard: - * __TIME__: The time of translation of the preprocessing translation unit: - * a character string literal of the form "hh:mm:ss" as in the time - * generated by the asctime function. If the time of translation is not - * available, an implementation-defined valid time shall be supplied. - */ - static const char *BUILD_TIME; -}; - -} // namespace sciqlop - -#endif // SCIQLOP_VERSION_H diff --git a/sqpgui/CMakeLists.txt b/sqpgui/CMakeLists.txt deleted file mode 100644 index 6dd5351..0000000 --- a/sqpgui/CMakeLists.txt +++ /dev/null @@ -1,140 +0,0 @@ - -## sqpgui - CMakeLists.txt -STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) -SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_sqpgui${DEBUG_SUFFIX}") -SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") -SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) -SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/ui) -SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) - -# Set a variable to display a warning in the version files. -SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.") - -# -# Find Qt modules -# -SCIQLOP_FIND_QT(Core Widgets) - -# -# Compile the library library -# -FILE (GLOB_RECURSE MODULE_SOURCES - ${SOURCES_DIR}/*.c - ${SOURCES_DIR}/*.cpp - ${SOURCES_DIR}/*.h) - -# Headers files (.h) -FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) - -# Ui files -FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) - -# Resources files -FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) - -QT5_ADD_RESOURCES(RCC_HDRS - ${PROJECT_RESOURCES} -) - -QT5_WRAP_UI(UIS_HDRS - ${PROJECT_FORMS} -) - -include_directories("${CMAKE_CURRENT_BINARY_DIR}") -message(CURRENT INCLUDE : ${CMAKE_CURRENT_BINARY_DIR}) - -ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS}) -set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) -set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${EXTERN_LIBRARIES}) -qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets) - -# From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html -# Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. -# The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets -IF(BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") -ELSE() - TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") -ENDIF() - -# Set the variable to parent scope so that the other projects can copy the -# dependent shared libraries -SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME) - -# Copy extern shared libraries to the lib folder -SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) - -# Add the files to the list of files to be analyzed -LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) -SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) -# Vera++ exclusion files -#LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) -SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) - -# -# Compile the tests -# -IF(BUILD_TESTS) - INCLUDE_DIRECTORIES(${SOURCES_DIR}) - FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) - FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) - SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME} ${EXTERN_LIBRARIES}) - - FOREACH( testFile ${TESTS_SOURCES} ) - GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) - GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) - - # Add to the list of sources files all the sources in the same - # directory that aren't another test - FILE (GLOB currentTestSources - ${testDirectory}/*.c - ${testDirectory}/*.cpp - ${testDirectory}/*.h) - LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) - LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) - - ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) - TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) - qt5_use_modules(${testName} Test) - - ADD_TEST( NAME ${testName} COMMAND ${testName} ) - - SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) - ENDFOREACH( testFile ) - - LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) - LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) - LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) - SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) -ENDIF(BUILD_TESTS) - -# -# Set the files that must be formatted by clang-format. -# -LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) -SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) - -# -# Set the directories that doxygen must browse to generate the -# documentation. -# -# Source directories: -LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") -LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") -SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) -# Source directories to exclude from the documentation generation -#LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") -SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) - -# -# Set the directories with the sources to analyze and propagate the -# modification to the parent scope -# -# Source directories to analyze: -LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") -LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") -SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) -# Source directories to exclude from the analysis -#LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") -SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)