##// END OF EJS Templates
Closed
Pull request !131 Created on Mon, 29 May 2017 15:06:38, by
- Ajout de la méthode wait pour éviter de détruire un thread en cours
- Initialisation de l'application multithread avec le spimpl.
- Mise à jour de la config pour plus de fonctionnel
Pull request versions not available.
ver Time Author Commit Description
latest r22:ac81b58d0bc3
Ajout de la méthode wait pour éviter de détruire un thread en cours d'éxécution
latest r21:45edf6844d32
Initialisation de l'application multithread avec le spimpl. Ajout du DataSourceController dans un thread dédié.
latest r20:e794669affc9
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
@@ -0,0 +1,1
1 TODO
@@ -0,0 +1,104
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
9 --
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
14 --
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
22 #include "mainwindow.h"
23 #include "ui_mainwindow.h"
24 #include <QAction>
25 #include <QDate>
26 #include <QDateTime>
27 #include <QDir>
28 #include <QFileDialog>
29 #include <omp.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
40
41
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
43 {
44 ui->setupUi(this);
45 /* QLopGUI::registerMenuBar(menuBar());
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
47 this->m_progressWidget = new QWidget();
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
52 for(int i=0;i<OMP_THREADS;i++)
53 {
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
55 this->m_progress.last()->setMinimum(0);
56 this->m_progress.last()->setMaximum(100);
57 this->m_progressLayout->addWidget(this->m_progress.last());
58 this->m_progressWidget->hide();
59 this->m_progressThreadIds[i] = -1;
60 }
61 this->m_progressWidget->setWindowTitle("Loading File");
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
63 << QLopCore::self()
64 << QLopPlotManager::self()
65 << QLopCodecManager::self()
66 << FileDownloader::self()
67 << QLopDataBase::self()
68 << SpaceData::self();
69
70 CDFCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
72
73
74 for(int i=0;i<ServicesToLoad.count();i++)
75 {
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
79 if(wdgt)
80 {
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
83 }
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
85 }*/
86 }
87
88 MainWindow::~MainWindow()
89 {
90 delete ui;
91 }
92
93
94 void MainWindow::changeEvent(QEvent *e)
95 {
96 QMainWindow::changeEvent(e);
97 switch (e->type()) {
98 case QEvent::LanguageChange:
99 ui->retranslateUi(this);
100 break;
101 default:
102 break;
103 }
104 }
@@ -0,0 +1,56
1 <?xml version="1.0" encoding="UTF-8"?>
2 <ui version="4.0">
3 <class>MainWindow</class>
4 <widget class="QMainWindow" name="MainWindow">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>800</width>
10 <height>600</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>QLop</string>
15 </property>
16 <property name="dockNestingEnabled">
17 <bool>true</bool>
18 </property>
19 <widget class="QWidget" name="centralWidget">
20 <property name="enabled">
21 <bool>true</bool>
22 </property>
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
25 <horstretch>0</horstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
28 </property>
29 <property name="maximumSize">
30 <size>
31 <width>16777215</width>
32 <height>16777215</height>
33 </size>
34 </property>
35 </widget>
36 <widget class="QMenuBar" name="menuBar">
37 <property name="geometry">
38 <rect>
39 <x>0</x>
40 <y>0</y>
41 <width>800</width>
42 <height>45</height>
43 </rect>
44 </property>
45 </widget>
46 <widget class="QStatusBar" name="statusBar"/>
47 <action name="actionIndex_Viewer">
48 <property name="text">
49 <string>Index Viewer</string>
50 </property>
51 </action>
52 </widget>
53 <layoutdefault spacing="6" margin="11"/>
54 <resources/>
55 <connections/>
56 </ui>
@@ -1,5 +1,3
1 build/
1 build/
2 CMakeLists.txt.user
2 CMakeLists.txt.user
3 /.project
3 /.project
4 core/src/Version.cpp
5 core/include/Version.h
@@ -1,31 +1,1
1 ![](gui/resources/icones/sciqlop2PNG_1024.png){:.some-css-class style="width: 20%"}
1 TODO No newline at end of file
2
3
4 # Overview
5
6 ** SciQLOP ** (**SCI**entific **Q**t application for **L**earning from **O**bservations of **P**lasmas) aims to be an ergonomic
7 and powerful tool enabling visualization and analysis of in-situ space plasma data. This goal rises some
8 challenges either technical and in the conception and the design.
9 The time resolution allowed by nowadays measurements imply the ability to plot millions of points just for
10 one sensor with no compromise on interactivity. Plots may stay responsive even with millions of points.
11 Being able to scroll, zoom, move and export the plots with the mouse are the minimal interactions expected by the user.
12 SciQLOP may also abstract the manipulation of physic data while providing contextual features such as
13 coordinate transform, physical quantity extraction from data.
14 That said increasing graphical features usually lead to slower software and more complex GUI. Keeping
15 SciQLOP lightweight and intuitive is one of the priorities to make it usable and competitive.
16
17
18 ## How to build
19
20 ```
21 git clone https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/SciQLOP_Repos/SciQLop
22 cd SciQLop
23 mkdir build && cd build
24 cmake ../
25 make
26
27 ```
28
29 ## How to contribute
30
31 Contact sciqlop@lpp.polytechnique.fr
@@ -1,18 +1,17
1 @echo off
1 @echo off
2 echo Setting up environment for Qt usage...
2 echo Setting up environment for Qt usage...
3
3
4 set QT_QMAKE_PATH=C:\Qt\5.8\mingw53_32\bin
4 set QT_QMAKE_PATH=C:\Qt\5.8\mingw53_32\bin
5 set QT_MINGW_PATH=C:\Qt\Tools\mingw530_32\bin
5 set QT_MINGW_PATH=C:\Qt\Tools\mingw530_32\bin
6 set NSIS_PATH=C:\Appli\NSIS
7 set LLVM_PATH=C:\Appli\LLVM\bin
6 set LLVM_PATH=C:\Appli\LLVM\bin
8 set CMAKE_PATH=C:\Appli\CMake\bin
7 set CMAKE_PATH=C:\Appli\CMake\bin
9 set NINJA_PATH=C:\Appli\Ninja
8 set NINJA_PATH=C:\Appli\Ninja
10
9
11 set PERL_SITE_PATH=C:\Perl64\site\bin
10 set PERL_SITE_PATH=C:\Perl64\site\bin
12 set PERL_PATH=C:\Perl64\bin
11 set PERL_PATH=C:\Perl64\bin
13 set PYTHON_PATH=C:\Appli\Python\Python36-32
12 set PYTHON_PATH=C:\Appli\Python\Python36-32
14 set SCAN_BUILD_PATH=C:\Dev\CNRS-DEV\cfe\tools\scan-build\bin
13 set SCAN_BUILD_PATH=C:\Dev\CNRS-DEV\cfe\tools\scan-build\bin
15
14
16
15
17 set PATH=%QT_QMAKE_PATH%;%QT_MINGW_PATH%;%PERL_SITE_PATH%;%PERL_PATH%;%PYTHON_PATH%;%NSIS_PATH%;%SCAN_BUILD_PATH%;%LLVM_PATH%;%CMAKE_PATH%;%NINJA_PATH%;%PATH%
16 set PATH=%QT_QMAKE_PATH%;%QT_MINGW_PATH%;%PERL_SITE_PATH%;%PERL_PATH%;%PYTHON_PATH%;%SCAN_BUILD_PATH%;%LLVM_PATH%;%CMAKE_PATH%;%NINJA_PATH%;%PATH%
18 cd /D C:\Dev\CNRS-DEV\SciQlopInit
17 cd /D C:\Dev\CNRS-DEV\SciQlopInit
@@ -1,18 +1,20
1
1
2 QT_PATH=".../Qt/5.8/gcc_64/lib/cmake/"
3
2 export CC=/usr/libexec/ccc-analyzer
4 export CC=/usr/libexec/ccc-analyzer
3 export CXX=/usr/libexec/c++-analyzer
5 export CXX=/usr/libexec/c++-analyzer
4 export CCC_CC=clang
6 export CCC_CC=clang
5 export CCC_CXX=clang++
7 export CCC_CXX=clang++
6 export LD=clang++
8 export LD=clang++
7 export CCC_ANALYZER_VERBOSE=1
9 export CCC_ANALYZER_VERBOSE=1
8
10
9 LD_LIBRARY_PATH=/usr/local/lib64
11 LD_LIBRARY_PATH=/usr/local/lib64
10 export LD_LIBRARY_PATH
12 export LD_LIBRARY_PATH
11
13
12 rm -rf build_clang-analyzer
14 rm -rf build_clang-analyzer
13 mkdir build_clang-analyzer
15 mkdir build_clang-analyzer
14 cd build_clang-analyzer
16 cd build_clang-analyzer
15
17
16 scan-build cmake -DCMAKE_CXX_COMPILER=clazy -DENABLE_ANALYSIS=false -DENABLE_CPPCHECK=false -DENABLE_FORMATTING=false -DENABLE_CHECKSTYLE=false -BUILD_DOCUMENTATION=false -BUILD_TESTS=false -DCMAKE_BUILD_TYPE=Debug ../../SCIQLOP-Initialisation/
18 scan-build cmake -DCMAKE_PREFIX_PATH=$QT_PATH -DCMAKE_CXX_COMPILER=clazy -DENABLE_ANALYSIS=false -DENABLE_CPPCHECK=false -DENABLE_FORMATTING=false -DENABLE_CHECKSTYLE=false -BUILD_DOCUMENTATION=false -BUILD_TESTS=false -DCMAKE_BUILD_TYPE=Debug ../../SCIQLOP-Initialisation/
17
19
18 scan-build -o clang-analyzer-output make -j2
20 scan-build -o clang-analyzer-output make -j2
@@ -1,157 +1,147
1
1
2 ## sciqlop - CMakeLists.txt
2 ## sciqlop - CMakeLists.txt
3 SET(EXECUTABLE_NAME "sciqlop")
3 SET(EXECUTABLE_NAME "sciqlop")
4 SCIQLOP_SET_TO_PARENT_SCOPE(EXECUTABLE_NAME)
5 SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
4 SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
5 SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include)
7 SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/ui)
6 SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src)
8 SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources)
7 SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources)
9
8
10 # Include gui directory
11 include_directories("${INCLUDES_DIR}")
12
13 #
9 #
14 # Find Qt modules
10 # Find Qt modules
15 #
11 #
16 SCIQLOP_FIND_QT(Core Widgets)
12 SCIQLOP_FIND_QT(Core Widgets)
17
18
13
19 #
14 #
20 # Find dependent libraries
15 # Find dependent libraries
21 # ========================
16 # ========================
22 find_package(sciqlop-gui)
17 find_package(sciqlop-gui)
23
18
19 message("Librairies inclues dans APP: ${SCIQLOP-GUI_LIBRARIES}")
24 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
20 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
25 SET(EXTERN_SHARED_LIBRARIES)
21 SET(EXTERN_SHARED_LIBRARIES)
26
22
27 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
23 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
28
24
29 # Add sqpcore to the list of libraries to use
25 # Add sqpcore to the list of libraries to use
30 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
26 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
31
27
32 # Include core directory
28 # Include core directory
33 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
29 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
34
30
35 # Add dependent shared libraries
31 # Add dependent shared libraries
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
32 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
37
33
38 # Retrieve the location of the dynamic library to copy it to the output path
34 # Retrieve the location of the dynamic library to copy it to the output path
39 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
35 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
40 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
36 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
41
37
42 # Ui files
43 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
44
45 #
38 #
46 # Compile the application
39 # Compile the application
47 #
40 #
48 FILE (GLOB_RECURSE APPLICATION_SOURCES
41 FILE (GLOB_RECURSE APPLICATION_SOURCES
49 ${INCLUDES_DIR}/*.h
42 ${SOURCES_DIR}/*.c
50 ${SOURCES_DIR}/*.c
43 ${SOURCES_DIR}/*.cpp
51 ${SOURCES_DIR}/*.cpp
44 ${SOURCES_DIR}/*.h)
52 ${SOURCES_DIR}/*.h
45
53 ${PROJECT_FORMS})
46 # Headers files (.h)
47 FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h)
48
49 # Ui files
50 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
54
51
52 # Resources files
53 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
54
55 # Retrieve resources files
55 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
56 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
56
57
57 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
58 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
58
59
59 QT5_WRAP_UI(UIS_HDRS
60 QT5_WRAP_UI(UIS_HDRS
60 ${PROJECT_FORMS}
61 ${PROJECT_FORMS}
61 )
62 )
62
63
63
64
64 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
65 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
65 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67 target_link_libraries(${EXECUTABLE_NAME}
68 target_link_libraries(${EXECUTABLE_NAME}
68 ${LIBRARIES})
69 ${LIBRARIES})
69
70
70 INSTALL(TARGETS ${EXECUTABLE_NAME}
71 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
72 LIBRARY DESTINATION ${INSTALL_BINARY_DIR}
73 ARCHIVE DESTINATION ${INSTALL_BINARY_DIR}
74 )
75 # Link with Qt5 modules
71 # Link with Qt5 modules
76 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
72 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
77
78
79 add_dependencies(${EXECUTABLE_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
80
81
73
82
74
83 # Add the files to the list of files to be analyzed
75 # Add the files to the list of files to be analyzed
84 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
76 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
85 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
77 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
86 # Vera++ exclusion files
78 # Vera++ exclusion files
87 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
79 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
88 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
80 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
89
81
90 #
82 #
91 # Compile the tests
83 # Compile the tests
92 #
84 #
93 IF(BUILD_TESTS)
85 IF(BUILD_TESTS)
94
95 INCLUDE_DIRECTORIES(${SOURCES_DIR})
86 INCLUDE_DIRECTORIES(${SOURCES_DIR})
96 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
87 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
97 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
88 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
98 SET( TEST_LIBRARIES ${LIBRARIES})
89 SET( TEST_LIBRARIES ${LIBRARIES})
99
90
100 FOREACH( testFile ${TESTS_SOURCES} )
91 FOREACH( testFile ${TESTS_SOURCES} )
101 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
92 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
102 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
93 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
103
94
104 # Add to the list of sources files all the sources in the same
95 # Add to the list of sources files all the sources in the same
105 # directory that aren't another test
96 # directory that aren't another test
106 FILE (GLOB currentTestSources
97 FILE (GLOB currentTestSources
107 ${testDirectory}/*.c
98 ${testDirectory}/*.c
108 ${testDirectory}/*.cpp
99 ${testDirectory}/*.cpp
109 ${testDirectory}/*.h)
100 ${testDirectory}/*.h)
110 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
101 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
111 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
112
103
113 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
114 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
115 qt5_use_modules(${testName} Test)
106 qt5_use_modules(${testName} Test)
116
107
117 ADD_TEST( NAME ${testName} COMMAND ${testName} )
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
118
109
119 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
110 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
120 ENDFOREACH( testFile )
111 ENDFOREACH( testFile )
121
112
122 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
113 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
123 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
114 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
124 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
115 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
125
126 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
116 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
127 ENDIF(BUILD_TESTS)
117 ENDIF(BUILD_TESTS)
128
118
129 #
119 #
130 # Set the files that must be formatted by clang-format.
120 # Set the files that must be formatted by clang-format.
131 #
121 #
132 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
122 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
133 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
123 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
134
124
135 #
125 #
136 # Set the directories that doxygen must browse to generate the
126 # Set the directories that doxygen must browse to generate the
137 # documentation.
127 # documentation.
138 #
128 #
139 # Source directories:
129 # Source directories:
140 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
130 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
141 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
131 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
142 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
132 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
143 # Source directories to exclude from the documentation generation
133 # Source directories to exclude from the documentation generation
144 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
134 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
145 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
135 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
146
136
147 #
137 #
148 # Set the directories with the sources to analyze and propagate the
138 # Set the directories with the sources to analyze and propagate the
149 # modification to the parent scope
139 # modification to the parent scope
150 #
140 #
151 # Source directories to analyze:
141 # Source directories to analyze:
152 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
142 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
153 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
143 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
154 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
144 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
155 # Source directories to exclude from the analysis
145 # Source directories to exclude from the analysis
156 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
146 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
157 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
147 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,80 +1,39
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "MainWindow.h"
22 #include "mainwindow.h"
23 #include <QProcessEnvironment>
23 #include <QProcessEnvironment>
24 #include <QThread>
24 #include <QThread>
25 #include <SqpApplication.h>
25 #include <SqpApplication.h>
26 #include <omp.h>
26 #include <qglobal.h>
27 #include <qglobal.h>
27
28
28 #include <Plugin/PluginManager.h>
29 #include <QDir>
30
31 #include <QLoggingCategory>
32
33 Q_LOGGING_CATEGORY(LOG_Main, "Main")
34
35 namespace {
36
37 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
38
39
40 } // namespace
41
42 int main(int argc, char *argv[])
29 int main(int argc, char *argv[])
43 {
30 {
44 SqpApplication a{argc, argv};
31 SqpApplication a(argc, argv);
45 SqpApplication::setOrganizationName("LPP");
32 SqpApplication::setOrganizationName("LPP");
46 SqpApplication::setOrganizationDomain("lpp.fr");
33 SqpApplication::setOrganizationDomain("lpp.fr");
47 SqpApplication::setApplicationName("SciQLop");
34 SqpApplication::setApplicationName("SciQLop");
48 MainWindow w;
35 MainWindow w;
49 w.show();
36 w.show();
50
37
51 // Loads plugins
52 auto pluginDir = QDir{a.applicationDirPath()};
53 auto pluginLookupPath = {
54 a.applicationDirPath(),
55 a.applicationDirPath() + "/" + PLUGIN_DIRECTORY_NAME,
56 a.applicationDirPath() + "/../lib64/SciQlop",
57 a.applicationDirPath() + "/../lib64/sciqlop",
58 a.applicationDirPath() + "/../lib/SciQlop",
59 a.applicationDirPath() + "/../lib/sciqlop",
60 a.applicationDirPath() + "/../plugins",
61 };
62
63 #if _WIN32 || _WIN64
64 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
65 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
66 #endif
67
68 PluginManager pluginManager{};
69
70 for (auto &&path : pluginLookupPath) {
71 QDir directory{path};
72 if (directory.exists()) {
73 qCDebug(LOG_Main())
74 << QObject::tr("Plugin directory: %1").arg(directory.absolutePath());
75 pluginManager.loadPlugins(directory);
76 }
77 }
78
79 return a.exec();
38 return a.exec();
80 }
39 }
@@ -1,65 +1,60
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the SciQLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2017, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #ifndef SCIQLOP_MAINWINDOW_H
22 #ifndef MAINWINDOW_H
23 #define SCIQLOP_MAINWINDOW_H
23 #define MAINWINDOW_H
24
24
25 #include <QListWidgetItem>
25 #include <QListWidgetItem>
26 #include <QLoggingCategory>
27 #include <QMainWindow>
26 #include <QMainWindow>
28 #include <QProgressBar>
27 #include <QProgressBar>
29 #include <QProgressDialog>
28 #include <QProgressDialog>
30 #include <QThread>
29 #include <QThread>
31 #include <QVBoxLayout>
30 #include <QVBoxLayout>
32 #include <QWidget>
31 #include <QWidget>
32 //#include "../Core/qlopservice.h"
33 //#include "../Core/qlopgui.h"
33
34
34 #include <Common/spimpl.h>
35
36 #include <memory>
37
38 Q_DECLARE_LOGGING_CATEGORY(LOG_MainWindow)
39
35
40 namespace Ui {
36 namespace Ui {
41 class MainWindow;
37 class MainWindow;
42 } // namespace Ui
38 }
43
44
39
45 class MainWindow : public QMainWindow {
40 class MainWindow : public QMainWindow {
46 Q_OBJECT
41 Q_OBJECT
47
42
48 public:
43 public:
49 explicit MainWindow(QWidget *parent = 0);
44 explicit MainWindow(QWidget *parent = 0);
50 virtual ~MainWindow();
45 ~MainWindow();
51 public slots:
46 public slots:
52
47
53 protected:
48 protected:
54 void changeEvent(QEvent *e);
49 void changeEvent(QEvent *e);
55
50
56 private:
51 private:
57 std::unique_ptr<Ui::MainWindow> m_Ui;
52 Ui::MainWindow *ui;
58 // QWidget *m_progressWidget;
53 QList<QProgressBar *> m_progress;
59 // QVBoxLayout *m_progressLayout;
54 int *m_progressThreadIds;
55 QWidget *m_progressWidget;
56 QVBoxLayout *m_progressLayout;
60 // QList<QLopService*> m_qlopServices;
57 // QList<QLopService*> m_qlopServices;
61 class MainWindowPrivate;
62 spimpl::unique_impl_ptr<MainWindowPrivate> impl;
63 };
58 };
64
59
65 #endif // SCIQLOP_MAINWINDOW_H
60 #endif // MAINWINDOW_H
@@ -1,39 +1,39
1 #
1 #
2 # sciqlop.cmake
2 # sciqlop.cmake
3 #
3 #
4
4
5 #
5 #
6 # Update the CMAKE_MODULE_PATH to use custom FindXXX files
6 # Update the CMAKE_MODULE_PATH to use custom FindXXX files
7 #
7 #
8 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/CMakeModules/")
8 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/CMakeModules/")
9
9
10 # Include the sciqlop version file
10 # Include the sciqlop version file
11 INCLUDE("cmake/sciqlop_version.cmake")
11 INCLUDE("cmake/sciqlop_version.cmake")
12
12
13 # Include the sciqlop cmake macros
13 # Include the sciqlop cmake macros
14 INCLUDE("cmake/sciqlop_macros.cmake")
14 INCLUDE("cmake/sciqlop_macros.cmake")
15
15
16 #
16 #
17 # Define the project parameters
17 # Define the project parameters
18 #
18 #
19 INCLUDE("cmake/sciqlop_params.cmake")
19 INCLUDE("cmake/sciqlop_params.cmake")
20
20
21 #
21 #
22 # Configure the compiler
22 # Configure the compiler
23 #
23 #
24 #INCLUDE("cmake/compiler/compiler.cmake")
24 INCLUDE("cmake/compiler/compiler.cmake")
25
25
26 #
26 #
27 # Find all necessary dependencies
27 # Find all necessary dependencies
28 #
28 #
29 INCLUDE("cmake/find_libs.cmake")
29 INCLUDE("cmake/find_libs.cmake")
30
30
31 #
31 #
32 # Compile all applications
32 # Compile all applications
33 #
33 #
34 INCLUDE("cmake/sciqlop_applications.cmake")
34 INCLUDE("cmake/sciqlop_applications.cmake")
35
35
36 #
36 #
37 # Package creation using CPack
37 # Package creation using CPack
38 #
38 #
39 INCLUDE("cmake/sciqlop_package.cmake")
39 INCLUDE("cmake/sciqlop_package.cmake")
@@ -1,65 +1,37
1 #
2 # Sciqlop_modules.cmake
3 #
4 # Set ouptut directories
5 #
6 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
7 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
1
8
2 if(BUILD_TESTS)
3 INCLUDE ("cmake/sciqlop_code_coverage.cmake")
4 APPEND_COVERAGE_COMPILER_FLAGS()
5 endif(BUILD_TESTS)
6
9
7 #
10 #
8 # Compile the diffents modules
11 # Compile the diffents modules
9 #
12 #
10 set(sciqlop-plugin_DIR "${CMAKE_SOURCE_DIR}/plugin/cmake")
11 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-plugin_DIR}")
12 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugin")
13
14 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
13 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
15 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
14 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
16 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
15 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
17
16
18 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
17 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
19 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
18 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
20 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
19 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
21
20
22 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
21 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
23
22
24 OPTION (BUILD_PLUGINS "Build the plugins" OFF)
25 IF(BUILD_PLUGINS)
26 set(sciqlop-mockplugin_DIR "${CMAKE_SOURCE_DIR}/plugins/mockplugin/cmake")
27 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-mockplugin_DIR}")
28 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/mockplugin")
29
30 set(sciqlop-amda_DIR "${CMAKE_SOURCE_DIR}/plugins/amda/cmake")
31 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-amda_DIR}")
32 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/amda")
33
34 # Temporary target to copy to plugins dir
35 find_package(sciqlop-mockplugin)
36 find_package(sciqlop-amda)
37 ADD_CUSTOM_TARGET(plugins
38 COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-MOCKPLUGIN_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-MOCKPLUGIN_LIBRARIES_NAME}"
39 COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-AMDA_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-AMDA_LIBRARIES_NAME}"
40 )
41 ENDIF(BUILD_PLUGINS)
42
43 # LOGGER
44 set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini")
45 FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH})
46
47
48 #
23 #
49 # Code formatting
24 # Code formatting
50 #
25 #
51 # Vera++ exclusion files
52 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt)
53 #SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
54 INCLUDE ("cmake/sciqlop_formatting.cmake")
26 INCLUDE ("cmake/sciqlop_formatting.cmake")
55
27
56 #
28 #
57 # Documentation generation
29 # Documentation generation
58 #
30 #
59 INCLUDE ("cmake/sciqlop_doxygen.cmake")
31 INCLUDE ("cmake/sciqlop_doxygen.cmake")
60
32
61 #
33 #
62 # Source code analysis
34 # Source code analysis
63 #
35 #
64 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
36 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
65 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
37 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
@@ -1,59 +0,0
1 #
2 # Generate the source package of SciqLop.
3 #
4
5 install(DIRECTORY
6 ${EXECUTABLE_OUTPUT_PATH}
7 DESTINATION "."
8 USE_SOURCE_PERMISSIONS
9 COMPONENT CORE
10 PATTERN "*.a" EXCLUDE
11 )
12
13 set(EXECUTABLEDOTEXTENSION)
14 if(WIN32)
15 set(EXECUTABLEDOTEXTENSION ".exe")
16 endif(WIN32)
17 set (SCIQLOP_EXE_LOCATION ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE_NAME}${EXECUTABLEDOTEXTENSION})
18
19 if(WIN32)
20 include ("cmake/sciqlop_package_qt.cmake")
21 endif(WIN32)
22
23
24 SET (CPACK_PACKAGE_VENDOR "CNRS")
25 SET (CPACK_PACKAGE_VERSION_MAJOR "${SCIQLOP_VERSION_MAJOR}")
26 SET (CPACK_PACKAGE_VERSION_MINOR "${SCIQLOP_VERSION_MINOR}")
27 SET (CPACK_PACKAGE_VERSION_PATCH "${SCIQLOP_VERSION_PATCH}${SCIQLOP_VERSION_SUFFIX}")
28 SET (CPACK_PACKAGE_VERSION "${SCIQLOP_VERSION}")
29 SET (CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/COPYING)
30 SET (CPACK_PACKAGE_CONTACT "nicolas.aunai@lpp.polytechnique.fr")
31 SET(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
32 # SET(CPACK_RESOURCE_FILE_WELCOME ${CMAKE_CURRENT_SOURCE_DIR}/WARN.txt)
33 SET(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
34 # SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_NAME}-${PROJECT_VERSION})
35 SET(FULLBUILD ON)
36
37 SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
38 SET(CPACK_GENERATOR "NSIS")
39 SET(CPACK_MONOLITHIC_INSTALL 1)
40 #SET(CPACK_COMPONENTS_ALL sciqlop qt)
41 SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Setup")
42 SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_NAME})
43
44 set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
45
46 if (WIN32)
47 SET(CPACK_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
48 SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
49 SET(CPACK_NSIS_COMPONENT_INSTALL ON)
50 SET(CPACK_SYSTEM_NAME "MinGW32")
51 SET(CPACK_PACKAGING_INSTALL_PREFIX "")
52 #SET(CPACK_GENERATOR "NSIS")
53 SET(CPACK_NSIS_DISPLAY_NAME ${PROJECT_NAME})
54 SET(CPACK_NSIS_MUI_FINISHPAGE_RUN ${SCIQLOP_EXECUTABLE_NAME})
55 SET(CPACK_NSIS_MUI_ICON ${SCIQLOP_EXECUTABLE_ICON_LOCATION})
56 SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\${SCIQLOP_EXECUTABLE_NAME}.exe")
57 endif (WIN32)
58
59 INCLUDE(CPack)
@@ -1,128 +1,90
1 #
1 #
2 # sciqlop_params : Define compilation parameters
2 # sciqlop_params : Define compilation parameters
3 #
3 #
4 # Debug or release
4 # Debug or release
5 #
5 #
6 # As the "NMake Makefiles" forces by default the CMAKE_BUILD_TYPE variable to Debug, SCIQLOP_BUILD_TYPE variable is used to be sure that the debug mode is a user choice
6 # As the "NMake Makefiles" forces by default the CMAKE_BUILD_TYPE variable to Debug, SCIQLOP_BUILD_TYPE variable is used to be sure that the debug mode is a user choice
7 #SET(SCIQLOP_BUILD_TYPE "Release" CACHE STRING "Choose to compile in Debug or Release mode")
7 #SET(SCIQLOP_BUILD_TYPE "Release" CACHE STRING "Choose to compile in Debug or Release mode")
8
8
9 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
9 #IF(SCIQLOP_BUILD_TYPE MATCHES "Debug")
10 SET (DEBUG_SUFFIX "d")
10 # MESSAGE (STATUS "Build in Debug")
11 ELSE()
11 # SET (CMAKE_BUILD_TYPE "Debug")
12 MESSAGE (STATUS "Build in Release")
12 # SET (DEBUG_SUFFIX "d")
13 SET (DEBUG_SUFFIX "")
13 #ELSE()
14 ENDIF()
14 # MESSAGE (STATUS "Build in Release")
15 # SET (CMAKE_BUILD_TYPE "Release")
16 # SET (SCIQLOP_BUILD_TYPE "Release")
17 # SET (DEBUG_SUFFIX "")
18 #ENDIF()
15
19
16 #
20 #
17 # Need to compile tests?
21 # Need to compile tests?
18 #
22 #
19 OPTION (BUILD_TESTS "Build the tests" OFF)
23 OPTION (BUILD_TESTS "Build the tests" OFF)
20 ENABLE_TESTING(${BUILD_TESTS})
24 ENABLE_TESTING(${BUILD_TESTS})
21
25
22 #
26 #
23 # Path to the folder for sciqlop's extern libraries.
27 # Path to the folder for sciqlop's extern libraries.
24 #
28 #
25 # When looking for an external library in sciqlop, we look to the following
29 # When looking for an external library in sciqlop, we look to the following
26 # folders:
30 # folders:
27 # - The specific folder for the library (generally of the form <LIBRARY>_ROOT_DIR
31 # - The specific folder for the library (generally of the form <LIBRARY>_ROOT_DIR
28 # - The global Sciqlop extern folder
32 # - The global Sciqlop extern folder
29 # - The system folders.
33 # - The system folders.
30 #
34 #
31 # If a dependency is found in the global extern folder or a specific folder for
35 # If a dependency is found in the global extern folder or a specific folder for
32 # the library, then it is installed with the sciqlop libraries. If it is found
36 # the library, then it is installed with the sciqlop libraries. If it is found
33 # in the system folders, it is not. This behavior can be overriden with the
37 # in the system folders, it is not. This behavior can be overriden with the
34 # <LIBRARY>_COPY_SHARED_LIBRARIES flag.
38 # <LIBRARY>_COPY_SHARED_LIBRARIES flag.
35 #
39 #
36 set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern"
40 set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern"
37 CACHE PATH "Path to the folder for sciqlop's extern libraries")
41 CACHE PATH "Path to the folder for sciqlop's extern libraries")
38 option(SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR "Force the <LIBRARY>_ROOT_DIR to be updated to the global sciqlop extern folder"
42 option(SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR "Force the <LIBRARY>_ROOT_DIR to be updated to the global sciqlop extern folder"
39 OFF)
43 OFF)
40
44
41 if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR)
45 if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR)
42 set(libRootDirForceValue FORCE)
46 set(libRootDirForceValue FORCE)
43 else()
47 else()
44 set(libRootDirForceValue)
48 set(libRootDirForceValue)
45 endif()
49 endif()
46
50
47 #
48 # Sciqlop_modules.cmake
49 #
50 # Set ouptut directories
51 #
52 IF (UNIX)
53 # 32 or 64 bits compiler
54 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
55 SET(defaultLib "lib64/sciqlop")
56 ELSE()
57 SET(defaultLib "lib/sciqlop")
58 ENDIF()
59 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
60 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
61 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${defaultLib})
62 ELSEIF(WIN32)
63 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
64 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
65 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/app/QtProject)
66 ELSE()
67 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
68 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
69 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
70 ENDIF()
71
51
72
52
73 #
53 #
74 # Static or shared libraries
54 # Static or shared libraries
75 #
55 #
76 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
56 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
77
57
78 # Generate position independant code (-fPIC)
58 # Generate position independant code (-fPIC)
79 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
59 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
80
60
81
61 #
82
62 # Configure installation directories
83 # Configuration for make install
63 #
84
85 set(PROJECT_PLUGIN_PREFIX "SciQlop")
86
87 IF (UNIX)
64 IF (UNIX)
88 SET(CMAKE_INSTALL_PREFIX "/usr/local/${PROJECT_PLUGIN_PREFIX}")
89 SET(defaultBin "bin")
65 SET(defaultBin "bin")
90 SET(defaultInc "include/sciqlop")
66 SET(defaultInc "include/sciqlop")
91
67
92 # 32 or 64 bits compiler
68 # 32 or 64 bits compiler
93 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
69 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
94 SET(defaultLib "lib64")
70 SET(defaultLib "lib64/sciqlop")
95 SET(defaultPluginsLib "lib64/${PROJECT_PLUGIN_PREFIX}")
96 ELSE()
71 ELSE()
97 SET(defaultLib "lib/")
72 SET(defaultLib "lib/sciqlop")
98 SET(defaultPluginsLib "lib/${PROJECT_PLUGIN_PREFIX}")
99 ENDIF()
73 ENDIF()
100
74
101 SET(defaultDoc "share/docs/${PROJECT_PLUGIN_PREFIX}")
75 SET(defaultDoc "share/docs/sciqlop")
102 ELSE()
76 ELSE()
103 SET(defaultBin "bin")
77 SET(defaultBin "bin")
104 SET(defaultInc "include/${PROJECT_PLUGIN_PREFIX}")
78 SET(defaultInc "include/sciqlop")
105 SET(defaultLib "lib")
79 SET(defaultLib "lib/sciqlop")
106 SET(defaultPluginsLib "lib/${PROJECT_PLUGIN_PREFIX}")
80 SET(defaultDoc "docs/sciqlop")
107 SET(defaultDoc "docs/${PROJECT_PLUGIN_PREFIX}")
108 ENDIF()
81 ENDIF()
109
82
110 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
83 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
111 "Installation directory for binaries")
84 "Installation directory for binaries")
112 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
85 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
113 "Installation directory for libraries")
86 "Installation directory for libraries")
114 SET(INSTALL_PLUGINS_LIBRARY_DIR "${defaultPluginsLib}" CACHE STRING
115 "Installation directory for libraries")
116 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
87 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
117 "Installation directory for headers")
88 "Installation directory for headers")
118 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
89 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
119 "Installation directory for documentations")
90 "Installation directory for documentations")
120
121
122 # Set the rpath when installing
123 SET(CMAKE_SKIP_BUILD_RPATH FALSE)
124 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
125 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
126 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
127
128 message("Install RPATH: ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
@@ -1,156 +1,128
1
1
2 ## core - CMakeLists.txt
2 ## core - CMakeLists.txt
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
7
7
8 # Include core directory
8 # Include core directory
9 include_directories("${INCLUDES_DIR}")
9 include_directories("${INCLUDES_DIR}")
10
10
11 # Set a variable to display a warning in the version files.
11 # Set a variable to display a warning in the version files.
12 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
12 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
13 # Generate the version file from the cmake version variables. The version
13 # Generate the version file from the cmake version variables. The version
14 # variables are defined in the cmake/sciqlop_version.cmake file.
14 # variables are defined in the cmake/sciqlop_version.cmake file.
15 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
15 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
16 "${INCLUDES_DIR}/Version.h")
16 "${INCLUDES_DIR}/Version.h")
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
18 "${SOURCES_DIR}/Version.cpp")
18 "${SOURCES_DIR}/Version.cpp")
19
19
20 # Find dependent modules
21 find_package(sciqlop-plugin)
22 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
23
24 #
20 #
25 # Find Qt modules
21 # Find Qt modules
26 #
22 #
27 SCIQLOP_FIND_QT(Core Network)
23 SCIQLOP_FIND_QT(Core)
28
24
29 #
25 #
30 # Compile the library library
26 # Compile the library library
31 #
27 #
32
33 ADD_DEFINITIONS(-DCORE_LIB)
34
35 FILE (GLOB_RECURSE MODULE_SOURCES
28 FILE (GLOB_RECURSE MODULE_SOURCES
36 ${INCLUDES_DIR}/*.h
29 ${INCLUDES_DIR}/*.h
37 ${SOURCES_DIR}/*.c
30 ${SOURCES_DIR}/*.c
38 ${SOURCES_DIR}/*.cpp
31 ${SOURCES_DIR}/*.cpp
39 ${SOURCES_DIR}/*.h)
32 ${SOURCES_DIR}/*.h)
40
33
41 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
34 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
42 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
35 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
43 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
36 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
44 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
37 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
45 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
38 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
46
39
47 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
48 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
49 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
50 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
51 )
52
53 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
40 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
54 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
41 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
55 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
42 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
56 IF(BUILD_SHARED_LIBS)
43 IF(BUILD_SHARED_LIBS)
57 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
44 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
58 ELSE()
45 ELSE()
59 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
46 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
60 ENDIF()
47 ENDIF()
61
48
62 # Set the variable to parent scope so that the other projects can copy the
49 # Set the variable to parent scope so that the other projects can copy the
63 # dependent shared libraries
50 # dependent shared libraries
64 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
51 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
65
52
66 # Copy extern shared libraries to the lib folder
53 # Copy extern shared libraries to the lib folder
67 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
54 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
68
55
69 # Add the files to the list of files to be analyzed
56 # Add the files to the list of files to be analyzed
70 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
57 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
71 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
58 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
72 # Vera++ exclusion files
59 # Vera++ exclusion files
73 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
60 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
74 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
61 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
75
62
76 #
63 #
77 # Compile the tests
64 # Compile the tests
78 #
65 #
79 IF(BUILD_TESTS)
66 IF(BUILD_TESTS)
80 INCLUDE_DIRECTORIES(${SOURCES_DIR})
67 INCLUDE_DIRECTORIES(${SOURCES_DIR})
81 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
68 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
82 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
69 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
83 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
70 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
84
71
85 SET(TARGETS_COV)
86 FOREACH( testFile ${TESTS_SOURCES} )
72 FOREACH( testFile ${TESTS_SOURCES} )
87 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
73 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
88 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
74 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
89
75
90 # Add to the list of sources files all the sources in the same
76 # Add to the list of sources files all the sources in the same
91 # directory that aren't another test
77 # directory that aren't another test
92 FILE (GLOB currentTestSources
78 FILE (GLOB currentTestSources
93 ${testDirectory}/*.c
79 ${testDirectory}/*.c
94 ${testDirectory}/*.cpp
80 ${testDirectory}/*.cpp
95 ${testDirectory}/*.h)
81 ${testDirectory}/*.h)
96 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
82 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
97 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
83 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
98
84
99 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
85 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
100 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
86 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
101 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
87 qt5_use_modules(${testName} Test)
102 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
103 qt5_use_modules(${testName} Test)
104
88
105 ADD_TEST( NAME ${testName} COMMAND ${testName} )
89 ADD_TEST( NAME ${testName} COMMAND ${testName} )
106
90
107 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
91 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
108 set(Coverage_NAME ${testName})
92 ENDFOREACH( testFile )
109 if(UNIX)
110 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
111 LIST( APPEND TARGETS_COV ${testName}_coverage)
112 endif(UNIX)
113
114 ENDFOREACH( testFile )
115
116 add_custom_target(coverage)
117
118 FOREACH( target_cov ${TARGETS_COV} )
119 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
120 ENDFOREACH( target_cov )
121
93
122 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
94 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
123 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
95 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
124 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
96 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
125 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
97 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
126 ENDIF(BUILD_TESTS)
98 ENDIF(BUILD_TESTS)
127
99
128 #
100 #
129 # Set the files that must be formatted by clang-format.
101 # Set the files that must be formatted by clang-format.
130 #
102 #
131 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
103 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
132 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
104 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
133
105
134 #
106 #
135 # Set the directories that doxygen must browse to generate the
107 # Set the directories that doxygen must browse to generate the
136 # documentation.
108 # documentation.
137 #
109 #
138 # Source directories:
110 # Source directories:
139 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
111 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
140 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
112 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
141 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
113 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
142 # Source directories to exclude from the documentation generation
114 # Source directories to exclude from the documentation generation
143 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
115 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
144 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
116 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
145
117
146 #
118 #
147 # Set the directories with the sources to analyze and propagate the
119 # Set the directories with the sources to analyze and propagate the
148 # modification to the parent scope
120 # modification to the parent scope
149 #
121 #
150 # Source directories to analyze:
122 # Source directories to analyze:
151 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
123 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
152 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
124 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
153 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
125 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
154 # Source directories to exclude from the analysis
126 # Source directories to exclude from the analysis
155 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
127 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
156 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
128 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,460 +1,461
1 /*
1 /*
2 ====================================================================
2 ====================================================================
3 A Smart Pointer to IMPLementation (i.e. Smart PIMPL or just SPIMPL).
3 A Smart Pointer to IMPLementation (i.e. Smart PIMPL or just SPIMPL).
4 ====================================================================
4 ====================================================================
5
5
6 Version: 1.1
6 Version: 1.1
7
7
8 Latest version:
8 Latest version:
9 https://github.com/oliora/samples/blob/master/spimpl.h
9 https://github.com/oliora/samples/blob/master/spimpl.h
10 Rationale and description:
10 Rationale and description:
11 http://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html
11 http://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html
12
12
13 Copyright (c) 2015 Andrey Upadyshev (oliora@gmail.com)
13 Copyright (c) 2015 Andrey Upadyshev (oliora@gmail.com)
14
14
15 Distributed under the Boost Software License, Version 1.0.
15 Distributed under the Boost Software License, Version 1.0.
16 See http://www.boost.org/LICENSE_1_0.txt
16 See http://www.boost.org/LICENSE_1_0.txt
17
17
18 Changes history
18 Changes history
19 ---------------
19 ---------------
20 v1.1:
20 v1.1:
21 - auto_ptr support is disabled by default for C++17 compatibility
21 - auto_ptr support is disabled by default for C++17 compatibility
22 v1.0:
22 v1.0:
23 - Released
23 - Released
24 */
24 */
25
25
26 #ifndef SPIMPL_H_
26 #ifndef SPIMPL_H_
27 #define SPIMPL_H_
27 #define SPIMPL_H_
28
28
29 #include <cassert>
29 #include <cassert>
30 #include <memory>
30 #include <memory>
31 #include <type_traits>
31 #include <type_traits>
32
32
33
33 #if defined _MSC_VER && _MSC_VER < 1900 // MS Visual Studio before VS2015
34 #if defined _MSC_VER && _MSC_VER < 1900 // MS Visual Studio before VS2015
34 #define SPIMPL_NO_CPP11_NOEXCEPT
35 #define SPIMPL_NO_CPP11_NOEXCEPT
35 #define SPIMPL_NO_CPP11_CONSTEXPR
36 #define SPIMPL_NO_CPP11_CONSTEXPR
36 #define SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
37 #define SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
37 #endif
38 #endif
38
39
39 #if !defined SPIMPL_NO_CPP11_NOEXCEPT
40 #if !defined SPIMPL_NO_CPP11_NOEXCEPT
40 #define SPIMPL_NOEXCEPT noexcept
41 #define SPIMPL_NOEXCEPT noexcept
41 #else
42 #else
42 #define SPIMPL_NOEXCEPT
43 #define SPIMPL_NOEXCEPT
43 #endif
44 #endif
44
45
45 #if !defined SPIMPL_NO_CPP11_CONSTEXPR
46 #if !defined SPIMPL_NO_CPP11_CONSTEXPR
46 #define SPIMPL_CONSTEXPR constexpr
47 #define SPIMPL_CONSTEXPR constexpr
47 #else
48 #else
48 #define SPIMPL_CONSTEXPR
49 #define SPIMPL_CONSTEXPR
49 #endif
50 #endif
50
51
51 // define SPIMPL_HAS_AUTO_PTR to enable constructor and assignment operator that accept
52 // define SPIMPL_HAS_AUTO_PTR to enable constructor and assignment operator that accept
52 // std::auto_ptr
53 // std::auto_ptr
53 // TODO: auto detect std::auto_ptr support
54 // TODO: auto detect std::auto_ptr support
54
55
55
56
56 namespace spimpl {
57 namespace spimpl {
57 namespace details {
58 namespace details {
58 template <class T>
59 template <class T>
59 T *default_copy(T *src)
60 T *default_copy(T *src)
60 {
61 {
61 static_assert(sizeof(T) > 0, "default_copy cannot copy incomplete type");
62 static_assert(sizeof(T) > 0, "default_copy cannot copy incomplete type");
62 static_assert(!std::is_void<T>::value, "default_copy cannot copy incomplete type");
63 static_assert(!std::is_void<T>::value, "default_copy cannot copy incomplete type");
63 return new T(*src);
64 return new T(*src);
64 }
65 }
65
66
66 template <class T>
67 template <class T>
67 void default_delete(T *p) SPIMPL_NOEXCEPT
68 void default_delete(T *p) SPIMPL_NOEXCEPT
68 {
69 {
69 static_assert(sizeof(T) > 0, "default_delete cannot delete incomplete type");
70 static_assert(sizeof(T) > 0, "default_delete cannot delete incomplete type");
70 static_assert(!std::is_void<T>::value, "default_delete cannot delete incomplete type");
71 static_assert(!std::is_void<T>::value, "default_delete cannot delete incomplete type");
71 delete p;
72 delete p;
72 }
73 }
73
74
74 template <class T>
75 template <class T>
75 struct default_deleter {
76 struct default_deleter {
76 using type = void (*)(T *);
77 using type = void (*)(T *);
77 };
78 };
78
79
79 template <class T>
80 template <class T>
80 using default_deleter_t = typename default_deleter<T>::type;
81 using default_deleter_t = typename default_deleter<T>::type;
81
82
82 template <class T>
83 template <class T>
83 struct default_copier {
84 struct default_copier {
84 using type = T *(*)(T *);
85 using type = T *(*)(T *);
85 };
86 };
86
87
87 template <class T>
88 template <class T>
88 using default_copier_t = typename default_copier<T>::type;
89 using default_copier_t = typename default_copier<T>::type;
89
90
90 template <class T, class D, class C>
91 template <class T, class D, class C>
91 struct is_default_manageable
92 struct is_default_manageable
92 : public std::integral_constant<bool, std::is_same<D, default_deleter_t<T> >::value
93 : public std::integral_constant<bool, std::is_same<D, default_deleter_t<T> >::value
93 && std::is_same<C, default_copier_t<T> >::value> {
94 && std::is_same<C, default_copier_t<T> >::value> {
94 };
95 };
95 }
96 }
96
97
97
98
98 template <class T, class Deleter = details::default_deleter_t<T>,
99 template <class T, class Deleter = details::default_deleter_t<T>,
99 class Copier = details::default_copier_t<T> >
100 class Copier = details::default_copier_t<T> >
100 class impl_ptr {
101 class impl_ptr {
101 private:
102 private:
102 static_assert(!std::is_array<T>::value,
103 static_assert(!std::is_array<T>::value,
103 "impl_ptr specialization for arrays is not implemented");
104 "impl_ptr specialization for arrays is not implemented");
104 struct dummy_t_ {
105 struct dummy_t_ {
105 int dummy__;
106 int dummy__;
106 };
107 };
107
108
108 public:
109 public:
109 using pointer = T *;
110 using pointer = T *;
110 using element_type = T;
111 using element_type = T;
111 using copier_type = typename std::decay<Copier>::type;
112 using copier_type = typename std::decay<Copier>::type;
112 using deleter_type = typename std::decay<Deleter>::type;
113 using deleter_type = typename std::decay<Deleter>::type;
113 using unique_ptr_type = std::unique_ptr<T, deleter_type>;
114 using unique_ptr_type = std::unique_ptr<T, deleter_type>;
114 using is_default_manageable = details::is_default_manageable<T, deleter_type, copier_type>;
115 using is_default_manageable = details::is_default_manageable<T, deleter_type, copier_type>;
115
116
116 SPIMPL_CONSTEXPR impl_ptr() SPIMPL_NOEXCEPT : ptr_(nullptr, deleter_type{}),
117 SPIMPL_CONSTEXPR impl_ptr() SPIMPL_NOEXCEPT : ptr_(nullptr, deleter_type{}),
117 copier_(copier_type{})
118 copier_(copier_type{})
118 {
119 {
119 }
120 }
120
121
121 SPIMPL_CONSTEXPR impl_ptr(std::nullptr_t) SPIMPL_NOEXCEPT : impl_ptr() {}
122 SPIMPL_CONSTEXPR impl_ptr(std::nullptr_t) SPIMPL_NOEXCEPT : impl_ptr() {}
122
123
123 template <class D, class C>
124 template <class D, class C>
124 impl_ptr(pointer p, D &&d, C &&c,
125 impl_ptr(pointer p, D &&d, C &&c,
125 typename std::enable_if<std::is_convertible<D, deleter_type>::value
126 typename std::enable_if<std::is_convertible<D, deleter_type>::value
126 && std::is_convertible<C, copier_type>::value,
127 && std::is_convertible<C, copier_type>::value,
127 dummy_t_>::type
128 dummy_t_>::type
128 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(p), std::forward<D>(d)),
129 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(p), std::forward<D>(d)),
129 copier_(std::forward<C>(c))
130 copier_(std::forward<C>(c))
130 {
131 {
131 }
132 }
132
133
133 template <class U>
134 template <class U>
134 impl_ptr(U *u, typename std::enable_if<std::is_convertible<U *, pointer>::value
135 impl_ptr(U *u, typename std::enable_if<std::is_convertible<U *, pointer>::value
135 && is_default_manageable::value,
136 && is_default_manageable::value,
136 dummy_t_>::type
137 dummy_t_>::type
137 = dummy_t_()) SPIMPL_NOEXCEPT
138 = dummy_t_()) SPIMPL_NOEXCEPT
138 : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>)
139 : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>)
139 {
140 {
140 }
141 }
141
142
142 impl_ptr(const impl_ptr &r) : impl_ptr(r.clone()) {}
143 impl_ptr(const impl_ptr &r) : impl_ptr(r.clone()) {}
143
144
144 #ifndef SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
145 #ifndef SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
145 impl_ptr(impl_ptr &&r) SPIMPL_NOEXCEPT = default;
146 impl_ptr(impl_ptr &&r) SPIMPL_NOEXCEPT = default;
146 #else
147 #else
147 impl_ptr(impl_ptr &&r) SPIMPL_NOEXCEPT : ptr_(std::move(r.ptr_)), copier_(std::move(r.copier_))
148 impl_ptr(impl_ptr &&r) SPIMPL_NOEXCEPT : ptr_(std::move(r.ptr_)), copier_(std::move(r.copier_))
148 {
149 {
149 }
150 }
150 #endif
151 #endif
151
152
152 #ifdef SPIMPL_HAS_AUTO_PTR
153 #ifdef SPIMPL_HAS_AUTO_PTR
153 template <class U>
154 template <class U>
154 impl_ptr(std::auto_ptr<U> &&u, typename std::enable_if<std::is_convertible<U *, pointer>::value
155 impl_ptr(std::auto_ptr<U> &&u, typename std::enable_if<std::is_convertible<U *, pointer>::value
155 && is_default_manageable::value,
156 && is_default_manageable::value,
156 dummy_t_>::type
157 dummy_t_>::type
157 = dummy_t_()) SPIMPL_NOEXCEPT
158 = dummy_t_()) SPIMPL_NOEXCEPT
158 : ptr_(u.release(), &details::default_delete<T>),
159 : ptr_(u.release(), &details::default_delete<T>),
159 copier_(&details::default_copy<T>)
160 copier_(&details::default_copy<T>)
160 {
161 {
161 }
162 }
162 #endif
163 #endif
163
164
164 template <class U>
165 template <class U>
165 impl_ptr(std::unique_ptr<U> &&u,
166 impl_ptr(std::unique_ptr<U> &&u,
166 typename std::enable_if<std::is_convertible<U *, pointer>::value
167 typename std::enable_if<std::is_convertible<U *, pointer>::value
167 && is_default_manageable::value,
168 && is_default_manageable::value,
168 dummy_t_>::type
169 dummy_t_>::type
169 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete<T>),
170 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete<T>),
170 copier_(&details::default_copy<T>)
171 copier_(&details::default_copy<T>)
171 {
172 {
172 }
173 }
173
174
174 template <class U, class D, class C>
175 template <class U, class D, class C>
175 impl_ptr(std::unique_ptr<U, D> &&u, C &&c,
176 impl_ptr(std::unique_ptr<U, D> &&u, C &&c,
176 typename std::enable_if<std::is_convertible<U *, pointer>::value
177 typename std::enable_if<std::is_convertible<U *, pointer>::value
177 && std::is_convertible<D, deleter_type>::value
178 && std::is_convertible<D, deleter_type>::value
178 && std::is_convertible<C, copier_type>::value,
179 && std::is_convertible<C, copier_type>::value,
179 dummy_t_>::type
180 dummy_t_>::type
180 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(u)),
181 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(u)),
181 copier_(std::forward<C>(c))
182 copier_(std::forward<C>(c))
182 {
183 {
183 }
184 }
184
185
185 template <class U, class D, class C>
186 template <class U, class D, class C>
186 impl_ptr(impl_ptr<U, D, C> &&u,
187 impl_ptr(impl_ptr<U, D, C> &&u,
187 typename std::enable_if<std::is_convertible<U *, pointer>::value
188 typename std::enable_if<std::is_convertible<U *, pointer>::value
188 && std::is_convertible<D, deleter_type>::value
189 && std::is_convertible<D, deleter_type>::value
189 && std::is_convertible<C, copier_type>::value,
190 && std::is_convertible<C, copier_type>::value,
190 dummy_t_>::type
191 dummy_t_>::type
191 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(u.ptr_)),
192 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(u.ptr_)),
192 copier_(std::move(u.copier_))
193 copier_(std::move(u.copier_))
193 {
194 {
194 }
195 }
195
196
196 impl_ptr &operator=(const impl_ptr &r)
197 impl_ptr &operator=(const impl_ptr &r)
197 {
198 {
198 if (this == &r)
199 if (this == &r)
199 return *this;
200 return *this;
200
201
201 return operator=(r.clone());
202 return operator=(r.clone());
202 }
203 }
203
204
204 #ifndef SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
205 #ifndef SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
205 impl_ptr &operator=(impl_ptr &&r) SPIMPL_NOEXCEPT = default;
206 impl_ptr &operator=(impl_ptr &&r) SPIMPL_NOEXCEPT = default;
206 #else
207 #else
207 impl_ptr &operator=(impl_ptr &&r) SPIMPL_NOEXCEPT
208 impl_ptr &operator=(impl_ptr &&r) SPIMPL_NOEXCEPT
208 {
209 {
209 ptr_ = std::move(r.ptr_);
210 ptr_ = std::move(r.ptr_);
210 copier_ = std::move(r.copier_);
211 copier_ = std::move(r.copier_);
211 return *this;
212 return *this;
212 }
213 }
213 #endif
214 #endif
214
215
215 template <class U, class D, class C>
216 template <class U, class D, class C>
216 typename std::enable_if<std::is_convertible<U *, pointer>::value
217 typename std::enable_if<std::is_convertible<U *, pointer>::value
217 && std::is_convertible<D, deleter_type>::value
218 && std::is_convertible<D, deleter_type>::value
218 && std::is_convertible<C, copier_type>::value,
219 && std::is_convertible<C, copier_type>::value,
219 impl_ptr &>::type
220 impl_ptr &>::type
220 operator=(impl_ptr<U, D, C> &&u) SPIMPL_NOEXCEPT
221 operator=(impl_ptr<U, D, C> &&u) SPIMPL_NOEXCEPT
221 {
222 {
222 ptr_ = std::move(u.ptr_);
223 ptr_ = std::move(u.ptr_);
223 copier_ = std::move(u.copier_);
224 copier_ = std::move(u.copier_);
224 return *this;
225 return *this;
225 }
226 }
226
227
227 template <class U, class D, class C>
228 template <class U, class D, class C>
228 typename std::enable_if<std::is_convertible<U *, pointer>::value
229 typename std::enable_if<std::is_convertible<U *, pointer>::value
229 && std::is_convertible<D, deleter_type>::value
230 && std::is_convertible<D, deleter_type>::value
230 && std::is_convertible<C, copier_type>::value,
231 && std::is_convertible<C, copier_type>::value,
231 impl_ptr &>::type
232 impl_ptr &>::type
232 operator=(const impl_ptr<U, D, C> &u)
233 operator=(const impl_ptr<U, D, C> &u)
233 {
234 {
234 return operator=(u.clone());
235 return operator=(u.clone());
235 }
236 }
236
237
237 //
238 //
238
239
239 #ifdef SPIMPL_HAS_AUTO_PTR
240 #ifdef SPIMPL_HAS_AUTO_PTR
240 template <class U>
241 template <class U>
241 typename std::enable_if<std::is_convertible<U *, pointer>::value
242 typename std::enable_if<std::is_convertible<U *, pointer>::value
242 && is_default_manageable::value,
243 && is_default_manageable::value,
243 impl_ptr &>::type
244 impl_ptr &>::type
244 operator=(std::auto_ptr<U> &&u) SPIMPL_NOEXCEPT
245 operator=(std::auto_ptr<U> &&u) SPIMPL_NOEXCEPT
245 {
246 {
246 return operator=(impl_ptr(std::move(u)));
247 return operator=(impl_ptr(std::move(u)));
247 }
248 }
248 #endif
249 #endif
249
250
250 template <class U>
251 template <class U>
251 typename std::enable_if<std::is_convertible<U *, pointer>::value
252 typename std::enable_if<std::is_convertible<U *, pointer>::value
252 && is_default_manageable::value,
253 && is_default_manageable::value,
253 impl_ptr &>::type
254 impl_ptr &>::type
254 operator=(std::unique_ptr<U> &&u) SPIMPL_NOEXCEPT
255 operator=(std::unique_ptr<U> &&u) SPIMPL_NOEXCEPT
255 {
256 {
256 return operator=(impl_ptr(std::move(u)));
257 return operator=(impl_ptr(std::move(u)));
257 }
258 }
258
259
259 impl_ptr clone() const
260 impl_ptr clone() const
260 {
261 {
261 return impl_ptr(ptr_ ? copier_(ptr_.get()) : nullptr, ptr_.get_deleter(), copier_);
262 return impl_ptr(ptr_ ? copier_(ptr_.get()) : nullptr, ptr_.get_deleter(), copier_);
262 }
263 }
263
264
264 typename std::remove_reference<T>::type &operator*() const { return *ptr_; }
265 typename std::remove_reference<T>::type &operator*() const { return *ptr_; }
265 pointer operator->() const SPIMPL_NOEXCEPT { return get(); }
266 pointer operator->() const SPIMPL_NOEXCEPT { return get(); }
266 pointer get() const SPIMPL_NOEXCEPT { return ptr_.get(); }
267 pointer get() const SPIMPL_NOEXCEPT { return ptr_.get(); }
267
268
268 void swap(impl_ptr &u) SPIMPL_NOEXCEPT
269 void swap(impl_ptr &u) SPIMPL_NOEXCEPT
269 {
270 {
270 using std::swap;
271 using std::swap;
271 ptr_.swap(u.ptr_);
272 ptr_.swap(u.ptr_);
272 swap(copier_, u.copier_);
273 swap(copier_, u.copier_);
273 }
274 }
274
275
275 pointer release() SPIMPL_NOEXCEPT { return ptr_.release(); }
276 pointer release() SPIMPL_NOEXCEPT { return ptr_.release(); }
276
277
277 unique_ptr_type release_unique() SPIMPL_NOEXCEPT { return std::move(ptr_); }
278 unique_ptr_type release_unique() SPIMPL_NOEXCEPT { return std::move(ptr_); }
278
279
279 explicit operator bool() const SPIMPL_NOEXCEPT { return static_cast<bool>(ptr_); }
280 explicit operator bool() const SPIMPL_NOEXCEPT { return static_cast<bool>(ptr_); }
280
281
281 typename std::remove_reference<deleter_type>::type &get_deleter() SPIMPL_NOEXCEPT
282 typename std::remove_reference<deleter_type>::type &get_deleter() SPIMPL_NOEXCEPT
282 {
283 {
283 return ptr_.get_deleter();
284 return ptr_.get_deleter();
284 }
285 }
285 const typename std::remove_reference<deleter_type>::type &get_deleter() const SPIMPL_NOEXCEPT
286 const typename std::remove_reference<deleter_type>::type &get_deleter() const SPIMPL_NOEXCEPT
286 {
287 {
287 return ptr_.get_deleter();
288 return ptr_.get_deleter();
288 }
289 }
289
290
290 typename std::remove_reference<copier_type>::type &get_copier() SPIMPL_NOEXCEPT
291 typename std::remove_reference<copier_type>::type &get_copier() SPIMPL_NOEXCEPT
291 {
292 {
292 return copier_;
293 return copier_;
293 }
294 }
294 const typename std::remove_reference<copier_type>::type &get_copier() const SPIMPL_NOEXCEPT
295 const typename std::remove_reference<copier_type>::type &get_copier() const SPIMPL_NOEXCEPT
295 {
296 {
296 return copier_;
297 return copier_;
297 }
298 }
298
299
299 private:
300 private:
300 unique_ptr_type ptr_;
301 unique_ptr_type ptr_;
301 copier_type copier_;
302 copier_type copier_;
302 };
303 };
303
304
304
305
305 template <class T, class D, class C>
306 template <class T, class D, class C>
306 inline void swap(impl_ptr<T, D, C> &l, impl_ptr<T, D, C> &r) SPIMPL_NOEXCEPT
307 inline void swap(impl_ptr<T, D, C> &l, impl_ptr<T, D, C> &r) SPIMPL_NOEXCEPT
307 {
308 {
308 l.swap(r);
309 l.swap(r);
309 }
310 }
310
311
311
312
312 template <class T1, class D1, class C1, class T2, class D2, class C2>
313 template <class T1, class D1, class C1, class T2, class D2, class C2>
313 inline bool operator==(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
314 inline bool operator==(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
314 {
315 {
315 return l.get() == r.get();
316 return l.get() == r.get();
316 }
317 }
317
318
318 template <class T1, class D1, class C1, class T2, class D2, class C2>
319 template <class T1, class D1, class C1, class T2, class D2, class C2>
319 inline bool operator!=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
320 inline bool operator!=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
320 {
321 {
321 return !(l == r);
322 return !(l == r);
322 }
323 }
323
324
324 template <class T1, class D1, class C1, class T2, class D2, class C2>
325 template <class T1, class D1, class C1, class T2, class D2, class C2>
325 inline bool operator<(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
326 inline bool operator<(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
326 {
327 {
327 using P1 = typename impl_ptr<T1, D1, C1>::pointer;
328 using P1 = typename impl_ptr<T1, D1, C1>::pointer;
328 using P2 = typename impl_ptr<T2, D2, C2>::pointer;
329 using P2 = typename impl_ptr<T2, D2, C2>::pointer;
329 using CT = typename std::common_type<P1, P2>::type;
330 using CT = typename std::common_type<P1, P2>::type;
330 return std::less<CT>()(l.get(), r.get());
331 return std::less<CT>()(l.get(), r.get());
331 }
332 }
332
333
333 template <class T1, class D1, class C1, class T2, class D2, class C2>
334 template <class T1, class D1, class C1, class T2, class D2, class C2>
334 inline bool operator>(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
335 inline bool operator>(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
335 {
336 {
336 return r < l;
337 return r < l;
337 }
338 }
338
339
339 template <class T1, class D1, class C1, class T2, class D2, class C2>
340 template <class T1, class D1, class C1, class T2, class D2, class C2>
340 inline bool operator<=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
341 inline bool operator<=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
341 {
342 {
342 return !(r < l);
343 return !(r < l);
343 }
344 }
344
345
345 template <class T1, class D1, class C1, class T2, class D2, class C2>
346 template <class T1, class D1, class C1, class T2, class D2, class C2>
346 inline bool operator>=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
347 inline bool operator>=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
347 {
348 {
348 return !(l < r);
349 return !(l < r);
349 }
350 }
350
351
351 template <class T, class D, class C>
352 template <class T, class D, class C>
352 inline bool operator==(const impl_ptr<T, D, C> &p, std::nullptr_t) SPIMPL_NOEXCEPT
353 inline bool operator==(const impl_ptr<T, D, C> &p, std::nullptr_t) SPIMPL_NOEXCEPT
353 {
354 {
354 return !p;
355 return !p;
355 }
356 }
356
357
357 template <class T, class D, class C>
358 template <class T, class D, class C>
358 inline bool operator==(std::nullptr_t, const impl_ptr<T, D, C> &p) SPIMPL_NOEXCEPT
359 inline bool operator==(std::nullptr_t, const impl_ptr<T, D, C> &p) SPIMPL_NOEXCEPT
359 {
360 {
360 return !p;
361 return !p;
361 }
362 }
362
363
363 template <class T, class D, class C>
364 template <class T, class D, class C>
364 inline bool operator!=(const impl_ptr<T, D, C> &p, std::nullptr_t) SPIMPL_NOEXCEPT
365 inline bool operator!=(const impl_ptr<T, D, C> &p, std::nullptr_t) SPIMPL_NOEXCEPT
365 {
366 {
366 return static_cast<bool>(p);
367 return static_cast<bool>(p);
367 }
368 }
368
369
369 template <class T, class D, class C>
370 template <class T, class D, class C>
370 inline bool operator!=(std::nullptr_t, const impl_ptr<T, D, C> &p) SPIMPL_NOEXCEPT
371 inline bool operator!=(std::nullptr_t, const impl_ptr<T, D, C> &p) SPIMPL_NOEXCEPT
371 {
372 {
372 return static_cast<bool>(p);
373 return static_cast<bool>(p);
373 }
374 }
374
375
375 template <class T, class D, class C>
376 template <class T, class D, class C>
376 inline bool operator<(const impl_ptr<T, D, C> &l, std::nullptr_t)
377 inline bool operator<(const impl_ptr<T, D, C> &l, std::nullptr_t)
377 {
378 {
378 using P = typename impl_ptr<T, D, C>::pointer;
379 using P = typename impl_ptr<T, D, C>::pointer;
379 return std::less<P>()(l.get(), nullptr);
380 return std::less<P>()(l.get(), nullptr);
380 }
381 }
381
382
382 template <class T, class D, class C>
383 template <class T, class D, class C>
383 inline bool operator<(std::nullptr_t, const impl_ptr<T, D, C> &p)
384 inline bool operator<(std::nullptr_t, const impl_ptr<T, D, C> &p)
384 {
385 {
385 using P = typename impl_ptr<T, D, C>::pointer;
386 using P = typename impl_ptr<T, D, C>::pointer;
386 return std::less<P>()(nullptr, p.get());
387 return std::less<P>()(nullptr, p.get());
387 }
388 }
388
389
389 template <class T, class D, class C>
390 template <class T, class D, class C>
390 inline bool operator>(const impl_ptr<T, D, C> &p, std::nullptr_t)
391 inline bool operator>(const impl_ptr<T, D, C> &p, std::nullptr_t)
391 {
392 {
392 return nullptr < p;
393 return nullptr < p;
393 }
394 }
394
395
395 template <class T, class D, class C>
396 template <class T, class D, class C>
396 inline bool operator>(std::nullptr_t, const impl_ptr<T, D, C> &p)
397 inline bool operator>(std::nullptr_t, const impl_ptr<T, D, C> &p)
397 {
398 {
398 return p < nullptr;
399 return p < nullptr;
399 }
400 }
400
401
401 template <class T, class D, class C>
402 template <class T, class D, class C>
402 inline bool operator<=(const impl_ptr<T, D, C> &p, std::nullptr_t)
403 inline bool operator<=(const impl_ptr<T, D, C> &p, std::nullptr_t)
403 {
404 {
404 return !(nullptr < p);
405 return !(nullptr < p);
405 }
406 }
406
407
407 template <class T, class D, class C>
408 template <class T, class D, class C>
408 inline bool operator<=(std::nullptr_t, const impl_ptr<T, D, C> &p)
409 inline bool operator<=(std::nullptr_t, const impl_ptr<T, D, C> &p)
409 {
410 {
410 return !(p < nullptr);
411 return !(p < nullptr);
411 }
412 }
412
413
413 template <class T, class D, class C>
414 template <class T, class D, class C>
414 inline bool operator>=(const impl_ptr<T, D, C> &p, std::nullptr_t)
415 inline bool operator>=(const impl_ptr<T, D, C> &p, std::nullptr_t)
415 {
416 {
416 return !(p < nullptr);
417 return !(p < nullptr);
417 }
418 }
418
419
419 template <class T, class D, class C>
420 template <class T, class D, class C>
420 inline bool operator>=(std::nullptr_t, const impl_ptr<T, D, C> &p)
421 inline bool operator>=(std::nullptr_t, const impl_ptr<T, D, C> &p)
421 {
422 {
422 return !(nullptr < p);
423 return !(nullptr < p);
423 }
424 }
424
425
425
426
426 template <class T, class... Args>
427 template <class T, class... Args>
427 inline impl_ptr<T> make_impl(Args &&... args)
428 inline impl_ptr<T> make_impl(Args &&... args)
428 {
429 {
429 return impl_ptr<T>(new T(std::forward<Args>(args)...), &details::default_delete<T>,
430 return impl_ptr<T>(new T(std::forward<Args>(args)...), &details::default_delete<T>,
430 &details::default_copy<T>);
431 &details::default_copy<T>);
431 }
432 }
432
433
433
434
434 // Helpers to manage unique impl, stored in std::unique_ptr
435 // Helpers to manage unique impl, stored in std::unique_ptr
435
436
436 template <class T, class Deleter = void (*)(T *)>
437 template <class T, class Deleter = void (*)(T *)>
437 using unique_impl_ptr = std::unique_ptr<T, Deleter>;
438 using unique_impl_ptr = std::unique_ptr<T, Deleter>;
438
439
439 template <class T, class... Args>
440 template <class T, class... Args>
440 inline unique_impl_ptr<T> make_unique_impl(Args &&... args)
441 inline unique_impl_ptr<T> make_unique_impl(Args &&... args)
441 {
442 {
442 static_assert(!std::is_array<T>::value, "unique_impl_ptr does not support arrays");
443 static_assert(!std::is_array<T>::value, "unique_impl_ptr does not support arrays");
443 return unique_impl_ptr<T>(new T(std::forward<Args>(args)...), &details::default_delete<T>);
444 return unique_impl_ptr<T>(new T(std::forward<Args>(args)...), &details::default_delete<T>);
444 }
445 }
445 }
446 }
446
447
447 namespace std {
448 namespace std {
448 template <class T, class D, class C>
449 template <class T, class D, class C>
449 struct hash<spimpl::impl_ptr<T, D, C> > {
450 struct hash<spimpl::impl_ptr<T, D, C> > {
450 using argument_type = spimpl::impl_ptr<T, D, C>;
451 using argument_type = spimpl::impl_ptr<T, D, C>;
451 using result_type = size_t;
452 using result_type = size_t;
452
453
453 result_type operator()(const argument_type &p) const SPIMPL_NOEXCEPT
454 result_type operator()(const argument_type &p) const SPIMPL_NOEXCEPT
454 {
455 {
455 return hash<typename argument_type::pointer>()(p.get());
456 return hash<typename argument_type::pointer>()(p.get());
456 }
457 }
457 };
458 };
458 }
459 }
459
460
460 #endif // SPIMPL_H_
461 #endif // SPIMPL_H_
@@ -1,94 +1,39
1 #ifndef SCIQLOP_DATASOURCECONTROLLER_H
1 #ifndef SCIQLOP_DATASOURCECONTROLLER_H
2 #define SCIQLOP_DATASOURCECONTROLLER_H
2 #define SCIQLOP_DATASOURCECONTROLLER_H
3
3
4 #include "CoreGlobal.h"
4 #include "DataSourceController.h"
5
5
6 #include <QLoggingCategory>
6 #include <QLoggingCategory>
7 #include <QObject>
7 #include <QObject>
8 #include <QUuid>
9
8
10 #include <Common/spimpl.h>
9 #include <Common/spimpl.h>
11
10
12 Q_DECLARE_LOGGING_CATEGORY(LOG_DataSourceController)
11 Q_DECLARE_LOGGING_CATEGORY(LOG_DataSourceController)
13
12
14 class DataSourceItem;
15 class IDataProvider;
16
17 /**
13 /**
18 * @brief The DataSourceController class aims to make the link between SciQlop and its plugins. This
14 * @brief The DataSourceController class aims to make the link between SciQlop
19 * is the intermediate class that SciQlop has to use in the way to connect a data source. Please
15 * and its plugins. This is the intermediate class that SciQlop have to use
20 * first use register method to initialize a plugin specified by its metadata name (JSON plugin
16 * in the way to connect a data source. Please first use load method to intialize
21 * source) then others specifics method will be able to access it. You can load a data source driver
17 * a plugin specified by its metadata name (JSON plugin source) then others specifics
22 * plugin then create a data source.
18 * method will ba able to access it.
19 * You can load a data source driver plugin then create a data source.
23 */
20 */
24 class SCIQLOP_CORE_EXPORT DataSourceController : public QObject {
21 class DataSourceController : public QObject {
25 Q_OBJECT
22 Q_OBJECT
26 public:
23 public:
27 explicit DataSourceController(QObject *parent = 0);
24 explicit DataSourceController(QObject *parent = 0);
28 virtual ~DataSourceController();
25 virtual ~DataSourceController();
29
26
30 /**
31 * Registers a data source. The method delivers a unique id that can be used afterwards to
32 * access to the data source properties (structure, connection parameters, data provider, etc.)
33 * @param dataSourceName the name of the data source
34 * @return the unique id with which the data source has been registered
35 */
36 QUuid registerDataSource(const QString &dataSourceName) noexcept;
37
38 /**
39 * Sets the structure of a data source. The controller takes ownership of the structure.
40 * @param dataSourceUid the unique id with which the data source has been registered into the
41 * controller. If it is invalid, the method has no effect.
42 * @param dataSourceItem the structure of the data source. It must be not null to be registered
43 * @sa registerDataSource()
44 */
45 void setDataSourceItem(const QUuid &dataSourceUid,
46 std::unique_ptr<DataSourceItem> dataSourceItem) noexcept;
47
48 /**
49 * Sets the data provider used to retrieve data from of a data source. The controller takes
50 * ownership of the provider.
51 * @param dataSourceUid the unique id with which the data source has been registered into the
52 * controller. If it is invalid, the method has no effect.
53 * @param dataProvider the provider of the data source
54 * @sa registerDataSource()
55 */
56 void setDataProvider(const QUuid &dataSourceUid,
57 std::unique_ptr<IDataProvider> dataProvider) noexcept;
58
59 /**
60 * Loads an item (product) as a variable in SciQlop
61 * @param dataSourceUid the unique id of the data source containing the item. It is used to get
62 * the data provider associated to the data source, and pass it to for the variable creation
63 * @param productItem the item to load
64 */
65 void loadProductItem(const QUuid &dataSourceUid, const DataSourceItem &productItem) noexcept;
66
67 public slots:
27 public slots:
68 /// Manage init/end of the controller
28 /// Manage init/end of the controller
69 void initialize();
29 void initialize();
70 void finalize();
30 void finalize();
71
31
72 signals:
73 /// Signal emitted when a structure has been set for a data source
74 void dataSourceItemSet(DataSourceItem *dataSourceItem);
75
76 /**
77 * Signal emitted when a variable creation is asked for a product
78 * @param variableName the name of the variable
79 * @param variableMetadata the metadata of the variable
80 * @param variableProvider the provider that will be used to retrieve the data of the variable
81 * (can be null)
82 */
83 void variableCreationRequested(const QString &variableName,
84 const QVariantHash &variableMetadata,
85 std::shared_ptr<IDataProvider> variableProvider);
86
87 private:
32 private:
88 void waitForFinish();
33 void waitForFinish();
89
34
90 class DataSourceControllerPrivate;
35 class DataSourceControllerPrivate;
91 spimpl::unique_impl_ptr<DataSourceControllerPrivate> impl;
36 spimpl::unique_impl_ptr<DataSourceControllerPrivate> impl;
92 };
37 };
93
38
94 #endif // SCIQLOP_DATASOURCECONTROLLER_H
39 #endif // SCIQLOP_DATASOURCECONTROLLER_H
@@ -1,143 +1,45
1 #include "DataSource/DataSourceController.h"
1 #include "DataSource/DataSourceController.h"
2 #include "DataSource/DataSourceItem.h"
3
4 #include <Data/IDataProvider.h>
5
2
6 #include <QMutex>
3 #include <QMutex>
7 #include <QThread>
4 #include <QThread>
8
5
9 #include <QDir>
6 Q_LOGGING_CATEGORY(LOG_DataSourceController, "dataSourceController")
10 #include <QStandardPaths>
11
12 Q_LOGGING_CATEGORY(LOG_DataSourceController, "DataSourceController")
13
14 namespace {
15
16 /**
17 * Builds the metadata of the variable that will be generated from the loading of an item
18 * @param dataSourceItem the data source item from which to generate the metadata
19 * @return the metadata of the variable
20 */
21 QVariantHash variableMetadata(const DataSourceItem &dataSourceItem)
22 {
23 // Variable metadata contains...
24
25 // ... all metadata of the item
26 auto result = dataSourceItem.data();
27
28 // ... and the name of the plugin, recovered from root item
29 result.insert(QStringLiteral("plugin"), dataSourceItem.rootItem().name());
30
31 return result;
32 }
33
34 } // namespace
35
7
36 class DataSourceController::DataSourceControllerPrivate {
8 class DataSourceController::DataSourceControllerPrivate {
37 public:
9 public:
10 DataSourceControllerPrivate() {}
11
38 QMutex m_WorkingMutex;
12 QMutex m_WorkingMutex;
39 /// Data sources registered
40 QHash<QUuid, QString> m_DataSources;
41 /// Data sources structures
42 std::map<QUuid, std::unique_ptr<DataSourceItem> > m_DataSourceItems;
43 /// Data providers registered
44 /// @remarks Data providers are stored as shared_ptr as they can be sent to a variable and
45 /// continue to live without necessarily the data source controller
46 std::map<QUuid, std::shared_ptr<IDataProvider> > m_DataProviders;
47 };
13 };
48
14
49 DataSourceController::DataSourceController(QObject *parent)
15 DataSourceController::DataSourceController(QObject *parent)
50 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
16 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
51 {
17 {
52 qCDebug(LOG_DataSourceController()) << tr("DataSourceController construction")
18 qCDebug(LOG_DataSourceController()) << tr("Construction du DataSourceController")
53 << QThread::currentThread();
19 << QThread::currentThread();
54 }
20 }
55
21
56 DataSourceController::~DataSourceController()
22 DataSourceController::~DataSourceController()
57 {
23 {
58 qCDebug(LOG_DataSourceController()) << tr("DataSourceController destruction")
24 qCDebug(LOG_DataSourceController()) << tr("Desctruction du DataSourceController")
59 << QThread::currentThread();
25 << QThread::currentThread();
60 this->waitForFinish();
26 this->waitForFinish();
61 }
27 }
62
28
63 QUuid DataSourceController::registerDataSource(const QString &dataSourceName) noexcept
64 {
65 auto dataSourceUid = QUuid::createUuid();
66 impl->m_DataSources.insert(dataSourceUid, dataSourceName);
67
68 return dataSourceUid;
69 }
70
71 void DataSourceController::setDataSourceItem(
72 const QUuid &dataSourceUid, std::unique_ptr<DataSourceItem> dataSourceItem) noexcept
73 {
74 if (!dataSourceItem) {
75 qCWarning(LOG_DataSourceController())
76 << tr("Data source item can't be registered (null item)");
77 return;
78 }
79
80 if (impl->m_DataSources.contains(dataSourceUid)) {
81 // The data provider is implicitly converted to a shared_ptr
82 impl->m_DataSourceItems.insert(std::make_pair(dataSourceUid, std::move(dataSourceItem)));
83
84 // Retrieves the data source item to emit the signal with it
85 auto it = impl->m_DataSourceItems.find(dataSourceUid);
86 if (it != impl->m_DataSourceItems.end()) {
87 emit dataSourceItemSet(it->second.get());
88 }
89 }
90 else {
91 qCWarning(LOG_DataSourceController()) << tr("Can't set data source item for uid %1 : no "
92 "data source has been registered with the uid")
93 .arg(dataSourceUid.toString());
94 }
95 }
96
97 void DataSourceController::setDataProvider(const QUuid &dataSourceUid,
98 std::unique_ptr<IDataProvider> dataProvider) noexcept
99 {
100 if (impl->m_DataSources.contains(dataSourceUid)) {
101 impl->m_DataProviders.insert(std::make_pair(dataSourceUid, std::move(dataProvider)));
102 }
103 else {
104 qCWarning(LOG_DataSourceController()) << tr("Can't set data provider for uid %1 : no data "
105 "source has been registered with the uid")
106 .arg(dataSourceUid.toString());
107 }
108 }
109
110 void DataSourceController::loadProductItem(const QUuid &dataSourceUid,
111 const DataSourceItem &productItem) noexcept
112 {
113 if (productItem.type() == DataSourceItemType::PRODUCT
114 || productItem.type() == DataSourceItemType::COMPONENT) {
115 /// Retrieves the data provider of the data source (if any)
116 auto it = impl->m_DataProviders.find(dataSourceUid);
117 auto dataProvider = (it != impl->m_DataProviders.end()) ? it->second : nullptr;
118
119 emit variableCreationRequested(productItem.name(), variableMetadata(productItem),
120 dataProvider);
121 }
122 else {
123 qCWarning(LOG_DataSourceController()) << tr("Can't load an item that is not a product");
124 }
125 }
126
127 void DataSourceController::initialize()
29 void DataSourceController::initialize()
128 {
30 {
129 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init")
31 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController")
130 << QThread::currentThread();
32 << QThread::currentThread();
131 impl->m_WorkingMutex.lock();
33 impl->m_WorkingMutex.lock();
132 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END");
34 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController END");
133 }
35 }
134
36
135 void DataSourceController::finalize()
37 void DataSourceController::finalize()
136 {
38 {
137 impl->m_WorkingMutex.unlock();
39 impl->m_WorkingMutex.unlock();
138 }
40 }
139
41
140 void DataSourceController::waitForFinish()
42 void DataSourceController::waitForFinish()
141 {
43 {
142 QMutexLocker locker{&impl->m_WorkingMutex};
44 QMutexLocker locker(&impl->m_WorkingMutex);
143 }
45 }
@@ -1,138 +1,128
1 #
1 #
2 # use_clangformat.cmake
2 # use_clangformat.cmake
3 #
3 #
4 # The following functions are defined in this document:
4 # The following functions are defined in this document:
5 #
5 #
6
6
7 # ADD_CLANGFORMAT_TARGETS(<globExpression> ...
7 # ADD_CLANGFORMAT_TARGETS(<globExpression> ...
8 # [ADD_TO_ALL]
8 # [ADD_TO_ALL]
9 # [NAME <name>]
9 # [NAME <name>]
10 # [NAME_ALL <nameall>]
10 # [NAME_ALL <nameall>]
11 # [STYLE style]
11 # [STYLE style]
12 # [RECURSE])
12 # [RECURSE])
13 #
13 #
14 # Two custom targets will be created:
14 # Two custom targets will be created:
15 # * format_reports is run as part of the build, and is not rerun unless one of
15 # * format_reports is run as part of the build, and is not rerun unless one of
16 # the file formatted is modified (only created if ADD_TO_ALL is provided);
16 # the file formatted is modified (only created if ADD_TO_ALL is provided);
17 # * format must be explicitely called (make format) and is rerun even if the
17 # * format must be explicitely called (make format) and is rerun even if the
18 # files to format have not been modified. To achieve this behavior, the commands
18 # files to format have not been modified. To achieve this behavior, the commands
19 # used in this target pretend to produce a file without actually producing it.
19 # used in this target pretend to produce a file without actually producing it.
20 # Because the output file is not there after the run, the command will be rerun
20 # Because the output file is not there after the run, the command will be rerun
21 # again at the next target build.
21 # again at the next target build.
22 #
22 #
23 # If ADD_TO_ALL is provided then a target will be added to the default build
23 # If ADD_TO_ALL is provided then a target will be added to the default build
24 # targets so that each time a source file is compiled, it is formatted with
24 # targets so that each time a source file is compiled, it is formatted with
25 # clang-format.
25 # clang-format.
26 #
26 #
27 # NAME and NAME_ALL customize the name of the targets (format and format_reports
27 # NAME and NAME_ALL customize the name of the targets (format and format_reports
28 # by default respectively).
28 # by default respectively).
29 #
29 #
30 # STYLE sets the style used by clang-format (default to "file").
30 # STYLE sets the style used by clang-format (default to "file").
31 #
31 #
32 # RECURSE selects if the glob expressions should be applied recursively or not.
32 # RECURSE selects if the glob expressions should be applied recursively or not.
33 FUNCTION(ADD_CLANGFORMAT_TARGETS)
33 FUNCTION(ADD_CLANGFORMAT_TARGETS)
34 # Default values
34 # Default values
35 SET(target "format")
35 SET(target "format")
36 SET(target_all "format_all")
36 SET(target_all "format_all")
37 SET(style "file")
37 SET(style "file")
38 SET(recurse OFF)
38 SET(recurse OFF)
39 SET(addToAll OFF)
39 SET(addToAll OFF)
40 SET(globs)
40 SET(globs)
41
41
42 # Parse the options
42 # Parse the options
43 MATH(EXPR lastIdx "${ARGC} - 1")
43 MATH(EXPR lastIdx "${ARGC} - 1")
44 SET(i 0)
44 SET(i 0)
45 WHILE(i LESS ${ARGC})
45 WHILE(i LESS ${ARGC})
46 SET(arg "${ARGV${i}}")
46 SET(arg "${ARGV${i}}")
47 IF("${arg}" STREQUAL "ADD_TO_ALL")
47 IF("${arg}" STREQUAL "ADD_TO_ALL")
48 SET(addToAll ON)
48 SET(addToAll ON)
49 ELSEIF("${arg}" STREQUAL "NAME")
49 ELSEIF("${arg}" STREQUAL "NAME")
50 clangformat_incr(i)
50 clangformat_incr(i)
51 SET(target "${ARGV${i}}")
51 SET(target "${ARGV${i}}")
52 ELSEIF("${arg}" STREQUAL "NAME_ALL")
52 ELSEIF("${arg}" STREQUAL "NAME_ALL")
53 clangformat_incr(i)
53 clangformat_incr(i)
54 SET(target_all "${ARGV${i}}")
54 SET(target_all "${ARGV${i}}")
55 ELSEIF("${arg}" STREQUAL "STYLE")
55 ELSEIF("${arg}" STREQUAL "STYLE")
56 clangformat_incr(i)
56 clangformat_incr(i)
57 SET(style "${ARGV${i}}")
57 SET(style "${ARGV${i}}")
58 ELSEIF("${arg}" STREQUAL "RECURSE")
58 ELSEIF("${arg}" STREQUAL "RECURSE")
59 SET(recurse ON)
59 SET(recurse ON)
60 ELSE()
60 ELSE()
61 LIST(APPEND globs ${arg})
61 LIST(APPEND globs ${arg})
62 ENDIF()
62 ENDIF()
63 clangformat_incr(i)
63 clangformat_incr(i)
64 ENDWHILE()
64 ENDWHILE()
65
65
66
67 # Retrieve source files to format
66 # Retrieve source files to format
68 IF(recurse)
67 IF(recurse)
69 FILE(GLOB_RECURSE srcs ${globs})
68 FILE(GLOB_RECURSE srcs ${globs})
70 ELSE()
69 ELSE()
71 FILE(GLOB srcs ${globs})
70 FILE(GLOB srcs ${globs})
72 ENDIF()
71 ENDIF()
73
72
74 IF(NOT CLANGFORMAT_EXECUTABLE)
73 IF(NOT CLANGFORMAT_EXECUTABLE)
75 MESSAGE(FATAL_ERROR "Unable to find clang-format executable")
74 MESSAGE(FATAL_ERROR "Unable to find clang-format executable")
76 ENDIF()
75 ENDIF()
77
76
78 # Format each source file with clang-format
77 # Format each source file with clang-format
79 SET(touchedFiles)
78 SET(touchedFiles)
80 SET(fakedTouchedFiles)
79 SET(fakedTouchedFiles)
81 SET(reportNb 0)
80 SET(reportNb 0)
82 # Create the directory where the touched files will be saved
81 # Create the directory where the touched files will be saved
83 SET(formatDirectory "${CMAKE_CURRENT_BINARY_DIR}/format")
82 SET(formatDirectory "${CMAKE_CURRENT_BINARY_DIR}/format")
84 FILE(MAKE_DIRECTORY ${formatDirectory})
83 FILE(MAKE_DIRECTORY ${formatDirectory})
85 # STRING(REPLACE "*.ui" "" srcs ${srcs})
86 FOREACH(item ${globs})
87 STRING(REGEX MATCH ".*\.ui$" item ${item})
88 IF(item)
89 LIST(APPEND UIS ${item})
90 ENDIF(item)
91 ENDFOREACH(item ${globs})
92
93 LIST(REMOVE_ITEM srcs ${UIS})
94 FOREACH (s ${srcs})
84 FOREACH (s ${srcs})
95 SET(touchedFile ${formatDirectory}/format_touchedfile_${reportNb})
85 SET(touchedFile ${formatDirectory}/format_touchedfile_${reportNb})
96 IF(addToAll)
86 IF(addToAll)
97 ADD_CUSTOM_COMMAND(
87 ADD_CUSTOM_COMMAND(
98 OUTPUT ${touchedFile}
88 OUTPUT ${touchedFile}
99 COMMAND ${CLANGFORMAT_EXECUTABLE}
89 COMMAND ${CLANGFORMAT_EXECUTABLE}
100 -style="${style}"
90 -style="${style}"
101 -i
91 -i
102 ${s}
92 ${s}
103 # Create a file so that this command is executed only if the source
93 # Create a file so that this command is executed only if the source
104 # file is modified
94 # file is modified
105 COMMAND ${CMAKE_COMMAND} -E touch ${touchedFile}
95 COMMAND ${CMAKE_COMMAND} -E touch ${touchedFile}
106 DEPENDS ${s}
96 DEPENDS ${s}
107 COMMENT "Formatting code with clang-format of ${s}"
97 COMMENT "Formatting code with clang-format of ${s}"
108 )
98 )
109 ENDIF()
99 ENDIF()
110
100
111 SET(fakedTouchedFile ${formatDirectory}/format_fakedtouchedfile_${reportNb})
101 SET(fakedTouchedFile ${formatDirectory}/format_fakedtouchedfile_${reportNb})
112 ADD_CUSTOM_COMMAND(
102 ADD_CUSTOM_COMMAND(
113 OUTPUT ${fakedTouchedFile}
103 OUTPUT ${fakedTouchedFile}
114 COMMAND ${CLANGFORMAT_EXECUTABLE}
104 COMMAND ${CLANGFORMAT_EXECUTABLE}
115 -style="${style}"
105 -style="${style}"
116 -i
106 -i
117 ${s}
107 ${s}
118 DEPENDS ${s}
108 DEPENDS ${s}
119 COMMENT "Formatting code with clang-format of ${s}"
109 COMMENT "Formatting code with clang-format of ${s}"
120 )
110 )
121
111
122 LIST(APPEND touchedFiles ${touchedFile})
112 LIST(APPEND touchedFiles ${touchedFile})
123 LIST(APPEND fakedTouchedFiles ${fakedTouchedFile})
113 LIST(APPEND fakedTouchedFiles ${fakedTouchedFile})
124 clangformat_incr(reportNb)
114 clangformat_incr(reportNb)
125 ENDFOREACH()
115 ENDFOREACH()
126
116
127 # Create the custom targets that will trigger the custom command created
117 # Create the custom targets that will trigger the custom command created
128 # previously
118 # previously
129 IF(addToAll)
119 IF(addToAll)
130 ADD_CUSTOM_TARGET(${target_all} ALL DEPENDS ${touchedFiles})
120 ADD_CUSTOM_TARGET(${target_all} ALL DEPENDS ${touchedFiles})
131 ENDIF()
121 ENDIF()
132 ADD_CUSTOM_TARGET(${target} DEPENDS ${fakedTouchedFiles})
122 ADD_CUSTOM_TARGET(${target} DEPENDS ${fakedTouchedFiles})
133
123
134 ENDFUNCTION(ADD_CLANGFORMAT_TARGETS)
124 ENDFUNCTION(ADD_CLANGFORMAT_TARGETS)
135
125
136 macro(clangformat_incr var_name)
126 macro(clangformat_incr var_name)
137 math(EXPR ${var_name} "${${var_name}} + 1")
127 math(EXPR ${var_name} "${${var_name}} + 1")
138 endmacro()
128 endmacro()
@@ -1,169 +1,159
1
1
2 ## gui - CMakeLists.txt
2 ## gui - CMakeLists.txt
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_gui${DEBUG_SUFFIX}")
4 SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_gui${DEBUG_SUFFIX}")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
7 SET(UI_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/ui")
7 SET(UI_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/ui")
8 SET(RES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/resources")
8 SET(RES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/resources")
9
9
10 # Include gui directory
10 # Include gui directory
11 include_directories("${INCLUDES_DIR}")
11 include_directories("${INCLUDES_DIR}")
12 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
12 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
13
13
14 # Set a variable to display a warning in the version files.
14 # Set a variable to display a warning in the version files.
15 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
15 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
16
16
17 #
17 #
18 # Find Qt modules
18 # Find Qt modules
19 #
19 #
20 SCIQLOP_FIND_QT(Core Widgets PrintSupport)
20 SCIQLOP_FIND_QT(Core Widgets)
21
21
22 #
22 #
23 # Find dependent libraries
23 # Find dependent libraries
24 # ========================
24 # ========================
25 find_package(sciqlop-core)
25 find_package(sciqlop-core)
26
26
27 message("Librairies inclues dans APP: ${SCIQLOP-CORE_LIBRARIES}")
27 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
28 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
28
29
29 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
30 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
30
31
31 # Add sqpcore to the list of libraries to use
32 # Add sqpcore to the list of libraries to use
32 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
33 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
33
34
34 # Add dependent shared libraries
35 # Add dependent shared libraries
35 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
36
37
37
38
38 # Ui files
39 # Ui files
39 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
40 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
40
41
41 # Resources files
42 # Resources files
42 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
43 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
43
44
44 #
45 #
45 # Compile the library library
46 # Compile the library library
46 #
47 #
47 FILE (GLOB_RECURSE MODULE_SOURCES
48 FILE (GLOB_RECURSE MODULE_SOURCES
48 ${INCLUDES_DIR}/*.h
49 ${INCLUDES_DIR}/*.h
49 ${SOURCES_DIR}/*.c
50 ${SOURCES_DIR}/*.c
50 ${SOURCES_DIR}/*.cpp
51 ${SOURCES_DIR}/*.cpp
51 ${SOURCES_DIR}/*.h
52 ${SOURCES_DIR}/*.h
52 ${PROJECT_FORMS})
53 ${PROJECT_FORMS})
53
54
54 QT5_ADD_RESOURCES(RCC_HDRS
55 QT5_ADD_RESOURCES(RCC_HDRS
55 ${PROJECT_RESOURCES}
56 ${PROJECT_RESOURCES}
56 )
57 )
57
58
58 QT5_WRAP_UI(UIS_HDRS
59 QT5_WRAP_UI(UIS_HDRS
59 ${PROJECT_FORMS}
60 ${PROJECT_FORMS}
60 )
61 )
61
62
62
63
63 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
64 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
64 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
66 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
66
67
67 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
68 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
68 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets PrintSupport)
69 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets)
69
70
71 INSTALL(TARGETS ${SQPGUI_LIBRARY_NAME}
72 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
73 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
74 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
75 )
76 add_dependencies(${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
77
78
70
79 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
71 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
80 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
72 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
81 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
73 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
82 IF(BUILD_SHARED_LIBS)
74 IF(BUILD_SHARED_LIBS)
83 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
75 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
84 ELSE()
76 ELSE()
85 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
77 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
86 ENDIF()
78 ENDIF()
87
79
88 # Set the variable to parent scope so that the other projects can copy the
80 # Set the variable to parent scope so that the other projects can copy the
89 # dependent shared libraries
81 # dependent shared libraries
90 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
82 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
91
83
92 # Copy extern shared libraries to the lib folder
84 # Copy extern shared libraries to the lib folder
93 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
85 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
94
86
95 # Add the files to the list of files to be analyzed
87 # Add the files to the list of files to be analyzed
96 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
88 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
97 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
89 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
98 # Vera++ exclusion files
90 # Vera++ exclusion files
99 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
91 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
100 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
92 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
101
93
102 #
94 #
103 # Compile the tests
95 # Compile the tests
104 #
96 #
105 IF(BUILD_TESTS)
97 IF(BUILD_TESTS)
106 INCLUDE_DIRECTORIES(${SOURCES_DIR})
98 INCLUDE_DIRECTORIES(${SOURCES_DIR})
107 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
99 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
108 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
100 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
109 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
101 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
110
102
111 FOREACH( testFile ${TESTS_SOURCES} )
103 FOREACH( testFile ${TESTS_SOURCES} )
112 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
104 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
113 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
105 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
114
106
115 # Add to the list of sources files all the sources in the same
107 # Add to the list of sources files all the sources in the same
116 # directory that aren't another test
108 # directory that aren't another test
117 FILE (GLOB currentTestSources
109 FILE (GLOB currentTestSources
118 ${testDirectory}/*.c
110 ${testDirectory}/*.c
119 ${testDirectory}/*.cpp
111 ${testDirectory}/*.cpp
120 ${testDirectory}/*.h)
112 ${testDirectory}/*.h)
121 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
113 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
122 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
114 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
123
115
124 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
116 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
125 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
126 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
127 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
117 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
128 qt5_use_modules(${testName} Test)
118 qt5_use_modules(${testName} Test)
129
119
130 ADD_TEST( NAME ${testName} COMMAND ${testName} )
120 ADD_TEST( NAME ${testName} COMMAND ${testName} )
131
121
132 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
122 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
133 ENDFOREACH( testFile )
123 ENDFOREACH( testFile )
134
124
135 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
125 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
136 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
126 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
137 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
127 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
138 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
128 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
139 ENDIF(BUILD_TESTS)
129 ENDIF(BUILD_TESTS)
140
130
141 #
131 #
142 # Set the files that must be formatted by clang-format.
132 # Set the files that must be formatted by clang-format.
143 #
133 #
144 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
134 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
145 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
135 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
146
136
147 #
137 #
148 # Set the directories that doxygen must browse to generate the
138 # Set the directories that doxygen must browse to generate the
149 # documentation.
139 # documentation.
150 #
140 #
151 # Source directories:
141 # Source directories:
152 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
142 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
153 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
143 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
154 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
144 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
155 # Source directories to exclude from the documentation generation
145 # Source directories to exclude from the documentation generation
156 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
146 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
157 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
147 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
158
148
159 #
149 #
160 # Set the directories with the sources to analyze and propagate the
150 # Set the directories with the sources to analyze and propagate the
161 # modification to the parent scope
151 # modification to the parent scope
162 #
152 #
163 # Source directories to analyze:
153 # Source directories to analyze:
164 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
154 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
165 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
155 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
166 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
156 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
167 # Source directories to exclude from the analysis
157 # Source directories to exclude from the analysis
168 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
158 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
169 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
159 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,52 +1,33
1 #ifndef SCIQLOP_SQPAPPLICATION_H
1 #ifndef SCIQLOP_SQPAPPLICATION_H
2 #define SCIQLOP_SQPAPPLICATION_H
2 #define SCIQLOP_SQPAPPLICATION_H
3
3
4 #include "SqpApplication.h"
4 #include "SqpApplication.h"
5
5
6 #include <QApplication>
6 #include <QApplication>
7 #include <QLoggingCategory>
7 #include <QLoggingCategory>
8
8
9 #include <Common/spimpl.h>
9 #include <Common/spimpl.h>
10
10
11 Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication)
11 Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication)
12
12
13 #if defined(sqpApp)
14 #undef sqpApp
15 #endif
16 #define sqpApp (static_cast<SqpApplication *>(QCoreApplication::instance()))
17
18 class DataSourceController;
19 class NetworkController;
20 class TimeController;
21 class VariableController;
22 class VisualizationController;
23
24 /**
13 /**
25 * @brief The SqpApplication class aims to make the link between SciQlop
14 * @brief The SqpApplication class aims to make the link between SciQlop
26 * and its plugins. This is the intermediate class that SciQlop has to use
15 * and its plugins. This is the intermediate class that SciQlop have to use
27 * in the way to connect a data source. Please first use load method to initialize
16 * in the way to connect a data source. Please first use load method to intialize
28 * a plugin specified by its metadata name (JSON plugin source) then others specifics
17 * a plugin specified by its metadata name (JSON plugin source) then others specifics
29 * method will be able to access it.
18 * method will ba able to access it.
30 * You can load a data source driver plugin then create a data source.
19 * You can load a data source driver plugin then create a data source.
31 */
20 */
32
33 class SqpApplication : public QApplication {
21 class SqpApplication : public QApplication {
34 Q_OBJECT
22 Q_OBJECT
35 public:
23 public:
36 explicit SqpApplication(int &argc, char **argv);
24 explicit SqpApplication(int &argc, char **argv);
37 virtual ~SqpApplication();
25 virtual ~SqpApplication();
38 void initialize();
26 void initialize();
39
27
40 /// Accessors for the differents sciqlop controllers
41 DataSourceController &dataSourceController() noexcept;
42 NetworkController &networkController() noexcept;
43 TimeController &timeController() noexcept;
44 VariableController &variableController() noexcept;
45 VisualizationController &visualizationController() noexcept;
46
47 private:
28 private:
48 class SqpApplicationPrivate;
29 class SqpApplicationPrivate;
49 spimpl::unique_impl_ptr<SqpApplicationPrivate> impl;
30 spimpl::unique_impl_ptr<SqpApplicationPrivate> impl;
50 };
31 };
51
32
52 #endif // SCIQLOP_SQPAPPLICATION_H
33 #endif // SCIQLOP_SQPAPPLICATION_H
@@ -1,150 +1,46
1 #include "SqpApplication.h"
1 #include "SqpApplication.h"
2
2
3 #include <Data/IDataProvider.h>
4 #include <DataSource/DataSourceController.h>
3 #include <DataSource/DataSourceController.h>
5 #include <Network/NetworkController.h>
6 #include <QThread>
4 #include <QThread>
7 #include <Time/TimeController.h>
8 #include <Variable/Variable.h>
9 #include <Variable/VariableController.h>
10 #include <Visualization/VisualizationController.h>
11
5
12 Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
6 Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
13
7
14 class SqpApplication::SqpApplicationPrivate {
8 class SqpApplication::SqpApplicationPrivate {
15 public:
9 public:
16 SqpApplicationPrivate()
10 SqpApplicationPrivate() {}
17 : m_DataSourceController{std::make_unique<DataSourceController>()},
11 ~SqpApplicationPrivate()
18 m_NetworkController{std::make_unique<NetworkController>()},
19 m_TimeController{std::make_unique<TimeController>()},
20 m_VariableController{std::make_unique<VariableController>()},
21 m_VisualizationController{std::make_unique<VisualizationController>()}
22 {
23 // /////////////////////////////// //
24 // Connections between controllers //
25 // /////////////////////////////// //
26
27 // VariableController <-> DataSourceController
28 connect(m_DataSourceController.get(),
29 SIGNAL(variableCreationRequested(const QString &, const QVariantHash &,
30 std::shared_ptr<IDataProvider>)),
31 m_VariableController.get(),
32 SLOT(createVariable(const QString &, const QVariantHash &,
33 std::shared_ptr<IDataProvider>)));
34
35 // VariableController <-> VisualizationController
36 connect(m_VariableController.get(),
37 SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)),
38 m_VisualizationController.get(),
39 SIGNAL(variableAboutToBeDeleted(std::shared_ptr<Variable>)), Qt::DirectConnection);
40
41 connect(m_VariableController.get(),
42 SIGNAL(rangeChanged(std::shared_ptr<Variable>, const SqpRange &)),
43 m_VisualizationController.get(),
44 SIGNAL(rangeChanged(std::shared_ptr<Variable>, const SqpRange &)));
45
46
47 m_DataSourceController->moveToThread(&m_DataSourceControllerThread);
48 m_DataSourceControllerThread.setObjectName("DataSourceControllerThread");
49 m_NetworkController->moveToThread(&m_NetworkControllerThread);
50 m_NetworkControllerThread.setObjectName("NetworkControllerThread");
51 m_VariableController->moveToThread(&m_VariableControllerThread);
52 m_VariableControllerThread.setObjectName("VariableControllerThread");
53 m_VisualizationController->moveToThread(&m_VisualizationControllerThread);
54 m_VisualizationControllerThread.setObjectName("VsualizationControllerThread");
55
56
57 // Additionnal init
58 m_VariableController->setTimeController(m_TimeController.get());
59 }
60
61 virtual ~SqpApplicationPrivate()
62 {
12 {
13 qCInfo(LOG_SqpApplication()) << tr("Desctruction du SqpApplicationPrivate");
14 ;
63 m_DataSourceControllerThread.quit();
15 m_DataSourceControllerThread.quit();
64 m_DataSourceControllerThread.wait();
16 m_DataSourceControllerThread.wait();
65
66 m_NetworkControllerThread.quit();
67 m_NetworkControllerThread.wait();
68
69 m_VariableControllerThread.quit();
70 m_VariableControllerThread.wait();
71
72 m_VisualizationControllerThread.quit();
73 m_VisualizationControllerThread.wait();
74 }
17 }
75
18
76 std::unique_ptr<DataSourceController> m_DataSourceController;
19 std::unique_ptr<DataSourceController> m_DataSourceController;
77 std::unique_ptr<VariableController> m_VariableController;
78 std::unique_ptr<TimeController> m_TimeController;
79 std::unique_ptr<NetworkController> m_NetworkController;
80 std::unique_ptr<VisualizationController> m_VisualizationController;
81 QThread m_DataSourceControllerThread;
20 QThread m_DataSourceControllerThread;
82 QThread m_NetworkControllerThread;
83 QThread m_VariableControllerThread;
84 QThread m_VisualizationControllerThread;
85 };
21 };
86
22
87
23
88 SqpApplication::SqpApplication(int &argc, char **argv)
24 SqpApplication::SqpApplication(int &argc, char **argv)
89 : QApplication{argc, argv}, impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
25 : QApplication(argc, argv), impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
90 {
26 {
91 qCDebug(LOG_SqpApplication()) << tr("SqpApplication construction") << QThread::currentThread();
27 qCInfo(LOG_SqpApplication()) << tr("Construction du SqpApplication");
28
29 impl->m_DataSourceController = std::make_unique<DataSourceController>();
30 impl->m_DataSourceController->moveToThread(&impl->m_DataSourceControllerThread);
92
31
93 connect(&impl->m_DataSourceControllerThread, &QThread::started,
32 connect(&impl->m_DataSourceControllerThread, &QThread::started,
94 impl->m_DataSourceController.get(), &DataSourceController::initialize);
33 impl->m_DataSourceController.get(), &DataSourceController::initialize);
95 connect(&impl->m_DataSourceControllerThread, &QThread::finished,
34 connect(&impl->m_DataSourceControllerThread, &QThread::finished,
96 impl->m_DataSourceController.get(), &DataSourceController::finalize);
35 impl->m_DataSourceController.get(), &DataSourceController::finalize);
97
36
98 connect(&impl->m_NetworkControllerThread, &QThread::started, impl->m_NetworkController.get(),
99 &NetworkController::initialize);
100 connect(&impl->m_NetworkControllerThread, &QThread::finished, impl->m_NetworkController.get(),
101 &NetworkController::finalize);
102
103 connect(&impl->m_VariableControllerThread, &QThread::started, impl->m_VariableController.get(),
104 &VariableController::initialize);
105 connect(&impl->m_VariableControllerThread, &QThread::finished, impl->m_VariableController.get(),
106 &VariableController::finalize);
107
108 connect(&impl->m_VisualizationControllerThread, &QThread::started,
109 impl->m_VisualizationController.get(), &VisualizationController::initialize);
110 connect(&impl->m_VisualizationControllerThread, &QThread::finished,
111 impl->m_VisualizationController.get(), &VisualizationController::finalize);
112
113 impl->m_DataSourceControllerThread.start();
37 impl->m_DataSourceControllerThread.start();
114 impl->m_NetworkControllerThread.start();
115 impl->m_VariableControllerThread.start();
116 impl->m_VisualizationControllerThread.start();
117 }
38 }
118
39
119 SqpApplication::~SqpApplication()
40 SqpApplication::~SqpApplication()
120 {
41 {
121 }
42 }
122
43
123 void SqpApplication::initialize()
44 void SqpApplication::initialize()
124 {
45 {
125 }
46 }
126
127 DataSourceController &SqpApplication::dataSourceController() noexcept
128 {
129 return *impl->m_DataSourceController;
130 }
131
132 NetworkController &SqpApplication::networkController() noexcept
133 {
134 return *impl->m_NetworkController;
135 }
136
137 TimeController &SqpApplication::timeController() noexcept
138 {
139 return *impl->m_TimeController;
140 }
141
142 VariableController &SqpApplication::variableController() noexcept
143 {
144 return *impl->m_VariableController;
145 }
146
147 VisualizationController &SqpApplication::visualizationController() noexcept
148 {
149 return *impl->m_VisualizationController;
150 }
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (674 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (842 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (636 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (7219 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed, binary diff hidden
NO CONTENT: file was removed, binary diff hidden
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (31403 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (22288 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (29129 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (10802 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
This diff has been collapsed as it changes many lines, (360000 lines changed) Show them Hide them
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 4
Under Review
author

Auto status change to "Under Review"

note
author

ok

Approved
author

Status change > Approved

note
author

Pull request merged and closed