From 36eb6adb226ca496a2f9ee2a804622ea8b8d8115 2017-05-29 16:33:19 From: perrinel Date: 2017-05-29 16:33:19 Subject: [PATCH] Merge pull request #132 from SCIQLOP-Initialisation feature/initializationTestLogVera Feature/initializationTestLogVera --- diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 959e34c..e160ed8 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -16,7 +16,6 @@ SCIQLOP_FIND_QT(Core Widgets) # ======================== find_package(sciqlop-gui) -message("Librairies inclues dans APP: ${SCIQLOP-GUI_LIBRARIES}") SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES}) SET(EXTERN_SHARED_LIBRARIES) diff --git a/cmake/sciqlop_applications.cmake b/cmake/sciqlop_applications.cmake index b4fb446..9b41ac3 100644 --- a/cmake/sciqlop_applications.cmake +++ b/cmake/sciqlop_applications.cmake @@ -5,7 +5,13 @@ # SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) - +IF (UNIX) + SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject) +ELSEIF(WIN32) + SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}/app/QtProject) +ELSE() + SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/${CMAKE_BUILD_TYPE}) +ENDIF() # # Compile the diffents modules @@ -20,9 +26,17 @@ ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui") ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app") +# LOGGER +set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini") +FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH}) + + # # Code formatting # +# Vera++ exclusion files +LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt) +SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) INCLUDE ("cmake/sciqlop_formatting.cmake") # diff --git a/cmake/sciqlop_params.cmake b/cmake/sciqlop_params.cmake index 880f268..cfb64d5 100644 --- a/cmake/sciqlop_params.cmake +++ b/cmake/sciqlop_params.cmake @@ -17,6 +17,15 @@ # SET (DEBUG_SUFFIX "") #ENDIF() +IF(CMAKE_BUILD_TYPE MATCHES "Debug") + SET (CMAKE_BUILD_TYPE "Debug") + SET (DEBUG_SUFFIX "d") +ELSE() + MESSAGE (STATUS "Build in Release") + SET (SCIQLOP_BUILD_TYPE "Release") + SET (DEBUG_SUFFIX "") +ENDIF() + # # Need to compile tests? # diff --git a/config/QtProject/qtlogging.ini b/config/QtProject/qtlogging.ini new file mode 100755 index 0000000..3f38f60 --- /dev/null +++ b/config/QtProject/qtlogging.ini @@ -0,0 +1,4 @@ +[Rules] +*.debug=false +SqpApplication.debug=true +DataSourceController.debug=true diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 6313ed2..27e4fb1 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -57,7 +57,7 @@ SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) # Vera++ exclusion files -#LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) +LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt) SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) # diff --git a/core/include/Common/spimpl.h b/core/include/Common/spimpl.h index d58c7e4..b4d5e04 100644 --- a/core/include/Common/spimpl.h +++ b/core/include/Common/spimpl.h @@ -30,7 +30,6 @@ #include #include - #if defined _MSC_VER && _MSC_VER < 1900 // MS Visual Studio before VS2015 #define SPIMPL_NO_CPP11_NOEXCEPT #define SPIMPL_NO_CPP11_CONSTEXPR diff --git a/core/src/DataSource/DataSourceController.cpp b/core/src/DataSource/DataSourceController.cpp index ed71deb..40ac74d 100644 --- a/core/src/DataSource/DataSourceController.cpp +++ b/core/src/DataSource/DataSourceController.cpp @@ -3,7 +3,10 @@ #include #include -Q_LOGGING_CATEGORY(LOG_DataSourceController, "dataSourceController") +#include +#include + +Q_LOGGING_CATEGORY(LOG_DataSourceController, "DataSourceController") class DataSourceController::DataSourceControllerPrivate { public: diff --git a/core/vera-exclusions/exclusions.txt b/core/vera-exclusions/exclusions.txt new file mode 100644 index 0000000..15b0dba --- /dev/null +++ b/core/vera-exclusions/exclusions.txt @@ -0,0 +1,3 @@ +# On ignore toutes les règles vera++ pour le fichier spimpl +Common/spimpl\.h:\d+:.* + diff --git a/formatting/vera-exclusions/exclusions.txt b/formatting/vera-exclusions/exclusions.txt new file mode 100644 index 0000000..44b1f23 --- /dev/null +++ b/formatting/vera-exclusions/exclusions.txt @@ -0,0 +1,4 @@ +# On ignore toutes les règles vera++ pour le fichier spimpl + +.*IPSIS_S04_METHOD.*found: Q_DECLARE_LOGGING_CATEGORY.* +.*IPSIS_S04_VARIABLE.*found: impl.* diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 117e771..e3cd44b 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -24,7 +24,6 @@ SCIQLOP_FIND_QT(Core Widgets) # ======================== find_package(sciqlop-core) -message("Librairies inclues dans APP: ${SCIQLOP-CORE_LIBRARIES}") SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES}) INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR}) diff --git a/gui/include/SqpApplication.h b/gui/include/SqpApplication.h index 7114ca5..997d97a 100644 --- a/gui/include/SqpApplication.h +++ b/gui/include/SqpApplication.h @@ -18,6 +18,7 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication) * method will ba able to access it. * You can load a data source driver plugin then create a data source. */ + class SqpApplication : public QApplication { Q_OBJECT public: diff --git a/gui/src/SqpApplication.cpp b/gui/src/SqpApplication.cpp index 6900d5f..c510e53 100644 --- a/gui/src/SqpApplication.cpp +++ b/gui/src/SqpApplication.cpp @@ -8,10 +8,9 @@ Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication") class SqpApplication::SqpApplicationPrivate { public: SqpApplicationPrivate() {} - ~SqpApplicationPrivate() + virtual ~SqpApplicationPrivate() { qCInfo(LOG_SqpApplication()) << tr("Desctruction du SqpApplicationPrivate"); - ; m_DataSourceControllerThread.quit(); m_DataSourceControllerThread.wait(); }