##// END OF EJS Templates
Merge pull request 131 from SCIQLOP-Initialisation feature/InitDataSourceController...
perrinel -
r23:73015bd6234f merge
parent child
Show More
@@ -0,0 +1,21
1 # - Try to find sciqlop-core
2 # Once done this will define
3 # SCIQLOP-CORE_FOUND - System has sciqlop-core
4 # SCIQLOP-CORE_INCLUDE_DIR - The sciqlop-core include directories
5 # SCIQLOP-CORE_LIBRARIES - The libraries needed to use sciqlop-core
6
7 if(SCIQLOP-CORE_FOUND)
8 return()
9 endif(SCIQLOP-CORE_FOUND)
10
11 set(SCIQLOP-CORE_INCLUDE_DIR ${sciqlop-core_DIR}/../include)
12
13 set (OS_LIB_EXTENSION "so")
14
15 if(WIN32)
16 set (OS_LIB_EXTENSION "dll")
17 endif(WIN32)
18 # TODO: Add Mac Support
19 set(SCIQLOP-CORE_LIBRARIES ${LIBRARY_OUTPUT_PATH}/libsciqlop_core${DEBUG_SUFFIX}.${OS_LIB_EXTENSION})
20
21 set(SCIQLOP-CORE_FOUND TRUE)
@@ -0,0 +1,461
1 /*
2 ====================================================================
3 A Smart Pointer to IMPLementation (i.e. Smart PIMPL or just SPIMPL).
4 ====================================================================
5
6 Version: 1.1
7
8 Latest version:
9 https://github.com/oliora/samples/blob/master/spimpl.h
10 Rationale and description:
11 http://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html
12
13 Copyright (c) 2015 Andrey Upadyshev (oliora@gmail.com)
14
15 Distributed under the Boost Software License, Version 1.0.
16 See http://www.boost.org/LICENSE_1_0.txt
17
18 Changes history
19 ---------------
20 v1.1:
21 - auto_ptr support is disabled by default for C++17 compatibility
22 v1.0:
23 - Released
24 */
25
26 #ifndef SPIMPL_H_
27 #define SPIMPL_H_
28
29 #include <cassert>
30 #include <memory>
31 #include <type_traits>
32
33
34 #if defined _MSC_VER && _MSC_VER < 1900 // MS Visual Studio before VS2015
35 #define SPIMPL_NO_CPP11_NOEXCEPT
36 #define SPIMPL_NO_CPP11_CONSTEXPR
37 #define SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
38 #endif
39
40 #if !defined SPIMPL_NO_CPP11_NOEXCEPT
41 #define SPIMPL_NOEXCEPT noexcept
42 #else
43 #define SPIMPL_NOEXCEPT
44 #endif
45
46 #if !defined SPIMPL_NO_CPP11_CONSTEXPR
47 #define SPIMPL_CONSTEXPR constexpr
48 #else
49 #define SPIMPL_CONSTEXPR
50 #endif
51
52 // define SPIMPL_HAS_AUTO_PTR to enable constructor and assignment operator that accept
53 // std::auto_ptr
54 // TODO: auto detect std::auto_ptr support
55
56
57 namespace spimpl {
58 namespace details {
59 template <class T>
60 T *default_copy(T *src)
61 {
62 static_assert(sizeof(T) > 0, "default_copy cannot copy incomplete type");
63 static_assert(!std::is_void<T>::value, "default_copy cannot copy incomplete type");
64 return new T(*src);
65 }
66
67 template <class T>
68 void default_delete(T *p) SPIMPL_NOEXCEPT
69 {
70 static_assert(sizeof(T) > 0, "default_delete cannot delete incomplete type");
71 static_assert(!std::is_void<T>::value, "default_delete cannot delete incomplete type");
72 delete p;
73 }
74
75 template <class T>
76 struct default_deleter {
77 using type = void (*)(T *);
78 };
79
80 template <class T>
81 using default_deleter_t = typename default_deleter<T>::type;
82
83 template <class T>
84 struct default_copier {
85 using type = T *(*)(T *);
86 };
87
88 template <class T>
89 using default_copier_t = typename default_copier<T>::type;
90
91 template <class T, class D, class C>
92 struct is_default_manageable
93 : public std::integral_constant<bool, std::is_same<D, default_deleter_t<T> >::value
94 && std::is_same<C, default_copier_t<T> >::value> {
95 };
96 }
97
98
99 template <class T, class Deleter = details::default_deleter_t<T>,
100 class Copier = details::default_copier_t<T> >
101 class impl_ptr {
102 private:
103 static_assert(!std::is_array<T>::value,
104 "impl_ptr specialization for arrays is not implemented");
105 struct dummy_t_ {
106 int dummy__;
107 };
108
109 public:
110 using pointer = T *;
111 using element_type = T;
112 using copier_type = typename std::decay<Copier>::type;
113 using deleter_type = typename std::decay<Deleter>::type;
114 using unique_ptr_type = std::unique_ptr<T, deleter_type>;
115 using is_default_manageable = details::is_default_manageable<T, deleter_type, copier_type>;
116
117 SPIMPL_CONSTEXPR impl_ptr() SPIMPL_NOEXCEPT : ptr_(nullptr, deleter_type{}),
118 copier_(copier_type{})
119 {
120 }
121
122 SPIMPL_CONSTEXPR impl_ptr(std::nullptr_t) SPIMPL_NOEXCEPT : impl_ptr() {}
123
124 template <class D, class C>
125 impl_ptr(pointer p, D &&d, C &&c,
126 typename std::enable_if<std::is_convertible<D, deleter_type>::value
127 && std::is_convertible<C, copier_type>::value,
128 dummy_t_>::type
129 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(p), std::forward<D>(d)),
130 copier_(std::forward<C>(c))
131 {
132 }
133
134 template <class U>
135 impl_ptr(U *u, typename std::enable_if<std::is_convertible<U *, pointer>::value
136 && is_default_manageable::value,
137 dummy_t_>::type
138 = dummy_t_()) SPIMPL_NOEXCEPT
139 : impl_ptr(u, &details::default_delete<T>, &details::default_copy<T>)
140 {
141 }
142
143 impl_ptr(const impl_ptr &r) : impl_ptr(r.clone()) {}
144
145 #ifndef SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
146 impl_ptr(impl_ptr &&r) SPIMPL_NOEXCEPT = default;
147 #else
148 impl_ptr(impl_ptr &&r) SPIMPL_NOEXCEPT : ptr_(std::move(r.ptr_)), copier_(std::move(r.copier_))
149 {
150 }
151 #endif
152
153 #ifdef SPIMPL_HAS_AUTO_PTR
154 template <class U>
155 impl_ptr(std::auto_ptr<U> &&u, typename std::enable_if<std::is_convertible<U *, pointer>::value
156 && is_default_manageable::value,
157 dummy_t_>::type
158 = dummy_t_()) SPIMPL_NOEXCEPT
159 : ptr_(u.release(), &details::default_delete<T>),
160 copier_(&details::default_copy<T>)
161 {
162 }
163 #endif
164
165 template <class U>
166 impl_ptr(std::unique_ptr<U> &&u,
167 typename std::enable_if<std::is_convertible<U *, pointer>::value
168 && is_default_manageable::value,
169 dummy_t_>::type
170 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete<T>),
171 copier_(&details::default_copy<T>)
172 {
173 }
174
175 template <class U, class D, class C>
176 impl_ptr(std::unique_ptr<U, D> &&u, C &&c,
177 typename std::enable_if<std::is_convertible<U *, pointer>::value
178 && std::is_convertible<D, deleter_type>::value
179 && std::is_convertible<C, copier_type>::value,
180 dummy_t_>::type
181 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(u)),
182 copier_(std::forward<C>(c))
183 {
184 }
185
186 template <class U, class D, class C>
187 impl_ptr(impl_ptr<U, D, C> &&u,
188 typename std::enable_if<std::is_convertible<U *, pointer>::value
189 && std::is_convertible<D, deleter_type>::value
190 && std::is_convertible<C, copier_type>::value,
191 dummy_t_>::type
192 = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(std::move(u.ptr_)),
193 copier_(std::move(u.copier_))
194 {
195 }
196
197 impl_ptr &operator=(const impl_ptr &r)
198 {
199 if (this == &r)
200 return *this;
201
202 return operator=(r.clone());
203 }
204
205 #ifndef SPIMPL_NO_CPP11_DEFAULT_MOVE_SPEC_FUNC
206 impl_ptr &operator=(impl_ptr &&r) SPIMPL_NOEXCEPT = default;
207 #else
208 impl_ptr &operator=(impl_ptr &&r) SPIMPL_NOEXCEPT
209 {
210 ptr_ = std::move(r.ptr_);
211 copier_ = std::move(r.copier_);
212 return *this;
213 }
214 #endif
215
216 template <class U, class D, class C>
217 typename std::enable_if<std::is_convertible<U *, pointer>::value
218 && std::is_convertible<D, deleter_type>::value
219 && std::is_convertible<C, copier_type>::value,
220 impl_ptr &>::type
221 operator=(impl_ptr<U, D, C> &&u) SPIMPL_NOEXCEPT
222 {
223 ptr_ = std::move(u.ptr_);
224 copier_ = std::move(u.copier_);
225 return *this;
226 }
227
228 template <class U, class D, class C>
229 typename std::enable_if<std::is_convertible<U *, pointer>::value
230 && std::is_convertible<D, deleter_type>::value
231 && std::is_convertible<C, copier_type>::value,
232 impl_ptr &>::type
233 operator=(const impl_ptr<U, D, C> &u)
234 {
235 return operator=(u.clone());
236 }
237
238 //
239
240 #ifdef SPIMPL_HAS_AUTO_PTR
241 template <class U>
242 typename std::enable_if<std::is_convertible<U *, pointer>::value
243 && is_default_manageable::value,
244 impl_ptr &>::type
245 operator=(std::auto_ptr<U> &&u) SPIMPL_NOEXCEPT
246 {
247 return operator=(impl_ptr(std::move(u)));
248 }
249 #endif
250
251 template <class U>
252 typename std::enable_if<std::is_convertible<U *, pointer>::value
253 && is_default_manageable::value,
254 impl_ptr &>::type
255 operator=(std::unique_ptr<U> &&u) SPIMPL_NOEXCEPT
256 {
257 return operator=(impl_ptr(std::move(u)));
258 }
259
260 impl_ptr clone() const
261 {
262 return impl_ptr(ptr_ ? copier_(ptr_.get()) : nullptr, ptr_.get_deleter(), copier_);
263 }
264
265 typename std::remove_reference<T>::type &operator*() const { return *ptr_; }
266 pointer operator->() const SPIMPL_NOEXCEPT { return get(); }
267 pointer get() const SPIMPL_NOEXCEPT { return ptr_.get(); }
268
269 void swap(impl_ptr &u) SPIMPL_NOEXCEPT
270 {
271 using std::swap;
272 ptr_.swap(u.ptr_);
273 swap(copier_, u.copier_);
274 }
275
276 pointer release() SPIMPL_NOEXCEPT { return ptr_.release(); }
277
278 unique_ptr_type release_unique() SPIMPL_NOEXCEPT { return std::move(ptr_); }
279
280 explicit operator bool() const SPIMPL_NOEXCEPT { return static_cast<bool>(ptr_); }
281
282 typename std::remove_reference<deleter_type>::type &get_deleter() SPIMPL_NOEXCEPT
283 {
284 return ptr_.get_deleter();
285 }
286 const typename std::remove_reference<deleter_type>::type &get_deleter() const SPIMPL_NOEXCEPT
287 {
288 return ptr_.get_deleter();
289 }
290
291 typename std::remove_reference<copier_type>::type &get_copier() SPIMPL_NOEXCEPT
292 {
293 return copier_;
294 }
295 const typename std::remove_reference<copier_type>::type &get_copier() const SPIMPL_NOEXCEPT
296 {
297 return copier_;
298 }
299
300 private:
301 unique_ptr_type ptr_;
302 copier_type copier_;
303 };
304
305
306 template <class T, class D, class C>
307 inline void swap(impl_ptr<T, D, C> &l, impl_ptr<T, D, C> &r) SPIMPL_NOEXCEPT
308 {
309 l.swap(r);
310 }
311
312
313 template <class T1, class D1, class C1, class T2, class D2, class C2>
314 inline bool operator==(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
315 {
316 return l.get() == r.get();
317 }
318
319 template <class T1, class D1, class C1, class T2, class D2, class C2>
320 inline bool operator!=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
321 {
322 return !(l == r);
323 }
324
325 template <class T1, class D1, class C1, class T2, class D2, class C2>
326 inline bool operator<(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
327 {
328 using P1 = typename impl_ptr<T1, D1, C1>::pointer;
329 using P2 = typename impl_ptr<T2, D2, C2>::pointer;
330 using CT = typename std::common_type<P1, P2>::type;
331 return std::less<CT>()(l.get(), r.get());
332 }
333
334 template <class T1, class D1, class C1, class T2, class D2, class C2>
335 inline bool operator>(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
336 {
337 return r < l;
338 }
339
340 template <class T1, class D1, class C1, class T2, class D2, class C2>
341 inline bool operator<=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
342 {
343 return !(r < l);
344 }
345
346 template <class T1, class D1, class C1, class T2, class D2, class C2>
347 inline bool operator>=(const impl_ptr<T1, D1, C1> &l, const impl_ptr<T2, D2, C2> &r)
348 {
349 return !(l < r);
350 }
351
352 template <class T, class D, class C>
353 inline bool operator==(const impl_ptr<T, D, C> &p, std::nullptr_t) SPIMPL_NOEXCEPT
354 {
355 return !p;
356 }
357
358 template <class T, class D, class C>
359 inline bool operator==(std::nullptr_t, const impl_ptr<T, D, C> &p) SPIMPL_NOEXCEPT
360 {
361 return !p;
362 }
363
364 template <class T, class D, class C>
365 inline bool operator!=(const impl_ptr<T, D, C> &p, std::nullptr_t) SPIMPL_NOEXCEPT
366 {
367 return static_cast<bool>(p);
368 }
369
370 template <class T, class D, class C>
371 inline bool operator!=(std::nullptr_t, const impl_ptr<T, D, C> &p) SPIMPL_NOEXCEPT
372 {
373 return static_cast<bool>(p);
374 }
375
376 template <class T, class D, class C>
377 inline bool operator<(const impl_ptr<T, D, C> &l, std::nullptr_t)
378 {
379 using P = typename impl_ptr<T, D, C>::pointer;
380 return std::less<P>()(l.get(), nullptr);
381 }
382
383 template <class T, class D, class C>
384 inline bool operator<(std::nullptr_t, const impl_ptr<T, D, C> &p)
385 {
386 using P = typename impl_ptr<T, D, C>::pointer;
387 return std::less<P>()(nullptr, p.get());
388 }
389
390 template <class T, class D, class C>
391 inline bool operator>(const impl_ptr<T, D, C> &p, std::nullptr_t)
392 {
393 return nullptr < p;
394 }
395
396 template <class T, class D, class C>
397 inline bool operator>(std::nullptr_t, const impl_ptr<T, D, C> &p)
398 {
399 return p < nullptr;
400 }
401
402 template <class T, class D, class C>
403 inline bool operator<=(const impl_ptr<T, D, C> &p, std::nullptr_t)
404 {
405 return !(nullptr < p);
406 }
407
408 template <class T, class D, class C>
409 inline bool operator<=(std::nullptr_t, const impl_ptr<T, D, C> &p)
410 {
411 return !(p < nullptr);
412 }
413
414 template <class T, class D, class C>
415 inline bool operator>=(const impl_ptr<T, D, C> &p, std::nullptr_t)
416 {
417 return !(p < nullptr);
418 }
419
420 template <class T, class D, class C>
421 inline bool operator>=(std::nullptr_t, const impl_ptr<T, D, C> &p)
422 {
423 return !(nullptr < p);
424 }
425
426
427 template <class T, class... Args>
428 inline impl_ptr<T> make_impl(Args &&... args)
429 {
430 return impl_ptr<T>(new T(std::forward<Args>(args)...), &details::default_delete<T>,
431 &details::default_copy<T>);
432 }
433
434
435 // Helpers to manage unique impl, stored in std::unique_ptr
436
437 template <class T, class Deleter = void (*)(T *)>
438 using unique_impl_ptr = std::unique_ptr<T, Deleter>;
439
440 template <class T, class... Args>
441 inline unique_impl_ptr<T> make_unique_impl(Args &&... args)
442 {
443 static_assert(!std::is_array<T>::value, "unique_impl_ptr does not support arrays");
444 return unique_impl_ptr<T>(new T(std::forward<Args>(args)...), &details::default_delete<T>);
445 }
446 }
447
448 namespace std {
449 template <class T, class D, class C>
450 struct hash<spimpl::impl_ptr<T, D, C> > {
451 using argument_type = spimpl::impl_ptr<T, D, C>;
452 using result_type = size_t;
453
454 result_type operator()(const argument_type &p) const SPIMPL_NOEXCEPT
455 {
456 return hash<typename argument_type::pointer>()(p.get());
457 }
458 };
459 }
460
461 #endif // SPIMPL_H_
@@ -0,0 +1,39
1 #ifndef SCIQLOP_DATASOURCECONTROLLER_H
2 #define SCIQLOP_DATASOURCECONTROLLER_H
3
4 #include "DataSourceController.h"
5
6 #include <QLoggingCategory>
7 #include <QObject>
8
9 #include <Common/spimpl.h>
10
11 Q_DECLARE_LOGGING_CATEGORY(LOG_DataSourceController)
12
13 /**
14 * @brief The DataSourceController class aims to make the link between SciQlop
15 * and its plugins. This is the intermediate class that SciQlop have to use
16 * in the way to connect a data source. Please first use load method to intialize
17 * a plugin specified by its metadata name (JSON plugin source) then others specifics
18 * method will ba able to access it.
19 * You can load a data source driver plugin then create a data source.
20 */
21 class DataSourceController : public QObject {
22 Q_OBJECT
23 public:
24 explicit DataSourceController(QObject *parent = 0);
25 virtual ~DataSourceController();
26
27 public slots:
28 /// Manage init/end of the controller
29 void initialize();
30 void finalize();
31
32 private:
33 void waitForFinish();
34
35 class DataSourceControllerPrivate;
36 spimpl::unique_impl_ptr<DataSourceControllerPrivate> impl;
37 };
38
39 #endif // SCIQLOP_DATASOURCECONTROLLER_H
@@ -0,0 +1,45
1 #include "DataSource/DataSourceController.h"
2
3 #include <QMutex>
4 #include <QThread>
5
6 Q_LOGGING_CATEGORY(LOG_DataSourceController, "dataSourceController")
7
8 class DataSourceController::DataSourceControllerPrivate {
9 public:
10 DataSourceControllerPrivate() {}
11
12 QMutex m_WorkingMutex;
13 };
14
15 DataSourceController::DataSourceController(QObject *parent)
16 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
17 {
18 qCDebug(LOG_DataSourceController()) << tr("Construction du DataSourceController")
19 << QThread::currentThread();
20 }
21
22 DataSourceController::~DataSourceController()
23 {
24 qCDebug(LOG_DataSourceController()) << tr("Desctruction du DataSourceController")
25 << QThread::currentThread();
26 this->waitForFinish();
27 }
28
29 void DataSourceController::initialize()
30 {
31 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController")
32 << QThread::currentThread();
33 impl->m_WorkingMutex.lock();
34 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController END");
35 }
36
37 void DataSourceController::finalize()
38 {
39 impl->m_WorkingMutex.unlock();
40 }
41
42 void DataSourceController::waitForFinish()
43 {
44 QMutexLocker locker(&impl->m_WorkingMutex);
45 }
@@ -0,0 +1,21
1 # - Try to find sciqlop-gui
2 # Once done this will define
3 # SCIQLOP-GUI_FOUND - System has sciqlop-gui
4 # SCIQLOP-GUI_INCLUDE_DIR - The sciqlop-gui include directories
5 # SCIQLOP-GUI_LIBRARIES - The libraries needed to use sciqlop-gui
6
7 if(SCIQLOP-GUI_FOUND)
8 return()
9 endif(SCIQLOP-GUI_FOUND)
10
11 set(SCIQLOP-GUI_INCLUDE_DIR ${sciqlop-gui_DIR}/../include)
12
13 set (OS_LIB_EXTENSION "so")
14
15 if(WIN32)
16 set (OS_LIB_EXTENSION "dll")
17 endif(WIN32)
18 # TODO: Add Mac Support
19 set(SCIQLOP-GUI_LIBRARIES ${LIBRARY_OUTPUT_PATH}/libsciqlop_gui${DEBUG_SUFFIX}.${OS_LIB_EXTENSION})
20
21 set(SCIQLOP-GUI_FOUND TRUE)
@@ -0,0 +1,33
1 #ifndef SCIQLOP_SQPAPPLICATION_H
2 #define SCIQLOP_SQPAPPLICATION_H
3
4 #include "SqpApplication.h"
5
6 #include <QApplication>
7 #include <QLoggingCategory>
8
9 #include <Common/spimpl.h>
10
11 Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication)
12
13 /**
14 * @brief The SqpApplication class aims to make the link between SciQlop
15 * and its plugins. This is the intermediate class that SciQlop have to use
16 * in the way to connect a data source. Please first use load method to intialize
17 * a plugin specified by its metadata name (JSON plugin source) then others specifics
18 * method will ba able to access it.
19 * You can load a data source driver plugin then create a data source.
20 */
21 class SqpApplication : public QApplication {
22 Q_OBJECT
23 public:
24 explicit SqpApplication(int &argc, char **argv);
25 virtual ~SqpApplication();
26 void initialize();
27
28 private:
29 class SqpApplicationPrivate;
30 spimpl::unique_impl_ptr<SqpApplicationPrivate> impl;
31 };
32
33 #endif // SCIQLOP_SQPAPPLICATION_H
@@ -0,0 +1,46
1 #include "SqpApplication.h"
2
3 #include <DataSource/DataSourceController.h>
4 #include <QThread>
5
6 Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication")
7
8 class SqpApplication::SqpApplicationPrivate {
9 public:
10 SqpApplicationPrivate() {}
11 ~SqpApplicationPrivate()
12 {
13 qCInfo(LOG_SqpApplication()) << tr("Desctruction du SqpApplicationPrivate");
14 ;
15 m_DataSourceControllerThread.quit();
16 m_DataSourceControllerThread.wait();
17 }
18
19 std::unique_ptr<DataSourceController> m_DataSourceController;
20 QThread m_DataSourceControllerThread;
21 };
22
23
24 SqpApplication::SqpApplication(int &argc, char **argv)
25 : QApplication(argc, argv), impl{spimpl::make_unique_impl<SqpApplicationPrivate>()}
26 {
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);
31
32 connect(&impl->m_DataSourceControllerThread, &QThread::started,
33 impl->m_DataSourceController.get(), &DataSourceController::initialize);
34 connect(&impl->m_DataSourceControllerThread, &QThread::finished,
35 impl->m_DataSourceController.get(), &DataSourceController::finalize);
36
37 impl->m_DataSourceControllerThread.start();
38 }
39
40 SqpApplication::~SqpApplication()
41 {
42 }
43
44 void SqpApplication::initialize()
45 {
46 }
@@ -1,144 +1,147
1
1
2 ## sciqlop - CMakeLists.txt
2 ## sciqlop - CMakeLists.txt
3 SET(EXECUTABLE_NAME "sciqlop")
3 SET(EXECUTABLE_NAME "sciqlop")
4 SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
4 SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
5 SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include)
5 SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include)
6 SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src)
6 SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src)
7 SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources)
7 SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources)
8
8
9 #
9 #
10 # Find Qt modules
10 # Find Qt modules
11 #
11 #
12 SCIQLOP_FIND_QT(Core Widgets)
12 SCIQLOP_FIND_QT(Core Widgets)
13
13
14 #
14 #
15 # Find dependent libraries
15 # Find dependent libraries
16 # ========================
16 # ========================
17 SET(LIBRARIES)
17 find_package(sciqlop-gui)
18 SET(EXTERN_LIBRARIES)
18
19 message("Librairies inclues dans APP: ${SCIQLOP-GUI_LIBRARIES}")
20 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
19 SET(EXTERN_SHARED_LIBRARIES)
21 SET(EXTERN_SHARED_LIBRARIES)
20
22
23 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
24
21 # Add sqpcore to the list of libraries to use
25 # Add sqpcore to the list of libraries to use
22 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
26 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
23
27
24 # Include sqpcore directory
28 # Include core directory
25 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../sqpcore/src")
29 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
26
30
27 # Add dependent shared libraries
31 # Add dependent shared libraries
28 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
32 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
29
33
30 # 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
31 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
35 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
32 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
36 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
33
37
34 #
38 #
35 # Compile the application
39 # Compile the application
36 #
40 #
37 FILE (GLOB_RECURSE APPLICATION_SOURCES
41 FILE (GLOB_RECURSE APPLICATION_SOURCES
38 ${SOURCES_DIR}/*.c
42 ${SOURCES_DIR}/*.c
39 ${SOURCES_DIR}/*.cpp
43 ${SOURCES_DIR}/*.cpp
40 ${SOURCES_DIR}/*.h)
44 ${SOURCES_DIR}/*.h)
41
45
42 # Headers files (.h)
46 # Headers files (.h)
43 FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h)
47 FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h)
44
48
45 # Ui files
49 # Ui files
46 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
50 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
47
51
48 # Resources files
52 # Resources files
49 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
53 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
50
54
51 # Retrieve resources files
55 # Retrieve resources files
52 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
56 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
53
57
54 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
58 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
55
59
56 QT5_WRAP_UI(UIS_HDRS
60 QT5_WRAP_UI(UIS_HDRS
57 ${PROJECT_FORMS}
61 ${PROJECT_FORMS}
58 )
62 )
59
63
60
64
61 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
65 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
62 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
63 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
64
65 target_link_libraries(${EXECUTABLE_NAME}
68 target_link_libraries(${EXECUTABLE_NAME}
66 ${LIBRARIES})
69 ${LIBRARIES})
67
70
68 # Link with Qt5 modules
71 # Link with Qt5 modules
69 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
72 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
70
73
71
74
72 # Add the files to the list of files to be analyzed
75 # Add the files to the list of files to be analyzed
73 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
76 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
74 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
77 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
75 # Vera++ exclusion files
78 # Vera++ exclusion files
76 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
79 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
77 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
80 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
78
81
79 #
82 #
80 # Compile the tests
83 # Compile the tests
81 #
84 #
82 IF(BUILD_TESTS)
85 IF(BUILD_TESTS)
83 INCLUDE_DIRECTORIES(${SOURCES_DIR})
86 INCLUDE_DIRECTORIES(${SOURCES_DIR})
84 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
87 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
85 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
88 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
86 SET( TEST_LIBRARIES ${LIBRARIES} ${EXTERN_LIBRARIES})
89 SET( TEST_LIBRARIES ${LIBRARIES})
87
90
88 FOREACH( testFile ${TESTS_SOURCES} )
91 FOREACH( testFile ${TESTS_SOURCES} )
89 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
92 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
90 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
93 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
91
94
92 # 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
93 # directory that aren't another test
96 # directory that aren't another test
94 FILE (GLOB currentTestSources
97 FILE (GLOB currentTestSources
95 ${testDirectory}/*.c
98 ${testDirectory}/*.c
96 ${testDirectory}/*.cpp
99 ${testDirectory}/*.cpp
97 ${testDirectory}/*.h)
100 ${testDirectory}/*.h)
98 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
101 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
99 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
100
103
101 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
102 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
103 qt5_use_modules(${testName} Test)
106 qt5_use_modules(${testName} Test)
104
107
105 ADD_TEST( NAME ${testName} COMMAND ${testName} )
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
106
109
107 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
110 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
108 ENDFOREACH( testFile )
111 ENDFOREACH( testFile )
109
112
110 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
113 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
111 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
114 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
112 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
115 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
113 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
116 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
114 ENDIF(BUILD_TESTS)
117 ENDIF(BUILD_TESTS)
115
118
116 #
119 #
117 # Set the files that must be formatted by clang-format.
120 # Set the files that must be formatted by clang-format.
118 #
121 #
119 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
122 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
120 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
123 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
121
124
122 #
125 #
123 # Set the directories that doxygen must browse to generate the
126 # Set the directories that doxygen must browse to generate the
124 # documentation.
127 # documentation.
125 #
128 #
126 # Source directories:
129 # Source directories:
127 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
130 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
128 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
131 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
129 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
132 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
130 # Source directories to exclude from the documentation generation
133 # Source directories to exclude from the documentation generation
131 #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/*")
132 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
135 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
133
136
134 #
137 #
135 # Set the directories with the sources to analyze and propagate the
138 # Set the directories with the sources to analyze and propagate the
136 # modification to the parent scope
139 # modification to the parent scope
137 #
140 #
138 # Source directories to analyze:
141 # Source directories to analyze:
139 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
142 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
140 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
143 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
141 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
144 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
142 # Source directories to exclude from the analysis
145 # Source directories to exclude from the analysis
143 #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")
144 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
147 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
1 NO CONTENT: file renamed from sqpapp/resources/qlopapp.qrc to app/resources/qlopapp.qrc
NO CONTENT: file renamed from sqpapp/resources/qlopapp.qrc to app/resources/qlopapp.qrc
1 NO CONTENT: file renamed from sqpapp/resources/sciqlopLOGO.svg to app/resources/sciqlopLOGO.svg
NO CONTENT: file renamed from sqpapp/resources/sciqlopLOGO.svg to app/resources/sciqlopLOGO.svg
@@ -1,39 +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 <QApplication>
24 #include <QProcessEnvironment>
23 #include <QProcessEnvironment>
25 #include <QThread>
24 #include <QThread>
26 //#include <omp.h>
25 #include <SqpApplication.h>
26 #include <omp.h>
27 #include <qglobal.h>
27 #include <qglobal.h>
28
28
29 int main(int argc, char *argv[])
29 int main(int argc, char *argv[])
30 {
30 {
31 QApplication a(argc, argv);
31 SqpApplication a(argc, argv);
32 QApplication::setOrganizationName("LPP");
32 SqpApplication::setOrganizationName("LPP");
33 QApplication::setOrganizationDomain("lpp.fr");
33 SqpApplication::setOrganizationDomain("lpp.fr");
34 QApplication::setApplicationName("SciQLop");
34 SqpApplication::setApplicationName("SciQLop");
35 MainWindow w;
35 MainWindow w;
36 w.show();
36 w.show();
37
37
38 return a.exec();
38 return a.exec();
39 }
39 }
@@ -1,104 +1,104
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 "ui_mainwindow.h"
23 #include "ui_mainwindow.h"
24 #include <QAction>
24 #include <QAction>
25 #include <QDate>
25 #include <QDate>
26 #include <QDateTime>
26 #include <QDateTime>
27 #include <QDir>
27 #include <QDir>
28 #include <QFileDialog>
28 #include <QFileDialog>
29 //#include <omp.h>
29 #include <omp.h>
30 //#include <network/filedownloader.h>
30 //#include <network/filedownloader.h>
31 //#include <qlopdatabase.h>
31 //#include <qlopdatabase.h>
32 //#include <qlopsettings.h>
32 //#include <qlopsettings.h>
33 //#include <qlopgui.h>
33 //#include <qlopgui.h>
34 //#include <spacedata.h>
34 //#include <spacedata.h>
35 //#include "qlopcore.h"
35 //#include "qlopcore.h"
36 //#include "qlopcodecmanager.h"
36 //#include "qlopcodecmanager.h"
37 //#include "cdfcodec.h"
37 //#include "cdfcodec.h"
38 //#include "amdatxtcodec.h"
38 //#include "amdatxtcodec.h"
39 //#include <qlopplotmanager.h>
39 //#include <qlopplotmanager.h>
40
40
41
41
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
42 MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
43 {
43 {
44 ui->setupUi(this);
44 ui->setupUi(this);
45 /* QLopGUI::registerMenuBar(menuBar());
45 /* QLopGUI::registerMenuBar(menuBar());
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
46 this->setWindowIcon(QIcon(":/sciqlopLOGO.svg"));
47 this->m_progressWidget = new QWidget();
47 this->m_progressWidget = new QWidget();
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
48 this->m_progressLayout = new QVBoxLayout(this->m_progressWidget);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
49 this->m_progressWidget->setLayout(this->m_progressLayout);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
50 this->m_progressWidget->setWindowModality(Qt::WindowModal);
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
51 m_progressThreadIds = (int*) malloc(OMP_THREADS*sizeof(int));
52 for(int i=0;i<OMP_THREADS;i++)
52 for(int i=0;i<OMP_THREADS;i++)
53 {
53 {
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
54 this->m_progress.append(new QProgressBar(this->m_progressWidget));
55 this->m_progress.last()->setMinimum(0);
55 this->m_progress.last()->setMinimum(0);
56 this->m_progress.last()->setMaximum(100);
56 this->m_progress.last()->setMaximum(100);
57 this->m_progressLayout->addWidget(this->m_progress.last());
57 this->m_progressLayout->addWidget(this->m_progress.last());
58 this->m_progressWidget->hide();
58 this->m_progressWidget->hide();
59 this->m_progressThreadIds[i] = -1;
59 this->m_progressThreadIds[i] = -1;
60 }
60 }
61 this->m_progressWidget->setWindowTitle("Loading File");
61 this->m_progressWidget->setWindowTitle("Loading File");
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
62 const QList<QLopService*>ServicesToLoad=QList<QLopService*>()
63 << QLopCore::self()
63 << QLopCore::self()
64 << QLopPlotManager::self()
64 << QLopPlotManager::self()
65 << QLopCodecManager::self()
65 << QLopCodecManager::self()
66 << FileDownloader::self()
66 << FileDownloader::self()
67 << QLopDataBase::self()
67 << QLopDataBase::self()
68 << SpaceData::self();
68 << SpaceData::self();
69
69
70 CDFCodec::registerToManager();
70 CDFCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
71 AMDATXTCodec::registerToManager();
72
72
73
73
74 for(int i=0;i<ServicesToLoad.count();i++)
74 for(int i=0;i<ServicesToLoad.count();i++)
75 {
75 {
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
76 qDebug()<<ServicesToLoad.at(i)->serviceName();
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
77 ServicesToLoad.at(i)->initialize(); //must be called before getGUI
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
78 QDockWidget* wdgt=ServicesToLoad.at(i)->getGUI();
79 if(wdgt)
79 if(wdgt)
80 {
80 {
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
81 wdgt->setAllowedAreas(Qt::AllDockWidgetAreas);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
82 this->addDockWidget(Qt::TopDockWidgetArea,wdgt);
83 }
83 }
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
84 PythonQt::self()->getMainModule().addObject(ServicesToLoad.at(i)->serviceName(),(QObject*)ServicesToLoad.at(i));
85 }*/
85 }*/
86 }
86 }
87
87
88 MainWindow::~MainWindow()
88 MainWindow::~MainWindow()
89 {
89 {
90 delete ui;
90 delete ui;
91 }
91 }
92
92
93
93
94 void MainWindow::changeEvent(QEvent *e)
94 void MainWindow::changeEvent(QEvent *e)
95 {
95 {
96 QMainWindow::changeEvent(e);
96 QMainWindow::changeEvent(e);
97 switch (e->type()) {
97 switch (e->type()) {
98 case QEvent::LanguageChange:
98 case QEvent::LanguageChange:
99 ui->retranslateUi(this);
99 ui->retranslateUi(this);
100 break;
100 break;
101 default:
101 default:
102 break;
102 break;
103 }
103 }
104 }
104 }
1 NO CONTENT: file renamed from sqpapp/src/mainwindow.h to app/src/mainwindow.h
NO CONTENT: file renamed from sqpapp/src/mainwindow.h to app/src/mainwindow.h
1 NO CONTENT: file renamed from sqpapp/src/mainwindow.ui to app/src/mainwindow.ui
NO CONTENT: file renamed from sqpapp/src/mainwindow.ui to app/src/mainwindow.ui
@@ -1,31 +1,37
1 #
1 #
2 # Sciqlop_modules.cmake
2 # Sciqlop_modules.cmake
3 #
3 #
4 # Set ouptut directories
4 # Set ouptut directories
5 #
5 #
6 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
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})
7 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
8
8
9
9
10 #
10 #
11 # Compile the diffents modules
11 # Compile the diffents modules
12 #
12 #
13 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpcore")
13 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
14 #ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpgui")
14 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
15 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/sqpapp")
15 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
16
17 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
18 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
19 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
20
21 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
16
22
17 #
23 #
18 # Code formatting
24 # Code formatting
19 #
25 #
20 INCLUDE ("cmake/sciqlop_formatting.cmake")
26 INCLUDE ("cmake/sciqlop_formatting.cmake")
21
27
22 #
28 #
23 # Documentation generation
29 # Documentation generation
24 #
30 #
25 INCLUDE ("cmake/sciqlop_doxygen.cmake")
31 INCLUDE ("cmake/sciqlop_doxygen.cmake")
26
32
27 #
33 #
28 # Source code analysis
34 # Source code analysis
29 #
35 #
30 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
36 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
31 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
37 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
@@ -1,90 +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(SCIQLOP_BUILD_TYPE MATCHES "Debug")
9 #IF(SCIQLOP_BUILD_TYPE MATCHES "Debug")
10 MESSAGE (STATUS "Build in Debug")
10 # MESSAGE (STATUS "Build in Debug")
11 SET (CMAKE_BUILD_TYPE "Debug")
11 # SET (CMAKE_BUILD_TYPE "Debug")
12 SET (DEBUG_SUFFIX "d")
12 # SET (DEBUG_SUFFIX "d")
13 ELSE()
13 #ELSE()
14 MESSAGE (STATUS "Build in Release")
14 # MESSAGE (STATUS "Build in Release")
15 SET (CMAKE_BUILD_TYPE "Release")
15 # SET (CMAKE_BUILD_TYPE "Release")
16 SET (SCIQLOP_BUILD_TYPE "Release")
16 # SET (SCIQLOP_BUILD_TYPE "Release")
17 SET (DEBUG_SUFFIX "")
17 # SET (DEBUG_SUFFIX "")
18 ENDIF()
18 #ENDIF()
19
19
20 #
20 #
21 # Need to compile tests?
21 # Need to compile tests?
22 #
22 #
23 OPTION (BUILD_TESTS "Build the tests" OFF)
23 OPTION (BUILD_TESTS "Build the tests" OFF)
24 ENABLE_TESTING(${BUILD_TESTS})
24 ENABLE_TESTING(${BUILD_TESTS})
25
25
26 #
26 #
27 # Path to the folder for sciqlop's extern libraries.
27 # Path to the folder for sciqlop's extern libraries.
28 #
28 #
29 # 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
30 # folders:
30 # folders:
31 # - 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
32 # - The global Sciqlop extern folder
32 # - The global Sciqlop extern folder
33 # - The system folders.
33 # - The system folders.
34 #
34 #
35 # 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
36 # 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
37 # 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
38 # <LIBRARY>_COPY_SHARED_LIBRARIES flag.
38 # <LIBRARY>_COPY_SHARED_LIBRARIES flag.
39 #
39 #
40 set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern"
40 set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern"
41 CACHE PATH "Path to the folder for sciqlop's extern libraries")
41 CACHE PATH "Path to the folder for sciqlop's extern libraries")
42 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"
43 OFF)
43 OFF)
44
44
45 if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR)
45 if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR)
46 set(libRootDirForceValue FORCE)
46 set(libRootDirForceValue FORCE)
47 else()
47 else()
48 set(libRootDirForceValue)
48 set(libRootDirForceValue)
49 endif()
49 endif()
50
50
51
51
52
52
53 #
53 #
54 # Static or shared libraries
54 # Static or shared libraries
55 #
55 #
56 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
56 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
57
57
58 # Generate position independant code (-fPIC)
58 # Generate position independant code (-fPIC)
59 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
59 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
60
60
61 #
61 #
62 # Configure installation directories
62 # Configure installation directories
63 #
63 #
64 IF (UNIX)
64 IF (UNIX)
65 SET(defaultBin "bin")
65 SET(defaultBin "bin")
66 SET(defaultInc "include/sciqlop")
66 SET(defaultInc "include/sciqlop")
67
67
68 # 32 or 64 bits compiler
68 # 32 or 64 bits compiler
69 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
69 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
70 SET(defaultLib "lib64/sciqlop")
70 SET(defaultLib "lib64/sciqlop")
71 ELSE()
71 ELSE()
72 SET(defaultLib "lib/sciqlop")
72 SET(defaultLib "lib/sciqlop")
73 ENDIF()
73 ENDIF()
74
74
75 SET(defaultDoc "share/docs/sciqlop")
75 SET(defaultDoc "share/docs/sciqlop")
76 ELSE()
76 ELSE()
77 SET(defaultBin "bin")
77 SET(defaultBin "bin")
78 SET(defaultInc "include/sciqlop")
78 SET(defaultInc "include/sciqlop")
79 SET(defaultLib "lib/sciqlop")
79 SET(defaultLib "lib/sciqlop")
80 SET(defaultDoc "docs/sciqlop")
80 SET(defaultDoc "docs/sciqlop")
81 ENDIF()
81 ENDIF()
82
82
83 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
83 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
84 "Installation directory for binaries")
84 "Installation directory for binaries")
85 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
85 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
86 "Installation directory for libraries")
86 "Installation directory for libraries")
87 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
87 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
88 "Installation directory for headers")
88 "Installation directory for headers")
89 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
89 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
90 "Installation directory for documentations")
90 "Installation directory for documentations")
@@ -1,123 +1,128
1
1
2 ## sqpcore - 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}_sqpcore${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/")
7
8 # Include core directory
9 include_directories("${INCLUDES_DIR}")
6
10
7 # Set a variable to display a warning in the version files.
11 # Set a variable to display a warning in the version files.
8 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.")
9 # Generate the version file from the cmake version variables. The version
13 # Generate the version file from the cmake version variables. The version
10 # variables are defined in the cmake/sciqlop_version.cmake file.
14 # variables are defined in the cmake/sciqlop_version.cmake file.
11 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
15 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
12 "${SOURCES_DIR}/Version.h")
16 "${INCLUDES_DIR}/Version.h")
13 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
14 "${SOURCES_DIR}/Version.cpp")
18 "${SOURCES_DIR}/Version.cpp")
15
19
16 #
20 #
17 # Find Qt modules
21 # Find Qt modules
18 #
22 #
19 SCIQLOP_FIND_QT(Core)
23 SCIQLOP_FIND_QT(Core)
20
24
21 #
25 #
22 # Compile the library library
26 # Compile the library library
23 #
27 #
24 FILE (GLOB_RECURSE MODULE_SOURCES
28 FILE (GLOB_RECURSE MODULE_SOURCES
29 ${INCLUDES_DIR}/*.h
25 ${SOURCES_DIR}/*.c
30 ${SOURCES_DIR}/*.c
26 ${SOURCES_DIR}/*.cpp
31 ${SOURCES_DIR}/*.cpp
27 ${SOURCES_DIR}/*.h)
32 ${SOURCES_DIR}/*.h)
28
33
29 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
34 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
30 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
35 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
31 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
36 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
32 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${EXTERN_LIBRARIES})
37 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
33 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
38 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
34
39
35 # 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
36 # 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.
37 # 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
38 IF(BUILD_SHARED_LIBS)
43 IF(BUILD_SHARED_LIBS)
39 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
44 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
40 ELSE()
45 ELSE()
41 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
46 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
42 ENDIF()
47 ENDIF()
43
48
44 # 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
45 # dependent shared libraries
50 # dependent shared libraries
46 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
51 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
47
52
48 # Copy extern shared libraries to the lib folder
53 # Copy extern shared libraries to the lib folder
49 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
54 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
50
55
51 # Add the files to the list of files to be analyzed
56 # Add the files to the list of files to be analyzed
52 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
57 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
53 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
58 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
54 # Vera++ exclusion files
59 # Vera++ exclusion files
55 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
60 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
56 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
61 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
57
62
58 #
63 #
59 # Compile the tests
64 # Compile the tests
60 #
65 #
61 IF(BUILD_TESTS)
66 IF(BUILD_TESTS)
62 INCLUDE_DIRECTORIES(${SOURCES_DIR})
67 INCLUDE_DIRECTORIES(${SOURCES_DIR})
63 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
68 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
64 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
69 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
65 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME} ${EXTERN_LIBRARIES})
70 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
66
71
67 FOREACH( testFile ${TESTS_SOURCES} )
72 FOREACH( testFile ${TESTS_SOURCES} )
68 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
73 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
69 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
74 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
70
75
71 # 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
72 # directory that aren't another test
77 # directory that aren't another test
73 FILE (GLOB currentTestSources
78 FILE (GLOB currentTestSources
74 ${testDirectory}/*.c
79 ${testDirectory}/*.c
75 ${testDirectory}/*.cpp
80 ${testDirectory}/*.cpp
76 ${testDirectory}/*.h)
81 ${testDirectory}/*.h)
77 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
82 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
78 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
83 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
79
84
80 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
85 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
81 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
86 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
82 qt5_use_modules(${testName} Test)
87 qt5_use_modules(${testName} Test)
83
88
84 ADD_TEST( NAME ${testName} COMMAND ${testName} )
89 ADD_TEST( NAME ${testName} COMMAND ${testName} )
85
90
86 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
91 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
87 ENDFOREACH( testFile )
92 ENDFOREACH( testFile )
88
93
89 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
94 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
90 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
95 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
91 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
96 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
92 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
97 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
93 ENDIF(BUILD_TESTS)
98 ENDIF(BUILD_TESTS)
94
99
95 #
100 #
96 # Set the files that must be formatted by clang-format.
101 # Set the files that must be formatted by clang-format.
97 #
102 #
98 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
103 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
99 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
104 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
100
105
101 #
106 #
102 # Set the directories that doxygen must browse to generate the
107 # Set the directories that doxygen must browse to generate the
103 # documentation.
108 # documentation.
104 #
109 #
105 # Source directories:
110 # Source directories:
106 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
111 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
107 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
112 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
108 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
113 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
109 # Source directories to exclude from the documentation generation
114 # Source directories to exclude from the documentation generation
110 #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/*")
111 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
116 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
112
117
113 #
118 #
114 # Set the directories with the sources to analyze and propagate the
119 # Set the directories with the sources to analyze and propagate the
115 # modification to the parent scope
120 # modification to the parent scope
116 #
121 #
117 # Source directories to analyze:
122 # Source directories to analyze:
118 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
123 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
119 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
124 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
120 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
125 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
121 # Source directories to exclude from the analysis
126 # Source directories to exclude from the analysis
122 #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")
123 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
128 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
1 NO CONTENT: file renamed from sqpcore/resources/Version.cpp.in to core/resources/Version.cpp.in
NO CONTENT: file renamed from sqpcore/resources/Version.cpp.in to core/resources/Version.cpp.in
1 NO CONTENT: file renamed from sqpcore/resources/Version.h.in to core/resources/Version.h.in
NO CONTENT: file renamed from sqpcore/resources/Version.h.in to core/resources/Version.h.in
@@ -1,140 +1,159
1
1
2 ## sqpgui - 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}_sqpgui${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(INCLUDE_FOLDER ${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
10 # Include gui directory
11 include_directories("${INCLUDES_DIR}")
12 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
9
13
10 # Set a variable to display a warning in the version files.
14 # Set a variable to display a warning in the version files.
11 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.")
12
16
13 #
17 #
14 # Find Qt modules
18 # Find Qt modules
15 #
19 #
16 SCIQLOP_FIND_QT(Core Widgets)
20 SCIQLOP_FIND_QT(Core Widgets)
17
21
18 #
22 #
19 # Compile the library library
23 # Find dependent libraries
20 #
24 # ========================
21 FILE (GLOB_RECURSE MODULE_SOURCES
25 find_package(sciqlop-core)
22 ${SOURCES_DIR}/*.c
26
23 ${SOURCES_DIR}/*.cpp
27 message("Librairies inclues dans APP: ${SCIQLOP-CORE_LIBRARIES}")
24 ${SOURCES_DIR}/*.h)
28 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
29
30 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
31
32 # Add sqpcore to the list of libraries to use
33 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
34
35 # Add dependent shared libraries
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
25
37
26 # Headers files (.h)
27 FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h)
28
38
29 # Ui files
39 # Ui files
30 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
40 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
31
41
32 # Resources files
42 # Resources files
33 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
43 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
34
44
45 #
46 # Compile the library library
47 #
48 FILE (GLOB_RECURSE MODULE_SOURCES
49 ${INCLUDES_DIR}/*.h
50 ${SOURCES_DIR}/*.c
51 ${SOURCES_DIR}/*.cpp
52 ${SOURCES_DIR}/*.h
53 ${PROJECT_FORMS})
54
35 QT5_ADD_RESOURCES(RCC_HDRS
55 QT5_ADD_RESOURCES(RCC_HDRS
36 ${PROJECT_RESOURCES}
56 ${PROJECT_RESOURCES}
37 )
57 )
38
58
39 QT5_WRAP_UI(UIS_HDRS
59 QT5_WRAP_UI(UIS_HDRS
40 ${PROJECT_FORMS}
60 ${PROJECT_FORMS}
41 )
61 )
42
62
43 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
44 message(CURRENT INCLUDE : ${CMAKE_CURRENT_BINARY_DIR})
45
63
46 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS})
64 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
47 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
48 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
66 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
49 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${EXTERN_LIBRARIES})
67
68 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
50 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets)
69 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets)
51
70
52 # 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
53 # 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.
54 # 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
55 IF(BUILD_SHARED_LIBS)
74 IF(BUILD_SHARED_LIBS)
56 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
75 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
57 ELSE()
76 ELSE()
58 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
77 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
59 ENDIF()
78 ENDIF()
60
79
61 # 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
62 # dependent shared libraries
81 # dependent shared libraries
63 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
82 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
64
83
65 # Copy extern shared libraries to the lib folder
84 # Copy extern shared libraries to the lib folder
66 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
85 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
67
86
68 # Add the files to the list of files to be analyzed
87 # Add the files to the list of files to be analyzed
69 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
88 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
70 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
89 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
71 # Vera++ exclusion files
90 # Vera++ exclusion files
72 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
91 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
73 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
92 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
74
93
75 #
94 #
76 # Compile the tests
95 # Compile the tests
77 #
96 #
78 IF(BUILD_TESTS)
97 IF(BUILD_TESTS)
79 INCLUDE_DIRECTORIES(${SOURCES_DIR})
98 INCLUDE_DIRECTORIES(${SOURCES_DIR})
80 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
99 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
81 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
100 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
82 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME} ${EXTERN_LIBRARIES})
101 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
83
102
84 FOREACH( testFile ${TESTS_SOURCES} )
103 FOREACH( testFile ${TESTS_SOURCES} )
85 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
104 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
86 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
105 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
87
106
88 # 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
89 # directory that aren't another test
108 # directory that aren't another test
90 FILE (GLOB currentTestSources
109 FILE (GLOB currentTestSources
91 ${testDirectory}/*.c
110 ${testDirectory}/*.c
92 ${testDirectory}/*.cpp
111 ${testDirectory}/*.cpp
93 ${testDirectory}/*.h)
112 ${testDirectory}/*.h)
94 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
113 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
95 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
114 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
96
115
97 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
116 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
98 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
117 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
99 qt5_use_modules(${testName} Test)
118 qt5_use_modules(${testName} Test)
100
119
101 ADD_TEST( NAME ${testName} COMMAND ${testName} )
120 ADD_TEST( NAME ${testName} COMMAND ${testName} )
102
121
103 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
122 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
104 ENDFOREACH( testFile )
123 ENDFOREACH( testFile )
105
124
106 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
125 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
107 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
126 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
108 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
127 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
109 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
128 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
110 ENDIF(BUILD_TESTS)
129 ENDIF(BUILD_TESTS)
111
130
112 #
131 #
113 # Set the files that must be formatted by clang-format.
132 # Set the files that must be formatted by clang-format.
114 #
133 #
115 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
134 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
116 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
135 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
117
136
118 #
137 #
119 # Set the directories that doxygen must browse to generate the
138 # Set the directories that doxygen must browse to generate the
120 # documentation.
139 # documentation.
121 #
140 #
122 # Source directories:
141 # Source directories:
123 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
142 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
124 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
143 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
125 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
144 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
126 # Source directories to exclude from the documentation generation
145 # Source directories to exclude from the documentation generation
127 #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/*")
128 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
147 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
129
148
130 #
149 #
131 # Set the directories with the sources to analyze and propagate the
150 # Set the directories with the sources to analyze and propagate the
132 # modification to the parent scope
151 # modification to the parent scope
133 #
152 #
134 # Source directories to analyze:
153 # Source directories to analyze:
135 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
154 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
136 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
155 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
137 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
156 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
138 # Source directories to exclude from the analysis
157 # Source directories to exclude from the analysis
139 #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")
140 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
159 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
General Comments 0
You need to be logged in to leave comments. Login now