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