##// END OF EJS Templates
Configuration update to permit make install on linux
perrinel -
r239:40b3607afb8e
parent child
Show More
@@ -1,152 +1,157
1
1
2 ## sciqlop - CMakeLists.txt
2 ## sciqlop - CMakeLists.txt
3 SET(EXECUTABLE_NAME "sciqlop")
3 SET(EXECUTABLE_NAME "sciqlop")
4 SCIQLOP_SET_TO_PARENT_SCOPE(EXECUTABLE_NAME)
4 SCIQLOP_SET_TO_PARENT_SCOPE(EXECUTABLE_NAME)
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
12
13 #
13 #
14 # Find Qt modules
14 # Find Qt modules
15 #
15 #
16 SCIQLOP_FIND_QT(Core Widgets)
16 SCIQLOP_FIND_QT(Core Widgets)
17
17
18
18
19 #
19 #
20 # Find dependent libraries
20 # Find dependent libraries
21 # ========================
21 # ========================
22 find_package(sciqlop-gui)
22 find_package(sciqlop-gui)
23
23
24 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
24 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
25 SET(EXTERN_SHARED_LIBRARIES)
25 SET(EXTERN_SHARED_LIBRARIES)
26
26
27 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
27 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
28
28
29 # Add sqpcore to the list of libraries to use
29 # Add sqpcore to the list of libraries to use
30 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
30 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
31
31
32 # Include core directory
32 # Include core directory
33 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
33 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
34
34
35 # Add dependent shared libraries
35 # Add dependent shared libraries
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
37
37
38 # Retrieve the location of the dynamic library to copy it to the output path
38 # Retrieve the location of the dynamic library to copy it to the output path
39 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
39 #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
40 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
40 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
41
41
42 # Ui files
42 # Ui files
43 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
43 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
44
44
45 #
45 #
46 # Compile the application
46 # Compile the application
47 #
47 #
48 FILE (GLOB_RECURSE APPLICATION_SOURCES
48 FILE (GLOB_RECURSE APPLICATION_SOURCES
49 ${INCLUDES_DIR}/*.h
49 ${INCLUDES_DIR}/*.h
50 ${SOURCES_DIR}/*.c
50 ${SOURCES_DIR}/*.c
51 ${SOURCES_DIR}/*.cpp
51 ${SOURCES_DIR}/*.cpp
52 ${SOURCES_DIR}/*.h
52 ${SOURCES_DIR}/*.h
53 ${PROJECT_FORMS})
53 ${PROJECT_FORMS})
54
54
55 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
55 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
56
56
57 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
57 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
58
58
59 QT5_WRAP_UI(UIS_HDRS
59 QT5_WRAP_UI(UIS_HDRS
60 ${PROJECT_FORMS}
60 ${PROJECT_FORMS}
61 )
61 )
62
62
63
63
64 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
64 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
65 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
65 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67 target_link_libraries(${EXECUTABLE_NAME}
67 target_link_libraries(${EXECUTABLE_NAME}
68 ${LIBRARIES})
68 ${LIBRARIES})
69
69
70 INSTALL(TARGETS ${EXECUTABLE_NAME}
71 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
72 LIBRARY DESTINATION ${INSTALL_BINARY_DIR}
73 ARCHIVE DESTINATION ${INSTALL_BINARY_DIR}
74 )
70 # Link with Qt5 modules
75 # Link with Qt5 modules
71 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
76 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
72
77
73
78
74 add_dependencies(${EXECUTABLE_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
79 add_dependencies(${EXECUTABLE_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
75
80
76
81
77
82
78 # Add the files to the list of files to be analyzed
83 # Add the files to the list of files to be analyzed
79 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
84 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
80 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
85 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
81 # Vera++ exclusion files
86 # Vera++ exclusion files
82 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
87 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
83 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
88 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
84
89
85 #
90 #
86 # Compile the tests
91 # Compile the tests
87 #
92 #
88 IF(BUILD_TESTS)
93 IF(BUILD_TESTS)
89
94
90 INCLUDE_DIRECTORIES(${SOURCES_DIR})
95 INCLUDE_DIRECTORIES(${SOURCES_DIR})
91 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
96 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
92 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
97 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
93 SET( TEST_LIBRARIES ${LIBRARIES})
98 SET( TEST_LIBRARIES ${LIBRARIES})
94
99
95 FOREACH( testFile ${TESTS_SOURCES} )
100 FOREACH( testFile ${TESTS_SOURCES} )
96 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
101 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
97 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
102 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
98
103
99 # Add to the list of sources files all the sources in the same
104 # Add to the list of sources files all the sources in the same
100 # directory that aren't another test
105 # directory that aren't another test
101 FILE (GLOB currentTestSources
106 FILE (GLOB currentTestSources
102 ${testDirectory}/*.c
107 ${testDirectory}/*.c
103 ${testDirectory}/*.cpp
108 ${testDirectory}/*.cpp
104 ${testDirectory}/*.h)
109 ${testDirectory}/*.h)
105 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
110 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
106 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
111 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
107
112
108 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
113 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
109 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
114 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
110 qt5_use_modules(${testName} Test)
115 qt5_use_modules(${testName} Test)
111
116
112 ADD_TEST( NAME ${testName} COMMAND ${testName} )
117 ADD_TEST( NAME ${testName} COMMAND ${testName} )
113
118
114 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
119 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
115 ENDFOREACH( testFile )
120 ENDFOREACH( testFile )
116
121
117 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
122 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
118 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
123 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
119 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
124 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
120
125
121 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
126 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
122 ENDIF(BUILD_TESTS)
127 ENDIF(BUILD_TESTS)
123
128
124 #
129 #
125 # Set the files that must be formatted by clang-format.
130 # Set the files that must be formatted by clang-format.
126 #
131 #
127 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
132 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
128 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
133 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
129
134
130 #
135 #
131 # Set the directories that doxygen must browse to generate the
136 # Set the directories that doxygen must browse to generate the
132 # documentation.
137 # documentation.
133 #
138 #
134 # Source directories:
139 # Source directories:
135 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
140 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
136 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
141 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
137 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
142 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
138 # Source directories to exclude from the documentation generation
143 # Source directories to exclude from the documentation generation
139 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
144 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
140 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
145 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
141
146
142 #
147 #
143 # Set the directories with the sources to analyze and propagate the
148 # Set the directories with the sources to analyze and propagate the
144 # modification to the parent scope
149 # modification to the parent scope
145 #
150 #
146 # Source directories to analyze:
151 # Source directories to analyze:
147 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
152 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
148 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
153 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
149 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
154 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
150 # Source directories to exclude from the analysis
155 # Source directories to exclude from the analysis
151 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
156 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
152 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
157 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,59 +1,80
1 /*------------------------------------------------------------------------------
1 /*------------------------------------------------------------------------------
2 -- This file is a part of the QLop Software
2 -- This file is a part of the QLop Software
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
3 -- Copyright (C) 2015, Plasma Physics Laboratory - CNRS
4 --
4 --
5 -- This program is free software; you can redistribute it and/or modify
5 -- This program is free software; you can redistribute it and/or modify
6 -- it under the terms of the GNU General Public License as published by
6 -- it under the terms of the GNU General Public License as published by
7 -- the Free Software Foundation; either version 2 of the License, or
7 -- the Free Software Foundation; either version 2 of the License, or
8 -- (at your option) any later version.
8 -- (at your option) any later version.
9 --
9 --
10 -- This program is distributed in the hope that it will be useful,
10 -- This program is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 -- GNU General Public License for more details.
13 -- GNU General Public License for more details.
14 --
14 --
15 -- You should have received a copy of the GNU General Public License
15 -- You should have received a copy of the GNU General Public License
16 -- along with this program; if not, write to the Free Software
16 -- along with this program; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 -------------------------------------------------------------------------------*/
18 -------------------------------------------------------------------------------*/
19 /*-- Author : Alexis Jeandet
19 /*-- Author : Alexis Jeandet
20 -- Mail : alexis.jeandet@member.fsf.org
20 -- Mail : alexis.jeandet@member.fsf.org
21 ----------------------------------------------------------------------------*/
21 ----------------------------------------------------------------------------*/
22 #include "MainWindow.h"
22 #include "MainWindow.h"
23 #include <QProcessEnvironment>
23 #include <QProcessEnvironment>
24 #include <QThread>
24 #include <QThread>
25 #include <SqpApplication.h>
25 #include <SqpApplication.h>
26 #include <qglobal.h>
26 #include <qglobal.h>
27
27
28 #include <Plugin/PluginManager.h>
28 #include <Plugin/PluginManager.h>
29 #include <QDir>
29 #include <QDir>
30
30
31 namespace {
31 namespace {
32
32
33 /// Name of the directory containing the plugins
33 /// Name of the directory containing the plugins
34
35 #if _WIN32 || _WIN64
34 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
36 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
37 #endif
38
35
39
40 #if __GNUC__
41 #if __x86_64__ || __ppc64__
42 #define ENVIRONMENT64
43 #else
44 #define ENVIRONMENT32
45 #endif
46 #endif
36 } // namespace
47 } // namespace
37
48
38 int main(int argc, char *argv[])
49 int main(int argc, char *argv[])
39 {
50 {
40 SqpApplication a{argc, argv};
51 SqpApplication a{argc, argv};
41 SqpApplication::setOrganizationName("LPP");
52 SqpApplication::setOrganizationName("LPP");
42 SqpApplication::setOrganizationDomain("lpp.fr");
53 SqpApplication::setOrganizationDomain("lpp.fr");
43 SqpApplication::setApplicationName("SciQLop");
54 SqpApplication::setApplicationName("SciQLop");
44 MainWindow w;
55 MainWindow w;
45 w.show();
56 w.show();
46
57
47 // Loads plugins
58 // Loads plugins
48 auto pluginDir = QDir{sqpApp->applicationDirPath()};
59 auto pluginDir = QDir{sqpApp->applicationDirPath()};
60 #if _WIN32 || _WIN64
49 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
61 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
50 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
62 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
63 #endif
64
51
65
66 #if __GNUC__
67 #if __x86_64__ || __ppc64__
68 pluginDir.cd("../lib64/SciQlop");
69 #else
70 pluginDir.cd("../lib/SciQlop");
71 #endif
72 #endif
52 qCDebug(LOG_PluginManager())
73 qCDebug(LOG_PluginManager())
53 << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
74 << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
54
75
55 PluginManager pluginManager{};
76 PluginManager pluginManager{};
56 pluginManager.loadPlugins(pluginDir);
77 pluginManager.loadPlugins(pluginDir);
57
78
58 return a.exec();
79 return a.exec();
59 }
80 }
@@ -1,67 +1,53
1 #
2 # Sciqlop_modules.cmake
3 #
4 # Set ouptut directories
5 #
6 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
7 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
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/app/QtProject)
12 ELSE()
13 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
14 ENDIF()
15
1
16 if(BUILD_TESTS)
2 if(BUILD_TESTS)
17 INCLUDE ("cmake/sciqlop_code_coverage.cmake")
3 INCLUDE ("cmake/sciqlop_code_coverage.cmake")
18 APPEND_COVERAGE_COMPILER_FLAGS()
4 APPEND_COVERAGE_COMPILER_FLAGS()
19 endif(BUILD_TESTS)
5 endif(BUILD_TESTS)
20
6
21 #
7 #
22 # Compile the diffents modules
8 # Compile the diffents modules
23 #
9 #
24 set(sciqlop-plugin_DIR "${CMAKE_SOURCE_DIR}/plugin/cmake")
10 set(sciqlop-plugin_DIR "${CMAKE_SOURCE_DIR}/plugin/cmake")
25 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-plugin_DIR}")
11 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-plugin_DIR}")
26 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugin")
12 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugin")
27
13
28 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
14 set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake")
29 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
15 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}")
30 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
16 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core")
31
17
32 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
18 set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake")
33 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
19 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}")
34 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
20 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui")
35
21
36 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
22 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app")
37
23
38 OPTION (BUILD_PLUGINS "Build the plugins" OFF)
24 OPTION (BUILD_PLUGINS "Build the plugins" OFF)
39 IF(BUILD_PLUGINS)
25 IF(BUILD_PLUGINS)
40 set(sciqlop-mockplugin_DIR "${CMAKE_SOURCE_DIR}/plugins/mockplugin/cmake")
26 set(sciqlop-mockplugin_DIR "${CMAKE_SOURCE_DIR}/plugins/mockplugin/cmake")
41 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-mockplugin_DIR}")
27 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-mockplugin_DIR}")
42 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/mockplugin")
28 ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/mockplugin")
43 ENDIF(BUILD_PLUGINS)
29 ENDIF(BUILD_PLUGINS)
44
30
45 # LOGGER
31 # LOGGER
46 set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini")
32 set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini")
47 FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH})
33 FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH})
48
34
49
35
50 #
36 #
51 # Code formatting
37 # Code formatting
52 #
38 #
53 # Vera++ exclusion files
39 # Vera++ exclusion files
54 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt)
40 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt)
55 #SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
41 #SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
56 INCLUDE ("cmake/sciqlop_formatting.cmake")
42 INCLUDE ("cmake/sciqlop_formatting.cmake")
57
43
58 #
44 #
59 # Documentation generation
45 # Documentation generation
60 #
46 #
61 INCLUDE ("cmake/sciqlop_doxygen.cmake")
47 INCLUDE ("cmake/sciqlop_doxygen.cmake")
62
48
63 #
49 #
64 # Source code analysis
50 # Source code analysis
65 #
51 #
66 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
52 INCLUDE ("cmake/sciqlop_code_analysis.cmake")
67 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
53 INCLUDE ("cmake/sciqlop_code_cppcheck.cmake")
@@ -1,86 +1,128
1 #
1 #
2 # sciqlop_params : Define compilation parameters
2 # sciqlop_params : Define compilation parameters
3 #
3 #
4 # Debug or release
4 # Debug or release
5 #
5 #
6 # As the "NMake Makefiles" forces by default the CMAKE_BUILD_TYPE variable to Debug, SCIQLOP_BUILD_TYPE variable is used to be sure that the debug mode is a user choice
6 # As the "NMake Makefiles" forces by default the CMAKE_BUILD_TYPE variable to Debug, SCIQLOP_BUILD_TYPE variable is used to be sure that the debug mode is a user choice
7 #SET(SCIQLOP_BUILD_TYPE "Release" CACHE STRING "Choose to compile in Debug or Release mode")
7 #SET(SCIQLOP_BUILD_TYPE "Release" CACHE STRING "Choose to compile in Debug or Release mode")
8
8
9 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
9 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
10 SET (DEBUG_SUFFIX "d")
10 SET (DEBUG_SUFFIX "d")
11 ELSE()
11 ELSE()
12 MESSAGE (STATUS "Build in Release")
12 MESSAGE (STATUS "Build in Release")
13 SET (DEBUG_SUFFIX "")
13 SET (DEBUG_SUFFIX "")
14 ENDIF()
14 ENDIF()
15
15
16 #
16 #
17 # Need to compile tests?
17 # Need to compile tests?
18 #
18 #
19 OPTION (BUILD_TESTS "Build the tests" OFF)
19 OPTION (BUILD_TESTS "Build the tests" OFF)
20 ENABLE_TESTING(${BUILD_TESTS})
20 ENABLE_TESTING(${BUILD_TESTS})
21
21
22 #
22 #
23 # Path to the folder for sciqlop's extern libraries.
23 # Path to the folder for sciqlop's extern libraries.
24 #
24 #
25 # When looking for an external library in sciqlop, we look to the following
25 # When looking for an external library in sciqlop, we look to the following
26 # folders:
26 # folders:
27 # - The specific folder for the library (generally of the form <LIBRARY>_ROOT_DIR
27 # - The specific folder for the library (generally of the form <LIBRARY>_ROOT_DIR
28 # - The global Sciqlop extern folder
28 # - The global Sciqlop extern folder
29 # - The system folders.
29 # - The system folders.
30 #
30 #
31 # If a dependency is found in the global extern folder or a specific folder for
31 # If a dependency is found in the global extern folder or a specific folder for
32 # the library, then it is installed with the sciqlop libraries. If it is found
32 # the library, then it is installed with the sciqlop libraries. If it is found
33 # in the system folders, it is not. This behavior can be overriden with the
33 # in the system folders, it is not. This behavior can be overriden with the
34 # <LIBRARY>_COPY_SHARED_LIBRARIES flag.
34 # <LIBRARY>_COPY_SHARED_LIBRARIES flag.
35 #
35 #
36 set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern"
36 set(SCIQLOP_EXTERN_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/extern"
37 CACHE PATH "Path to the folder for sciqlop's extern libraries")
37 CACHE PATH "Path to the folder for sciqlop's extern libraries")
38 option(SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR "Force the <LIBRARY>_ROOT_DIR to be updated to the global sciqlop extern folder"
38 option(SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR "Force the <LIBRARY>_ROOT_DIR to be updated to the global sciqlop extern folder"
39 OFF)
39 OFF)
40
40
41 if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR)
41 if (SCIQLOP_FORCE_UPDATE_EXT_ROOT_DIR)
42 set(libRootDirForceValue FORCE)
42 set(libRootDirForceValue FORCE)
43 else()
43 else()
44 set(libRootDirForceValue)
44 set(libRootDirForceValue)
45 endif()
45 endif()
46
46
47 #
48 # Sciqlop_modules.cmake
49 #
50 # Set ouptut directories
51 #
52 IF (UNIX)
53 # 32 or 64 bits compiler
54 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
55 SET(defaultLib "lib64/sciqlop")
56 ELSE()
57 SET(defaultLib "lib/sciqlop")
58 ENDIF()
59 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
60 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
61 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${defaultLib})
62 ELSEIF(WIN32)
63 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
64 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
65 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/app/QtProject)
66 ELSE()
67 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
68 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
69 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
70 ENDIF()
47
71
48
72
49 #
73 #
50 # Static or shared libraries
74 # Static or shared libraries
51 #
75 #
52 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
76 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
53
77
54 # Generate position independant code (-fPIC)
78 # Generate position independant code (-fPIC)
55 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
79 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
56
80
57 #
81
58 # Configure installation directories
82
59 #
83 # Configuration for make install
84
85 set(PROJECT_PLUGIN_PREFIX "SciQlop")
86
60 IF (UNIX)
87 IF (UNIX)
88 SET(CMAKE_INSTALL_PREFIX "/usr/local/${PROJECT_PLUGIN_PREFIX}")
61 SET(defaultBin "bin")
89 SET(defaultBin "bin")
62 SET(defaultInc "include/sciqlop")
90 SET(defaultInc "include/sciqlop")
63
91
64 # 32 or 64 bits compiler
92 # 32 or 64 bits compiler
65 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
93 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
66 SET(defaultLib "lib64/sciqlop")
94 SET(defaultLib "lib64")
95 SET(defaultPluginsLib "lib64/${PROJECT_PLUGIN_PREFIX}")
67 ELSE()
96 ELSE()
68 SET(defaultLib "lib/sciqlop")
97 SET(defaultLib "lib/")
98 SET(defaultPluginsLib "lib/${PROJECT_PLUGIN_PREFIX}")
69 ENDIF()
99 ENDIF()
70
100
71 SET(defaultDoc "share/docs/sciqlop")
101 SET(defaultDoc "share/docs/${PROJECT_PLUGIN_PREFIX}")
72 ELSE()
102 ELSE()
73 SET(defaultBin "bin")
103 SET(defaultBin "bin")
74 SET(defaultInc "include/sciqlop")
104 SET(defaultInc "include/${PROJECT_PLUGIN_PREFIX}")
75 SET(defaultLib "lib/sciqlop")
105 SET(defaultLib "lib")
76 SET(defaultDoc "docs/sciqlop")
106 SET(defaultPluginsLib "lib/${PROJECT_PLUGIN_PREFIX}")
107 SET(defaultDoc "docs/${PROJECT_PLUGIN_PREFIX}")
77 ENDIF()
108 ENDIF()
78
109
79 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
110 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
80 "Installation directory for binaries")
111 "Installation directory for binaries")
81 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
112 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
82 "Installation directory for libraries")
113 "Installation directory for libraries")
114 SET(INSTALL_PLUGINS_LIBRARY_DIR "${defaultPluginsLib}" CACHE STRING
115 "Installation directory for libraries")
83 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
116 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
84 "Installation directory for headers")
117 "Installation directory for headers")
85 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
118 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
86 "Installation directory for documentations")
119 "Installation directory for documentations")
120
121
122 # Set the rpath when installing
123 SET(CMAKE_SKIP_BUILD_RPATH FALSE)
124 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
125 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
126 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
127
128 message("Install RPATH: ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
@@ -1,147 +1,153
1
1
2 ## core - CMakeLists.txt
2 ## core - CMakeLists.txt
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
7
7
8 # Include core directory
8 # Include core directory
9 include_directories("${INCLUDES_DIR}")
9 include_directories("${INCLUDES_DIR}")
10
10
11 # Set a variable to display a warning in the version files.
11 # Set a variable to display a warning in the version files.
12 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
12 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
13 # Generate the version file from the cmake version variables. The version
13 # Generate the version file from the cmake version variables. The version
14 # variables are defined in the cmake/sciqlop_version.cmake file.
14 # variables are defined in the cmake/sciqlop_version.cmake file.
15 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
15 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
16 "${INCLUDES_DIR}/Version.h")
16 "${INCLUDES_DIR}/Version.h")
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
18 "${SOURCES_DIR}/Version.cpp")
18 "${SOURCES_DIR}/Version.cpp")
19
19
20 # Find dependent modules
20 # Find dependent modules
21 find_package(sciqlop-plugin)
21 find_package(sciqlop-plugin)
22 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
22 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
23
23
24 #
24 #
25 # Find Qt modules
25 # Find Qt modules
26 #
26 #
27 SCIQLOP_FIND_QT(Core)
27 SCIQLOP_FIND_QT(Core)
28
28
29 #
29 #
30 # Compile the library library
30 # Compile the library library
31 #
31 #
32 FILE (GLOB_RECURSE MODULE_SOURCES
32 FILE (GLOB_RECURSE MODULE_SOURCES
33 ${INCLUDES_DIR}/*.h
33 ${INCLUDES_DIR}/*.h
34 ${SOURCES_DIR}/*.c
34 ${SOURCES_DIR}/*.c
35 ${SOURCES_DIR}/*.cpp
35 ${SOURCES_DIR}/*.cpp
36 ${SOURCES_DIR}/*.h)
36 ${SOURCES_DIR}/*.h)
37
37
38 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
38 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
39 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
39 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
40 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
40 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
41 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
41 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
42 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
42 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
43
43
44 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
45 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
46 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
47 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
48 )
49
44 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
50 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
45 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
51 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
46 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
52 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
47 IF(BUILD_SHARED_LIBS)
53 IF(BUILD_SHARED_LIBS)
48 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
54 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
49 ELSE()
55 ELSE()
50 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
56 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
51 ENDIF()
57 ENDIF()
52
58
53 # Set the variable to parent scope so that the other projects can copy the
59 # Set the variable to parent scope so that the other projects can copy the
54 # dependent shared libraries
60 # dependent shared libraries
55 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
61 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
56
62
57 # Copy extern shared libraries to the lib folder
63 # Copy extern shared libraries to the lib folder
58 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
64 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
59
65
60 # Add the files to the list of files to be analyzed
66 # Add the files to the list of files to be analyzed
61 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
67 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
62 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
68 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
63 # Vera++ exclusion files
69 # Vera++ exclusion files
64 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
70 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
65 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
71 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
66
72
67 #
73 #
68 # Compile the tests
74 # Compile the tests
69 #
75 #
70 IF(BUILD_TESTS)
76 IF(BUILD_TESTS)
71 INCLUDE_DIRECTORIES(${SOURCES_DIR})
77 INCLUDE_DIRECTORIES(${SOURCES_DIR})
72 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
78 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
73 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
79 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
74 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
80 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
75
81
76 SET(TARGETS_COV)
82 SET(TARGETS_COV)
77 FOREACH( testFile ${TESTS_SOURCES} )
83 FOREACH( testFile ${TESTS_SOURCES} )
78 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
84 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
79 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
85 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
80
86
81 # Add to the list of sources files all the sources in the same
87 # Add to the list of sources files all the sources in the same
82 # directory that aren't another test
88 # directory that aren't another test
83 FILE (GLOB currentTestSources
89 FILE (GLOB currentTestSources
84 ${testDirectory}/*.c
90 ${testDirectory}/*.c
85 ${testDirectory}/*.cpp
91 ${testDirectory}/*.cpp
86 ${testDirectory}/*.h)
92 ${testDirectory}/*.h)
87 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
93 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
88 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
94 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
89
95
90 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
96 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
91 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
97 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
92 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
98 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
93 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
99 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
94 qt5_use_modules(${testName} Test)
100 qt5_use_modules(${testName} Test)
95
101
96 ADD_TEST( NAME ${testName} COMMAND ${testName} )
102 ADD_TEST( NAME ${testName} COMMAND ${testName} )
97
103
98 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
104 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
99 set(Coverage_NAME ${testName})
105 set(Coverage_NAME ${testName})
100 if(UNIX)
106 if(UNIX)
101 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
107 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
102 LIST( APPEND TARGETS_COV ${testName}_coverage)
108 LIST( APPEND TARGETS_COV ${testName}_coverage)
103 endif(UNIX)
109 endif(UNIX)
104
110
105 ENDFOREACH( testFile )
111 ENDFOREACH( testFile )
106
112
107 add_custom_target(coverage)
113 add_custom_target(coverage)
108
114
109 FOREACH( target_cov ${TARGETS_COV} )
115 FOREACH( target_cov ${TARGETS_COV} )
110 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
116 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
111 ENDFOREACH( target_cov )
117 ENDFOREACH( target_cov )
112
118
113 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
119 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
114 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
120 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
115 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
121 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
116 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
122 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
117 ENDIF(BUILD_TESTS)
123 ENDIF(BUILD_TESTS)
118
124
119 #
125 #
120 # Set the files that must be formatted by clang-format.
126 # Set the files that must be formatted by clang-format.
121 #
127 #
122 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
128 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
123 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
129 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
124
130
125 #
131 #
126 # Set the directories that doxygen must browse to generate the
132 # Set the directories that doxygen must browse to generate the
127 # documentation.
133 # documentation.
128 #
134 #
129 # Source directories:
135 # Source directories:
130 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
136 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
131 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
137 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
132 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
138 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
133 # Source directories to exclude from the documentation generation
139 # Source directories to exclude from the documentation generation
134 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
140 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
135 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
141 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
136
142
137 #
143 #
138 # Set the directories with the sources to analyze and propagate the
144 # Set the directories with the sources to analyze and propagate the
139 # modification to the parent scope
145 # modification to the parent scope
140 #
146 #
141 # Source directories to analyze:
147 # Source directories to analyze:
142 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
148 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
143 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
149 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
144 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
150 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
145 # Source directories to exclude from the analysis
151 # Source directories to exclude from the analysis
146 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
152 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
147 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
153 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,42 +1,44
1 #include <DataSource/DataSourceItemAction.h>
1 #include <DataSource/DataSourceItemAction.h>
2
2
3 #include <functional>
4
3 Q_LOGGING_CATEGORY(LOG_DataSourceItemAction, "DataSourceItemAction")
5 Q_LOGGING_CATEGORY(LOG_DataSourceItemAction, "DataSourceItemAction")
4
6
5 struct DataSourceItemAction::DataSourceItemActionPrivate {
7 struct DataSourceItemAction::DataSourceItemActionPrivate {
6 explicit DataSourceItemActionPrivate(const QString &name,
8 explicit DataSourceItemActionPrivate(const QString &name,
7 DataSourceItemAction::ExecuteFunction fun)
9 DataSourceItemAction::ExecuteFunction fun)
8 : m_Name{name}, m_Fun{std::move(fun)}, m_DataSourceItem{nullptr}
10 : m_Name{name}, m_Fun{std::move(fun)}, m_DataSourceItem{nullptr}
9 {
11 {
10 }
12 }
11
13
12 QString m_Name;
14 QString m_Name;
13 DataSourceItemAction::ExecuteFunction m_Fun;
15 DataSourceItemAction::ExecuteFunction m_Fun;
14 /// Item associated to the action (can be null, in which case the action will not be executed)
16 /// Item associated to the action (can be null, in which case the action will not be executed)
15 DataSourceItem *m_DataSourceItem;
17 DataSourceItem *m_DataSourceItem;
16 };
18 };
17
19
18 DataSourceItemAction::DataSourceItemAction(const QString &name, ExecuteFunction fun)
20 DataSourceItemAction::DataSourceItemAction(const QString &name, ExecuteFunction fun)
19 : impl{spimpl::make_unique_impl<DataSourceItemActionPrivate>(name, std::move(fun))}
21 : impl{spimpl::make_unique_impl<DataSourceItemActionPrivate>(name, std::move(fun))}
20 {
22 {
21 }
23 }
22
24
23 QString DataSourceItemAction::name() const noexcept
25 QString DataSourceItemAction::name() const noexcept
24 {
26 {
25 return impl->m_Name;
27 return impl->m_Name;
26 }
28 }
27
29
28 void DataSourceItemAction::setDataSourceItem(DataSourceItem *dataSourceItem) noexcept
30 void DataSourceItemAction::setDataSourceItem(DataSourceItem *dataSourceItem) noexcept
29 {
31 {
30 impl->m_DataSourceItem = dataSourceItem;
32 impl->m_DataSourceItem = dataSourceItem;
31 }
33 }
32
34
33 void DataSourceItemAction::execute()
35 void DataSourceItemAction::execute()
34 {
36 {
35 if (impl->m_DataSourceItem) {
37 if (impl->m_DataSourceItem) {
36 impl->m_Fun(*impl->m_DataSourceItem);
38 impl->m_Fun(*impl->m_DataSourceItem);
37 }
39 }
38 else {
40 else {
39 qCDebug(LOG_DataSourceItemAction())
41 qCDebug(LOG_DataSourceItemAction())
40 << tr("Can't execute action : no item has been associated");
42 << tr("Can't execute action : no item has been associated");
41 }
43 }
42 }
44 }
@@ -1,163 +1,169
1
1
2 ## gui - CMakeLists.txt
2 ## gui - CMakeLists.txt
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_gui${DEBUG_SUFFIX}")
4 SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_gui${DEBUG_SUFFIX}")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
7 SET(UI_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/ui")
7 SET(UI_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/ui")
8 SET(RES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/resources")
8 SET(RES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/resources")
9
9
10 # Include gui directory
10 # Include gui directory
11 include_directories("${INCLUDES_DIR}")
11 include_directories("${INCLUDES_DIR}")
12 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
12 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
13
13
14 # Set a variable to display a warning in the version files.
14 # Set a variable to display a warning in the version files.
15 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
15 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
16
16
17 #
17 #
18 # Find Qt modules
18 # Find Qt modules
19 #
19 #
20 SCIQLOP_FIND_QT(Core Widgets PrintSupport)
20 SCIQLOP_FIND_QT(Core Widgets PrintSupport)
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 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
27 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
28
28
29 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
29 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
30
30
31 # Add sqpcore to the list of libraries to use
31 # Add sqpcore to the list of libraries to use
32 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
32 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
33
33
34 # Add dependent shared libraries
34 # Add dependent shared libraries
35 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
35 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
36
36
37
37
38 # Ui files
38 # Ui files
39 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
39 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
40
40
41 # Resources files
41 # Resources files
42 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
42 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
43
43
44 #
44 #
45 # Compile the library library
45 # Compile the library library
46 #
46 #
47 FILE (GLOB_RECURSE MODULE_SOURCES
47 FILE (GLOB_RECURSE MODULE_SOURCES
48 ${INCLUDES_DIR}/*.h
48 ${INCLUDES_DIR}/*.h
49 ${SOURCES_DIR}/*.c
49 ${SOURCES_DIR}/*.c
50 ${SOURCES_DIR}/*.cpp
50 ${SOURCES_DIR}/*.cpp
51 ${SOURCES_DIR}/*.h
51 ${SOURCES_DIR}/*.h
52 ${PROJECT_FORMS})
52 ${PROJECT_FORMS})
53
53
54 QT5_ADD_RESOURCES(RCC_HDRS
54 QT5_ADD_RESOURCES(RCC_HDRS
55 ${PROJECT_RESOURCES}
55 ${PROJECT_RESOURCES}
56 )
56 )
57
57
58 QT5_WRAP_UI(UIS_HDRS
58 QT5_WRAP_UI(UIS_HDRS
59 ${PROJECT_FORMS}
59 ${PROJECT_FORMS}
60 )
60 )
61
61
62
62
63 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
63 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
64 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
64 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
66
66
67 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
67 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
68 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets PrintSupport)
68 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets PrintSupport)
69
69
70
71 INSTALL(TARGETS ${SQPGUI_LIBRARY_NAME}
72 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
73 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
74 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
75 )
70 add_dependencies(${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
76 add_dependencies(${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
71
77
72
78
73 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
79 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
74 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
80 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
75 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
81 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
76 IF(BUILD_SHARED_LIBS)
82 IF(BUILD_SHARED_LIBS)
77 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
83 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
78 ELSE()
84 ELSE()
79 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
85 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
80 ENDIF()
86 ENDIF()
81
87
82 # Set the variable to parent scope so that the other projects can copy the
88 # Set the variable to parent scope so that the other projects can copy the
83 # dependent shared libraries
89 # dependent shared libraries
84 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
90 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
85
91
86 # Copy extern shared libraries to the lib folder
92 # Copy extern shared libraries to the lib folder
87 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
93 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
88
94
89 # Add the files to the list of files to be analyzed
95 # Add the files to the list of files to be analyzed
90 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
96 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
91 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
97 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
92 # Vera++ exclusion files
98 # Vera++ exclusion files
93 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
99 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
94 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
100 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
95
101
96 #
102 #
97 # Compile the tests
103 # Compile the tests
98 #
104 #
99 IF(BUILD_TESTS)
105 IF(BUILD_TESTS)
100 INCLUDE_DIRECTORIES(${SOURCES_DIR})
106 INCLUDE_DIRECTORIES(${SOURCES_DIR})
101 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
107 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
102 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
108 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
103 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
109 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
104
110
105 FOREACH( testFile ${TESTS_SOURCES} )
111 FOREACH( testFile ${TESTS_SOURCES} )
106 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
112 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
107 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
113 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
108
114
109 # Add to the list of sources files all the sources in the same
115 # Add to the list of sources files all the sources in the same
110 # directory that aren't another test
116 # directory that aren't another test
111 FILE (GLOB currentTestSources
117 FILE (GLOB currentTestSources
112 ${testDirectory}/*.c
118 ${testDirectory}/*.c
113 ${testDirectory}/*.cpp
119 ${testDirectory}/*.cpp
114 ${testDirectory}/*.h)
120 ${testDirectory}/*.h)
115 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
121 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
116 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
122 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
117
123
118 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
124 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
119 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
125 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
120 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
126 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
121 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
127 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
122 qt5_use_modules(${testName} Test)
128 qt5_use_modules(${testName} Test)
123
129
124 ADD_TEST( NAME ${testName} COMMAND ${testName} )
130 ADD_TEST( NAME ${testName} COMMAND ${testName} )
125
131
126 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
132 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
127 ENDFOREACH( testFile )
133 ENDFOREACH( testFile )
128
134
129 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
135 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
130 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
136 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
131 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
137 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
132 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
138 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
133 ENDIF(BUILD_TESTS)
139 ENDIF(BUILD_TESTS)
134
140
135 #
141 #
136 # Set the files that must be formatted by clang-format.
142 # Set the files that must be formatted by clang-format.
137 #
143 #
138 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
144 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
139 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
145 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
140
146
141 #
147 #
142 # Set the directories that doxygen must browse to generate the
148 # Set the directories that doxygen must browse to generate the
143 # documentation.
149 # documentation.
144 #
150 #
145 # Source directories:
151 # Source directories:
146 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
152 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
147 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
153 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
148 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
154 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
149 # Source directories to exclude from the documentation generation
155 # Source directories to exclude from the documentation generation
150 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
156 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
151 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
157 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
152
158
153 #
159 #
154 # Set the directories with the sources to analyze and propagate the
160 # Set the directories with the sources to analyze and propagate the
155 # modification to the parent scope
161 # modification to the parent scope
156 #
162 #
157 # Source directories to analyze:
163 # Source directories to analyze:
158 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
164 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
159 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
165 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
160 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
166 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
161 # Source directories to exclude from the analysis
167 # Source directories to exclude from the analysis
162 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
168 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
163 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
169 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,46 +1,52
1 ## plugin - CMakeLists.txt
1 ## plugin - CMakeLists.txt
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 SET(SQPPLUGIN_LIBRARY_NAME "${LIBRARY_PREFFIX}_plugin${DEBUG_SUFFIX}")
3 SET(SQPPLUGIN_LIBRARY_NAME "${LIBRARY_PREFFIX}_plugin${DEBUG_SUFFIX}")
4 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
4 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
5
5
6 # Include plugin directory
6 # Include plugin directory
7 INCLUDE_DIRECTORIES("${INCLUDES_DIR}")
7 INCLUDE_DIRECTORIES("${INCLUDES_DIR}")
8
8
9 #
9 #
10 # Find Qt modules
10 # Find Qt modules
11 #
11 #
12 SCIQLOP_FIND_QT(Core)
12 SCIQLOP_FIND_QT(Core)
13
13
14 #
14 #
15 # Compile the library
15 # Compile the library
16 #
16 #
17 FILE (GLOB_RECURSE MODULE_SOURCES
17 FILE (GLOB_RECURSE MODULE_SOURCES
18 ${INCLUDES_DIR}/*.h)
18 ${INCLUDES_DIR}/*.h)
19
19
20 ADD_LIBRARY(${SQPPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
20 ADD_LIBRARY(${SQPPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
21
21
22 INSTALL(TARGETS ${SQPPLUGIN_LIBRARY_NAME}
23 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
24 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
25 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
26 )
27
22
28
23 # Add the files to the list of files to be analyzed
29 # Add the files to the list of files to be analyzed
24 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
30 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
25 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
31 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
26 # Vera++ exclusion files
32 # Vera++ exclusion files
27 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
33 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
28 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
34 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
29
35
30 #
36 #
31 # Set the files that must be formatted by clang-format.
37 # Set the files that must be formatted by clang-format.
32 #
38 #
33 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
39 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
34 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
40 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
35
41
36 #
42 #
37 # Set the directories that doxygen must browse to generate the
43 # Set the directories that doxygen must browse to generate the
38 # documentation.
44 # documentation.
39 #
45 #
40 # Source directories:
46 # Source directories:
41 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
47 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
42 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include")
48 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include")
43 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
49 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
44 # Source directories to exclude from the documentation generation
50 # Source directories to exclude from the documentation generation
45 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
51 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
46 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
52 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
@@ -1,153 +1,160
1 ## mockplugin - CMakeLists.txt
1 ## mockplugin - CMakeLists.txt
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 SET(SQPMOCKPLUGIN_LIBRARY_NAME "${LIBRARY_PREFFIX}_mockplugin${DEBUG_SUFFIX}")
3 SET(SQPMOCKPLUGIN_LIBRARY_NAME "${LIBRARY_PREFFIX}_mockplugin${DEBUG_SUFFIX}")
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
6 SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
6 SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
7
7
8 # Include mockplugin directory
8 # Include mockplugin directory
9 INCLUDE_DIRECTORIES(${INCLUDES_DIR})
9 INCLUDE_DIRECTORIES(${INCLUDES_DIR})
10 INCLUDE_DIRECTORIES(${RESOURCES_DIR})
10 INCLUDE_DIRECTORIES(${RESOURCES_DIR})
11
11
12 #
12 #
13 # Find Qt modules
13 # Find Qt modules
14 #
14 #
15 SCIQLOP_FIND_QT(Core Widgets)
15 SCIQLOP_FIND_QT(Core Widgets)
16
16
17 #
17 #
18 # Find dependent libraries
18 # Find dependent libraries
19 # ========================
19 # ========================
20
20
21 # sciqlop plugin
21 # sciqlop plugin
22 find_package(sciqlop-plugin)
22 find_package(sciqlop-plugin)
23 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
23 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
24
24
25 # sciqlop core
25 # sciqlop core
26 find_package(sciqlop-core)
26 find_package(sciqlop-core)
27 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
27 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
28 list(APPEND LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
28 list(APPEND LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
29
29
30 # sciqlop gui
30 # sciqlop gui
31 find_package(sciqlop-gui)
31 find_package(sciqlop-gui)
32 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
32 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
33 list(APPEND LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
33 list(APPEND LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
34
34
35 # Resources files
35 # Resources files
36 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RESOURCES_DIR}/*.json)
36 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RESOURCES_DIR}/*.json)
37
37
38 #
38 #
39 # Compile the library
39 # Compile the library
40 #
40 #
41 FILE (GLOB_RECURSE MODULE_SOURCES
41 FILE (GLOB_RECURSE MODULE_SOURCES
42 ${INCLUDES_DIR}/*.h
42 ${INCLUDES_DIR}/*.h
43 ${SOURCES_DIR}/*.c
43 ${SOURCES_DIR}/*.c
44 ${SOURCES_DIR}/*.cpp
44 ${SOURCES_DIR}/*.cpp
45 ${SOURCES_DIR}/*.h
45 ${SOURCES_DIR}/*.h
46 ${PROJECT_RESOURCES})
46 ${PROJECT_RESOURCES})
47
47
48 ADD_LIBRARY(${SQPMOCKPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
48 ADD_LIBRARY(${SQPMOCKPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
49 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
49 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
50 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
50 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
51
51
52 INSTALL(TARGETS ${SQPMOCKPLUGIN_LIBRARY_NAME}
53 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
54 LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
55 ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
56 )
57
58
52 TARGET_LINK_LIBRARIES(${SQPMOCKPLUGIN_LIBRARY_NAME} ${LIBRARIES})
59 TARGET_LINK_LIBRARIES(${SQPMOCKPLUGIN_LIBRARY_NAME} ${LIBRARIES})
53 qt5_use_modules(${SQPMOCKPLUGIN_LIBRARY_NAME} Core Widgets)
60 qt5_use_modules(${SQPMOCKPLUGIN_LIBRARY_NAME} Core Widgets)
54
61
55 add_dependencies(${SQPMOCKPLUGIN_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
62 add_dependencies(${SQPMOCKPLUGIN_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
56
63
57 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
64 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
58 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
65 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
59 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
66 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
60 IF(BUILD_SHARED_LIBS)
67 IF(BUILD_SHARED_LIBS)
61 SET_TARGET_PROPERTIES(${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
68 SET_TARGET_PROPERTIES(${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
62 ELSE()
69 ELSE()
63 TARGET_COMPILE_DEFINITIONS(${SQPMOCKPLUGIN_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
70 TARGET_COMPILE_DEFINITIONS(${SQPMOCKPLUGIN_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
64 ENDIF()
71 ENDIF()
65
72
66 # Set the variable to parent scope so that the other projects can copy the
73 # Set the variable to parent scope so that the other projects can copy the
67 # dependent shared libraries
74 # dependent shared libraries
68 SCIQLOP_SET_TO_PARENT_SCOPE(SQPMOCKPLUGIN_LIBRARY_NAME)
75 SCIQLOP_SET_TO_PARENT_SCOPE(SQPMOCKPLUGIN_LIBRARY_NAME)
69
76
70 # Copy extern shared libraries to the lib folder
77 # Copy extern shared libraries to the lib folder
71 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPMOCKPLUGIN_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
78 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPMOCKPLUGIN_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
72
79
73 # Add the files to the list of files to be analyzed
80 # Add the files to the list of files to be analyzed
74 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
81 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
75 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
82 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
76 # Vera++ exclusion files
83 # Vera++ exclusion files
77 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
84 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
78 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
85 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
79
86
80 # Temporary target to copy to plugins dir
87 # Temporary target to copy to plugins dir
81 find_package(sciqlop-mockplugin)
88 find_package(sciqlop-mockplugin)
82 ADD_CUSTOM_TARGET(plugins
89 ADD_CUSTOM_TARGET(plugins
83 COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-MOCKPLUGIN_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-MOCKPLUGIN_LIBRARIES_NAME}"
90 COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-MOCKPLUGIN_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-MOCKPLUGIN_LIBRARIES_NAME}"
84 )
91 )
85
92
86 #
93 #
87 # Compile the tests
94 # Compile the tests
88 #
95 #
89 IF(BUILD_TESTS)
96 IF(BUILD_TESTS)
90 INCLUDE_DIRECTORIES(${SOURCES_DIR})
97 INCLUDE_DIRECTORIES(${SOURCES_DIR})
91 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
98 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
92 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
99 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
93 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
100 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
94
101
95 FOREACH( testFile ${TESTS_SOURCES} )
102 FOREACH( testFile ${TESTS_SOURCES} )
96 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
103 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
97 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
104 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
98
105
99 # 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
100 # directory that aren't another test
107 # directory that aren't another test
101 FILE (GLOB currentTestSources
108 FILE (GLOB currentTestSources
102 ${testDirectory}/*.c
109 ${testDirectory}/*.c
103 ${testDirectory}/*.cpp
110 ${testDirectory}/*.cpp
104 ${testDirectory}/*.h)
111 ${testDirectory}/*.h)
105 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
112 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
106 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
113 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
107
114
108 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
115 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
109 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
116 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
110 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
117 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
111 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
118 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
112 qt5_use_modules(${testName} Test)
119 qt5_use_modules(${testName} Test)
113
120
114 ADD_TEST( NAME ${testName} COMMAND ${testName} )
121 ADD_TEST( NAME ${testName} COMMAND ${testName} )
115
122
116 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
123 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
117 ENDFOREACH( testFile )
124 ENDFOREACH( testFile )
118
125
119 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
126 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
120 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
127 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
121 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
128 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
122 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
129 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
123 ENDIF(BUILD_TESTS)
130 ENDIF(BUILD_TESTS)
124
131
125 #
132 #
126 # Set the files that must be formatted by clang-format.
133 # Set the files that must be formatted by clang-format.
127 #
134 #
128 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
135 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
129 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
136 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
130
137
131 #
138 #
132 # Set the directories that doxygen must browse to generate the
139 # Set the directories that doxygen must browse to generate the
133 # documentation.
140 # documentation.
134 #
141 #
135 # Source directories:
142 # Source directories:
136 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
143 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
137 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
144 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
138 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
145 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
139 # Source directories to exclude from the documentation generation
146 # Source directories to exclude from the documentation generation
140 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
147 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
141 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
148 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
142
149
143 #
150 #
144 # Set the directories with the sources to analyze and propagate the
151 # Set the directories with the sources to analyze and propagate the
145 # modification to the parent scope
152 # modification to the parent scope
146 #
153 #
147 # Source directories to analyze:
154 # Source directories to analyze:
148 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
155 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
149 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
156 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
150 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
157 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
151 # Source directories to exclude from the analysis
158 # Source directories to exclude from the analysis
152 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
159 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
153 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
160 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