##// END OF EJS Templates
Ajout du logger compatible Linux à la compilation.
perrinel -
r25:bbb3a36891b9
parent child
Show More
@@ -0,0 +1,4
1 [Rules]
2 *.debug=false
3 SqpApplication.debug=true
4 DataSourceController.debug=true
@@ -1,147 +1,146
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 find_package(sciqlop-gui)
17 find_package(sciqlop-gui)
18
18
19 message("Librairies inclues dans APP: ${SCIQLOP-GUI_LIBRARIES}")
20 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
19 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
21 SET(EXTERN_SHARED_LIBRARIES)
20 SET(EXTERN_SHARED_LIBRARIES)
22
21
23 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
22 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
24
23
25 # Add sqpcore to the list of libraries to use
24 # Add sqpcore to the list of libraries to use
26 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
25 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
27
26
28 # Include core directory
27 # Include core directory
29 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
28 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
30
29
31 # Add dependent shared libraries
30 # Add dependent shared libraries
32 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
31 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
33
32
34 # Retrieve the location of the dynamic library to copy it to the output path
33 # Retrieve the location of the dynamic library to copy it to the output path
35 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
34 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
36 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
35 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
37
36
38 #
37 #
39 # Compile the application
38 # Compile the application
40 #
39 #
41 FILE (GLOB_RECURSE APPLICATION_SOURCES
40 FILE (GLOB_RECURSE APPLICATION_SOURCES
42 ${SOURCES_DIR}/*.c
41 ${SOURCES_DIR}/*.c
43 ${SOURCES_DIR}/*.cpp
42 ${SOURCES_DIR}/*.cpp
44 ${SOURCES_DIR}/*.h)
43 ${SOURCES_DIR}/*.h)
45
44
46 # Headers files (.h)
45 # Headers files (.h)
47 FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h)
46 FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h)
48
47
49 # Ui files
48 # Ui files
50 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
49 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
51
50
52 # Resources files
51 # Resources files
53 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
52 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
54
53
55 # Retrieve resources files
54 # Retrieve resources files
56 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
55 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
57
56
58 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
57 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
59
58
60 QT5_WRAP_UI(UIS_HDRS
59 QT5_WRAP_UI(UIS_HDRS
61 ${PROJECT_FORMS}
60 ${PROJECT_FORMS}
62 )
61 )
63
62
64
63
65 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
64 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
65 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
67 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
68 target_link_libraries(${EXECUTABLE_NAME}
67 target_link_libraries(${EXECUTABLE_NAME}
69 ${LIBRARIES})
68 ${LIBRARIES})
70
69
71 # Link with Qt5 modules
70 # Link with Qt5 modules
72 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
71 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
73
72
74
73
75 # Add the files to the list of files to be analyzed
74 # Add the files to the list of files to be analyzed
76 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
75 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
77 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
76 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
78 # Vera++ exclusion files
77 # Vera++ exclusion files
79 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
78 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
80 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
79 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
81
80
82 #
81 #
83 # Compile the tests
82 # Compile the tests
84 #
83 #
85 IF(BUILD_TESTS)
84 IF(BUILD_TESTS)
86 INCLUDE_DIRECTORIES(${SOURCES_DIR})
85 INCLUDE_DIRECTORIES(${SOURCES_DIR})
87 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
86 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
88 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
87 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
89 SET( TEST_LIBRARIES ${LIBRARIES})
88 SET( TEST_LIBRARIES ${LIBRARIES})
90
89
91 FOREACH( testFile ${TESTS_SOURCES} )
90 FOREACH( testFile ${TESTS_SOURCES} )
92 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
91 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
93 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
92 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
94
93
95 # Add to the list of sources files all the sources in the same
94 # Add to the list of sources files all the sources in the same
96 # directory that aren't another test
95 # directory that aren't another test
97 FILE (GLOB currentTestSources
96 FILE (GLOB currentTestSources
98 ${testDirectory}/*.c
97 ${testDirectory}/*.c
99 ${testDirectory}/*.cpp
98 ${testDirectory}/*.cpp
100 ${testDirectory}/*.h)
99 ${testDirectory}/*.h)
101 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
100 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
101 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
103
102
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
103 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
104 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
106 qt5_use_modules(${testName} Test)
105 qt5_use_modules(${testName} Test)
107
106
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
107 ADD_TEST( NAME ${testName} COMMAND ${testName} )
109
108
110 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
109 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
111 ENDFOREACH( testFile )
110 ENDFOREACH( testFile )
112
111
113 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
112 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
114 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
113 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
115 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
114 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
116 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
115 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
117 ENDIF(BUILD_TESTS)
116 ENDIF(BUILD_TESTS)
118
117
119 #
118 #
120 # Set the files that must be formatted by clang-format.
119 # Set the files that must be formatted by clang-format.
121 #
120 #
122 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
121 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
123 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
122 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
124
123
125 #
124 #
126 # Set the directories that doxygen must browse to generate the
125 # Set the directories that doxygen must browse to generate the
127 # documentation.
126 # documentation.
128 #
127 #
129 # Source directories:
128 # Source directories:
130 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
129 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
131 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
130 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
132 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
131 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
133 # Source directories to exclude from the documentation generation
132 # Source directories to exclude from the documentation generation
134 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
133 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
135 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
134 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
136
135
137 #
136 #
138 # Set the directories with the sources to analyze and propagate the
137 # Set the directories with the sources to analyze and propagate the
139 # modification to the parent scope
138 # modification to the parent scope
140 #
139 #
141 # Source directories to analyze:
140 # Source directories to analyze:
142 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
141 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
143 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
142 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
144 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
143 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
145 # Source directories to exclude from the analysis
144 # Source directories to exclude from the analysis
146 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
145 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
147 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
146 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,40 +1,51
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 IF (UNIX)
9 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
10 ELSEIF(WIN32)
11 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}/app/QtProject)
12 ELSE()
13 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE})
14 ENDIF()
9
15
10 #
16 #
11 # Compile the diffents modules
17 # Compile the diffents modules
12 #
18 #
13 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
19 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
14 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
20 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
15 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
21 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
16
22
17 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
23 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
18 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
24 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
19 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
25 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
20
26
21 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
27 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
22
28
29 # LOGGER
30 set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini")
31 FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH})
32
33
23 #
34 #
24 # Code formatting
35 # Code formatting
25 #
36 #
26 # Vera++ exclusion files
37 # Vera++ exclusion files
27 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt)
38 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt)
28 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
39 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
29 INCLUDE ("cmake/sciqlop_formatting.cmake")
40 INCLUDE ("cmake/sciqlop_formatting.cmake")
30
41
31 #
42 #
32 # Documentation generation
43 # Documentation generation
33 #
44 #
34 INCLUDE ("cmake/sciqlop_doxygen.cmake")
45 INCLUDE ("cmake/sciqlop_doxygen.cmake")
35
46
36 #
47 #
37 # Source code analysis
48 # Source code analysis
38 #
49 #
39 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
50 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
40 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
51 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
@@ -1,55 +1,53
1 #
1 #
2 # sciqlop_formatting.cmake
2 # sciqlop_formatting.cmake
3 #
3 #
4 # Launch code formatting tools. Can be activated with ENABLE_FORMATTING and
4 # Launch code formatting tools. Can be activated with ENABLE_FORMATTING and
5 # ENABLE_CHECKSTYLE options.
5 # ENABLE_CHECKSTYLE options.
6 #
6 #
7 # The following variables are used (must be set by the cmake file calling this
7 # The following variables are used (must be set by the cmake file calling this
8 # one):
8 # one):
9 # * FORMATTING_INPUT_FILES: list of files to format;
9 # * FORMATTING_INPUT_FILES: list of files to format;
10 # * CHECKSTYLE_INPUT_FILES: list of files to check for style;
10 # * CHECKSTYLE_INPUT_FILES: list of files to check for style;
11 # * CHECKSTYLE_EXCLUSION_FILES: list of vera++ exclusion files.
11 # * CHECKSTYLE_EXCLUSION_FILES: list of vera++ exclusion files.
12 #
12 #
13
13
14 OPTION (ENABLE_FORMATTING "Format the source code while compiling" ON)
14 OPTION (ENABLE_FORMATTING "Format the source code while compiling" ON)
15 OPTION (ENABLE_CHECKSTYLE "Analyse the style of the code while compiling" ON)
15 OPTION (ENABLE_CHECKSTYLE "Analyse the style of the code while compiling" ON)
16
16
17 IF (ENABLE_FORMATTING)
17 IF (ENABLE_FORMATTING)
18 IF (CLANGFORMAT_FOUND)
18 IF (CLANGFORMAT_FOUND)
19 INCLUDE(${CLANGFORMAT_USE_FILE})
19 INCLUDE(${CLANGFORMAT_USE_FILE})
20
20
21 ADD_CLANGFORMAT_TARGETS(${FORMATTING_INPUT_FILES}
21 ADD_CLANGFORMAT_TARGETS(${FORMATTING_INPUT_FILES}
22 ADD_TO_ALL)
22 ADD_TO_ALL)
23 ELSE()
23 ELSE()
24 MESSAGE (STATUS "Source code will not be formatted - clang-format not found")
24 MESSAGE (STATUS "Source code will not be formatted - clang-format not found")
25 ENDIF()
25 ENDIF()
26 ENDIF()
26 ENDIF()
27
27
28 IF (ENABLE_CHECKSTYLE)
28 IF (ENABLE_CHECKSTYLE)
29 IF (VERA++_FOUND)
29 IF (VERA++_FOUND)
30 INCLUDE(${VERA++_USE_FILE})
30 INCLUDE(${VERA++_USE_FILE})
31
31
32 SET(EXCLUSIONS)
32 SET(EXCLUSIONS)
33 FOREACH (e ${CHECKSTYLE_EXCLUSION_FILES})
33 FOREACH (e ${CHECKSTYLE_EXCLUSION_FILES})
34 LIST(APPEND EXCLUSIONS EXCLUSION ${e})
34 LIST(APPEND EXCLUSIONS EXCLUSION ${e})
35 ENDFOREACH()
35 ENDFOREACH()
36
36
37 message("Exclusions de vera++: ${EXCLUSIONS}")
38
39 ADD_VERA_TARGETS(${CHECKSTYLE_INPUT_FILES}
37 ADD_VERA_TARGETS(${CHECKSTYLE_INPUT_FILES}
40 ADD_TO_ALL
38 ADD_TO_ALL
41 PROFILE "sciqlop"
39 PROFILE "sciqlop"
42 ROOT "${CMAKE_SOURCE_DIR}/formatting/vera-root"
40 ROOT "${CMAKE_SOURCE_DIR}/formatting/vera-root"
43 PARAMETER "project-name=${PROJECT_NAME}"
41 PARAMETER "project-name=${PROJECT_NAME}"
44 ${EXCLUSIONS})
42 ${EXCLUSIONS})
45
43
46 ADD_VERA_CHECKSTYLE_TARGET(${CHECKSTYLE_INPUT_FILES}
44 ADD_VERA_CHECKSTYLE_TARGET(${CHECKSTYLE_INPUT_FILES}
47 PROFILE "sciqlop"
45 PROFILE "sciqlop"
48 ROOT "${CMAKE_SOURCE_DIR}/formatting/vera-root"
46 ROOT "${CMAKE_SOURCE_DIR}/formatting/vera-root"
49 PARAMETER "project-name=${PROJECT_NAME}"
47 PARAMETER "project-name=${PROJECT_NAME}"
50 ${EXCLUSIONS})
48 ${EXCLUSIONS})
51
49
52 ELSE()
50 ELSE()
53 MESSAGE (STATUS "Source code will not be checkstyled - vera++ not found")
51 MESSAGE (STATUS "Source code will not be checkstyled - vera++ not found")
54 ENDIF()
52 ENDIF()
55 ENDIF()
53 ENDIF()
@@ -1,45 +1,48
1 #include "DataSource/DataSourceController.h"
1 #include "DataSource/DataSourceController.h"
2
2
3 #include <QMutex>
3 #include <QMutex>
4 #include <QThread>
4 #include <QThread>
5
5
6 Q_LOGGING_CATEGORY(LOG_DataSourceController, "dataSourceController")
6 #include <QDir>
7 #include <QStandardPaths>
8
9 Q_LOGGING_CATEGORY(LOG_DataSourceController, "DataSourceController")
7
10
8 class DataSourceController::DataSourceControllerPrivate {
11 class DataSourceController::DataSourceControllerPrivate {
9 public:
12 public:
10 DataSourceControllerPrivate() {}
13 DataSourceControllerPrivate() {}
11
14
12 QMutex m_WorkingMutex;
15 QMutex m_WorkingMutex;
13 };
16 };
14
17
15 DataSourceController::DataSourceController(QObject *parent)
18 DataSourceController::DataSourceController(QObject *parent)
16 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
19 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
17 {
20 {
18 qCDebug(LOG_DataSourceController()) << tr("Construction du DataSourceController")
21 qCDebug(LOG_DataSourceController()) << tr("Construction du DataSourceController")
19 << QThread::currentThread();
22 << QThread::currentThread();
20 }
23 }
21
24
22 DataSourceController::~DataSourceController()
25 DataSourceController::~DataSourceController()
23 {
26 {
24 qCDebug(LOG_DataSourceController()) << tr("Desctruction du DataSourceController")
27 qCDebug(LOG_DataSourceController()) << tr("Desctruction du DataSourceController")
25 << QThread::currentThread();
28 << QThread::currentThread();
26 this->waitForFinish();
29 this->waitForFinish();
27 }
30 }
28
31
29 void DataSourceController::initialize()
32 void DataSourceController::initialize()
30 {
33 {
31 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController")
34 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController")
32 << QThread::currentThread();
35 << QThread::currentThread();
33 impl->m_WorkingMutex.lock();
36 impl->m_WorkingMutex.lock();
34 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController END");
37 qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController END");
35 }
38 }
36
39
37 void DataSourceController::finalize()
40 void DataSourceController::finalize()
38 {
41 {
39 impl->m_WorkingMutex.unlock();
42 impl->m_WorkingMutex.unlock();
40 }
43 }
41
44
42 void DataSourceController::waitForFinish()
45 void DataSourceController::waitForFinish()
43 {
46 {
44 QMutexLocker locker(&impl->m_WorkingMutex);
47 QMutexLocker locker(&impl->m_WorkingMutex);
45 }
48 }
@@ -1,159 +1,158
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)
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}")
28 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
27 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
29
28
30 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
29 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
31
30
32 # Add sqpcore to the list of libraries to use
31 # Add sqpcore to the list of libraries to use
33 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
32 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
34
33
35 # Add dependent shared libraries
34 # Add dependent shared libraries
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
35 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
37
36
38
37
39 # Ui files
38 # Ui files
40 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
39 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
41
40
42 # Resources files
41 # Resources files
43 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
42 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
44
43
45 #
44 #
46 # Compile the library library
45 # Compile the library library
47 #
46 #
48 FILE (GLOB_RECURSE MODULE_SOURCES
47 FILE (GLOB_RECURSE MODULE_SOURCES
49 ${INCLUDES_DIR}/*.h
48 ${INCLUDES_DIR}/*.h
50 ${SOURCES_DIR}/*.c
49 ${SOURCES_DIR}/*.c
51 ${SOURCES_DIR}/*.cpp
50 ${SOURCES_DIR}/*.cpp
52 ${SOURCES_DIR}/*.h
51 ${SOURCES_DIR}/*.h
53 ${PROJECT_FORMS})
52 ${PROJECT_FORMS})
54
53
55 QT5_ADD_RESOURCES(RCC_HDRS
54 QT5_ADD_RESOURCES(RCC_HDRS
56 ${PROJECT_RESOURCES}
55 ${PROJECT_RESOURCES}
57 )
56 )
58
57
59 QT5_WRAP_UI(UIS_HDRS
58 QT5_WRAP_UI(UIS_HDRS
60 ${PROJECT_FORMS}
59 ${PROJECT_FORMS}
61 )
60 )
62
61
63
62
64 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
63 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
64 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
66 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67
66
68 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
67 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
69 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets)
68 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets)
70
69
71 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
70 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
72 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
71 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
73 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
72 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
74 IF(BUILD_SHARED_LIBS)
73 IF(BUILD_SHARED_LIBS)
75 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
74 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
76 ELSE()
75 ELSE()
77 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
76 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
78 ENDIF()
77 ENDIF()
79
78
80 # Set the variable to parent scope so that the other projects can copy the
79 # Set the variable to parent scope so that the other projects can copy the
81 # dependent shared libraries
80 # dependent shared libraries
82 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
81 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
83
82
84 # Copy extern shared libraries to the lib folder
83 # Copy extern shared libraries to the lib folder
85 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
84 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
86
85
87 # Add the files to the list of files to be analyzed
86 # Add the files to the list of files to be analyzed
88 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
87 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
89 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
88 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
90 # Vera++ exclusion files
89 # Vera++ exclusion files
91 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
90 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
92 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
91 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
93
92
94 #
93 #
95 # Compile the tests
94 # Compile the tests
96 #
95 #
97 IF(BUILD_TESTS)
96 IF(BUILD_TESTS)
98 INCLUDE_DIRECTORIES(${SOURCES_DIR})
97 INCLUDE_DIRECTORIES(${SOURCES_DIR})
99 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
98 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
100 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
99 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
101 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
100 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
102
101
103 FOREACH( testFile ${TESTS_SOURCES} )
102 FOREACH( testFile ${TESTS_SOURCES} )
104 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
103 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
105 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
104 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
106
105
107 # Add to the list of sources files all the sources in the same
106 # Add to the list of sources files all the sources in the same
108 # directory that aren't another test
107 # directory that aren't another test
109 FILE (GLOB currentTestSources
108 FILE (GLOB currentTestSources
110 ${testDirectory}/*.c
109 ${testDirectory}/*.c
111 ${testDirectory}/*.cpp
110 ${testDirectory}/*.cpp
112 ${testDirectory}/*.h)
111 ${testDirectory}/*.h)
113 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
112 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
114 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
113 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
115
114
116 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
115 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
117 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
116 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
118 qt5_use_modules(${testName} Test)
117 qt5_use_modules(${testName} Test)
119
118
120 ADD_TEST( NAME ${testName} COMMAND ${testName} )
119 ADD_TEST( NAME ${testName} COMMAND ${testName} )
121
120
122 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
121 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
123 ENDFOREACH( testFile )
122 ENDFOREACH( testFile )
124
123
125 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
124 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
126 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
125 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
127 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
126 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
128 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
127 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
129 ENDIF(BUILD_TESTS)
128 ENDIF(BUILD_TESTS)
130
129
131 #
130 #
132 # Set the files that must be formatted by clang-format.
131 # Set the files that must be formatted by clang-format.
133 #
132 #
134 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
133 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
135 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
134 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
136
135
137 #
136 #
138 # Set the directories that doxygen must browse to generate the
137 # Set the directories that doxygen must browse to generate the
139 # documentation.
138 # documentation.
140 #
139 #
141 # Source directories:
140 # Source directories:
142 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
141 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
143 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
142 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
144 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
143 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
145 # Source directories to exclude from the documentation generation
144 # Source directories to exclude from the documentation generation
146 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
145 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
147 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
146 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
148
147
149 #
148 #
150 # Set the directories with the sources to analyze and propagate the
149 # Set the directories with the sources to analyze and propagate the
151 # modification to the parent scope
150 # modification to the parent scope
152 #
151 #
153 # Source directories to analyze:
152 # Source directories to analyze:
154 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
153 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
155 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
154 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
156 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
155 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
157 # Source directories to exclude from the analysis
156 # Source directories to exclude from the analysis
158 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
157 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
159 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
158 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
General Comments 3
Under Review
author

Auto status change to "Under Review"

Approved
author

Status change > Approved

You need to be logged in to leave comments. Login now