##// END OF EJS Templates
Modernized CMake configuration...
jeandet -
r1331:c1dcbf747424
parent child
Show More
@@ -0,0 +1,3
1 [submodule "external/CatalogueAPI"]
2 path = external/CatalogueAPI
3 url = https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/JEANDET/CatalogueAPI
@@ -0,0 +1,18
1 [Desktop Entry]
2 Version=1.0
3 Name=QLop
4 Name[en_US]=SciQLOP
5
6 Type=Application
7 GenericName=SciQLOP
8 Comment=SCIentific Qt application for Learning from Observations of Plasmas
9
10 Exec=sciqlopapp
11 Icon=/usr/share/SciQLOP/icons/sciqlopLOGO.svg
12 Terminal=false
13
14 Categories=Qt;Education;Science;
15
16 #MimeType=text/x-python;
17
18
@@ -0,0 +1,5
1 macro(declare_test testname testexe sources libraries)
2 add_executable(${testexe} ${sources})
3 target_link_libraries(${testexe} ${libraries})
4 add_test(NAME ${testname} COMMAND ${testexe})
5 endmacro(declare_test)
@@ -0,0 +1,33
1 include(sciqlop_tests)
2
3 add_definitions(-DCORE_TESTS_RESOURCES_DIR="${CMAKE_CURRENT_LIST_DIR}/../tests-resources")
4
5
6 declare_test(TestStringUtils TestStringUtils Common/TestStringUtils.cpp "sciqlopcore;Qt5::Test")
7
8 declare_test(TestDataSeriesUtils TestDataSeriesUtils Data/TestDataSeriesUtils.cpp "sciqlopcore;Qt5::Test")
9 declare_test(TestOptionalAxis TestOptionalAxis Data/TestOptionalAxis.cpp "sciqlopcore;Qt5::Test")
10 declare_test(TestSpectrogramSeries TestSpectrogramSeries
11 "Data/TestSpectrogramSeries.cpp;Data/DataSeriesBuilders.h;Data/DataSeriesBuilders.cpp;Data/DataSeriesTestsUtils.h;Data/DataSeriesTestsUtils.cpp"
12 "sciqlopcore;Qt5::Test")
13 declare_test(TestOneDimArrayData TestOneDimArrayData Data/TestOneDimArrayData.cpp "sciqlopcore;Qt5::Test")
14 declare_test(TestScalarSeries TestScalarSeries
15 "Data/TestScalarSeries.cpp;Data/DataSeriesBuilders.h;Data/DataSeriesBuilders.cpp;Data/DataSeriesTestsUtils.h;Data/DataSeriesTestsUtils.cpp"
16 "sciqlopcore;Qt5::Test")
17 declare_test(TestTwoDimArrayData TestTwoDimArrayData Data/TestTwoDimArrayData.cpp "sciqlopcore;Qt5::Test")
18 declare_test(TestVectorSeries TestVectorSeries
19 "Data/TestVectorSeries.cpp;Data/DataSeriesBuilders.h;Data/DataSeriesBuilders.cpp;Data/DataSeriesTestsUtils.h;Data/DataSeriesTestsUtils.cpp"
20 "sciqlopcore;Qt5::Test")
21
22 declare_test(TestDataSourceController TestDataSourceController
23 "DataSource/TestDataSourceController.cpp;DataSource/DataSourceItemBuilder.cpp"
24 "sciqlopcore;Qt5::Test")
25 declare_test(TestDataSourceItem TestDataSourceItem
26 "DataSource/TestDataSourceItem.cpp;DataSource/DataSourceItemBuilder.cpp"
27 "sciqlopcore;Qt5::Test")
28
29 declare_test(TestVariable TestVariable Variable/TestVariable.cpp "sciqlopcore;Qt5::Test")
30 declare_test(TestVariableCacheController TestVariableCacheController Variable/TestVariableCacheController.cpp "sciqlopcore;Qt5::Test")
31 declare_test(TestVariableController TestVariableController Variable/TestVariableController.cpp "sciqlopcore;Qt5::Test")
32 declare_test(TestVariableSync TestVariableSync Variable/TestVariableSync.cpp "sciqlopcore;Qt5::Test")
33
@@ -0,0 +1,13
1 find_package(Doxygen)
2 if(DOXYGEN_FOUND)
3 set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.dox.in)
4 set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
5 configure_file(${doxyfile_in} ${doxyfile} @ONLY)
6
7 add_custom_target(doc
8 COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
9 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
10 COMMENT "Generating API documentation with Doxygen"
11 VERBATIM)
12
13 endif()
@@ -0,0 +1,1
1 Subproject commit 70f95c7d91c9a4e1ab52c427372757cc83a57de2
1 NO CONTENT: new file 100644, binary diff hidden
NO CONTENT: new file 100644, binary diff hidden
@@ -0,0 +1,2
1 add_subdirectory(mockplugin)
2 add_subdirectory(amda)
@@ -0,0 +1,23
1 include(ExternalProject)
2
3 find_program(meson meson)
4 find_program(ninja ninja)
5
6 SET(SOURCES_PATH ${CMAKE_SOURCE_DIR}/3rdparty/CatalogueAPI)
7 SET(BUILD_PATH ${CATALOGUEAPI_SOURCES_PATH}/build)
8 SET(CATALOGUEAPI_QXORM_LIB_PATH ${CATALOGUEAPI_BUILD_PATH}/subprojects/QxOrm)
9
10 ExternalProject_Add(
11 CatalogueAPI
12 GIT_REPOSITORY https://perrinel@hephaistos.lpp.polytechnique.fr/rhodecode/GIT_REPOSITORIES/LPP/Users/mperrinel/CatalogueAPI
13 GIT_TAG develop
14
15 SOURCE_DIR ${CMAKE_BINARY_DIR}/CatalogueAPI_src
16 BINARY_DIR ${CMAKE_BINARY_DIR}/CatalogueAPI_build
17 INSTALL_DIR ${CMAKE_BINARY_DIR}/CatalogueAPI
18
19 CONFIGURE_COMMAND ${meson} --prefix=${CATALOGUEAPI_SOURCES_PATH} --buildtype=${CMAKE_BUILD_TYPE_TOLOWER} "${CATALOGUEAPI_SOURCES_PATH}" "${CATALOGUEAPI_BUILD_PATH}"
20 BUILD_COMMAND ${ninja} -C "${CATALOGUEAPI_BUILD_PATH}"
21 INSTALL_COMMAND ${ninja} -C "${CATALOGUEAPI_BUILD_PATH}" install
22
23 )
@@ -1,18 +1,61
1 
1 cmake_minimum_required(VERSION 3.6)
2 project(SciQLOP CXX)
2
3
3 ## Main CMakeLists for SCIQLOP
4 include(GNUInstallDirs)
4 CMAKE_MINIMUM_REQUIRED (VERSION 3.6.1)
5 cmake_policy(VERSION 3.6)
6
5
7 PROJECT(SCIQLOP)
6 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake")
8
7
8 OPTION (CPPCHECK "Analyzes the source code with cppcheck" OFF)
9 OPTION (CLANG_TIDY "Analyzes the source code with Clang Tidy" OFF)
10 OPTION (IWYU "Analyzes the source code with Include What You Use" OFF)
9
11
10 #
12 set(CMAKE_CXX_STANDARD 14)
11 # build the CatalogueAPI dependencu
12 #
13 INCLUDE("extern/CatalogueAPI.cmake")
14
13
15 #
14 set(CMAKE_AUTOMOC ON)
16 # build the project
15 #https://gitlab.kitware.com/cmake/cmake/issues/15227
17 #
16 #set(CMAKE_AUTOUIC ON)
18 INCLUDE("cmake/sciqlop.cmake")
17 if(POLICY CMP0071)
18 cmake_policy(SET CMP0071 OLD)
19 endif()
20 set(CMAKE_AUTORCC ON)
21 set(CMAKE_INCLUDE_CURRENT_DIR ON)
22
23 if(NOT DEFINED CMAKE_INSTALL_RPATH_USE_LINK_PATH)
24 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
25 endif()
26 if(NOT DEFINED CMAKE_MACOSX_RPATH)
27 set(CMAKE_MACOSX_RPATH TRUE)
28 endif()
29
30 if(NOT CMAKE_BUILD_TYPE)
31 set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
32 endif()
33
34 find_package(Qt5 COMPONENTS Core Widgets Network PrintSupport Svg Test REQUIRED)
35
36 IF(CPPCHECK)
37 set(CMAKE_CXX_CPPCHECK "cppcheck;--enable=warning,style")
38 ENDIF(CPPCHECK)
39
40 IF(CLANG_TIDY)
41 set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-style=file;-checks=*")
42 ENDIF(CLANG_TIDY)
43
44 IF(IWYU)
45 set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "include-what-you-use")
46 ENDIF(IWYU)
47
48 enable_testing()
49
50
51 find_package(CatalogueAPI CONFIG QUIET)
52 if (NOT CatalogueAPI_FOUND)
53 execute_process(COMMAND git submodule update --init external/CatalogueAPI WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
54 add_subdirectory(external/CatalogueAPI)
55 endif()
56
57 add_subdirectory(core)
58 add_subdirectory(gui)
59 add_subdirectory(app)
60 add_subdirectory(plugins)
61 add_subdirectory(docs)
@@ -1,4 +1,10
1 ![](gui/resources/icones/sciqlop2PNG_1024.png){:.some-css-class style="width: 20%"}
1
2 <div style="text-align:center">
3 <img src="gui/resources/icones/sciqlop2PNG_1024.png" alt="sciqlop_logo" style="width: 200px;"/>
4 <br /><br />
5 <img src="pictures/sciqlop_screenshot.png" alt="sciqlop_logo" style="width: 80%;"/>
6 </div>
7
2
8
3
9
4 # Overview
10 # Overview
@@ -1,157 +1,34
1 include_directories(include)
1
2
2 ## sciqlop - CMakeLists.txt
3 FILE (GLOB_RECURSE app_SRCS
3 SET(EXECUTABLE_NAME "sciqlop")
4 include/*.h
4 SCIQLOP_SET_TO_PARENT_SCOPE(EXECUTABLE_NAME)
5 src/*.cpp
5 SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
6 resources/*.qrc
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
7 )
7 SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/ui)
8 SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources)
9
8
10 # Include gui directory
9 QT5_WRAP_UI(UiGenerated_SRCS
11 include_directories("${INCLUDES_DIR}")
10 ui/MainWindow.ui
12
13 #
14 # Find Qt modules
15 #
16 SCIQLOP_FIND_QT(Core Widgets)
17
18
19 #
20 # Find dependent libraries
21 # ========================
22 find_package(sciqlop-gui)
23
24 SET(LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
25 SET(EXTERN_SHARED_LIBRARIES)
26
27 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
28
29 # Add sqpcore to the list of libraries to use
30 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
31
32 # Include core directory
33 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../core/include")
34
35 # Add dependent shared libraries
36 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
37
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)
40 list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation})
41
42 # Ui files
43 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
44
45 #
46 # Compile the application
47 #
48 FILE (GLOB_RECURSE APPLICATION_SOURCES
49 ${INCLUDES_DIR}/*.h
50 ${SOURCES_DIR}/*.c
51 ${SOURCES_DIR}/*.cpp
52 ${SOURCES_DIR}/*.h
53 ${PROJECT_FORMS})
54
55 FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc)
56
57 QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} )
58
59 QT5_WRAP_UI(UIS_HDRS
60 ${PROJECT_FORMS}
61 )
11 )
62
12
63
13 add_executable(sciqlopapp ${app_SRCS} ${UiGenerated_SRCS})
64 ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS})
14 if(NOT BUILD_SHARED_LIBS)
65 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14)
15 add_definitions(-DQT_STATICPLUGIN)
66 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
16 target_link_libraries(sciqlopapp mockplugin)
67 target_link_libraries(${EXECUTABLE_NAME}
17 target_link_libraries(sciqlopapp amdaplugin)
68 ${LIBRARIES})
18 endif()
69
19
70 INSTALL(TARGETS ${EXECUTABLE_NAME}
20 target_link_libraries(sciqlopapp
71 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
21 Qt5::Core
72 LIBRARY DESTINATION ${INSTALL_BINARY_DIR}
22 Qt5::Widgets
73 ARCHIVE DESTINATION ${INSTALL_BINARY_DIR}
23 Qt5::Network
24 Qt5::PrintSupport
25 Qt5::Svg
26 sciqlopgui
27 sciqlopcore
74 )
28 )
75 # Link with Qt5 modules
76 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
77
78
79 add_dependencies(${EXECUTABLE_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
80
81
82
83 # Add the files to the list of files to be analyzed
84 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
85 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
86 # Vera++ exclusion files
87 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
88 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
89
90 #
91 # Compile the tests
92 #
93 IF(BUILD_TESTS)
94
95 INCLUDE_DIRECTORIES(${SOURCES_DIR})
96 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
97 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
98 SET( TEST_LIBRARIES ${LIBRARIES})
99
100 FOREACH( testFile ${TESTS_SOURCES} )
101 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
102 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
103
104 # Add to the list of sources files all the sources in the same
105 # directory that aren't another test
106 FILE (GLOB currentTestSources
107 ${testDirectory}/*.c
108 ${testDirectory}/*.cpp
109 ${testDirectory}/*.h)
110 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
111 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
112
113 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
114 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
115 qt5_use_modules(${testName} Test)
116
117 ADD_TEST( NAME ${testName} COMMAND ${testName} )
118
119 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
120 ENDFOREACH( testFile )
121
122 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
123 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
124 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
125
126 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
127 ENDIF(BUILD_TESTS)
128
29
129 #
30 install(TARGETS sciqlopapp DESTINATION ${CMAKE_INSTALL_BINDIR})
130 # Set the files that must be formatted by clang-format.
31 install(FILES resources/SciQLOP.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications/)
131 #
32 install(FILES resources/sciqlopLOGO.svg DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/SciQLOP/icons/)
132 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
133 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
134
33
135 #
136 # Set the directories that doxygen must browse to generate the
137 # documentation.
138 #
139 # Source directories:
140 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
141 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
142 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
143 # Source directories to exclude from the documentation generation
144 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
145 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
146
34
147 #
148 # Set the directories with the sources to analyze and propagate the
149 # modification to the parent scope
150 #
151 # Source directories to analyze:
152 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
153 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
154 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
155 # Source directories to exclude from the analysis
156 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
157 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -25,7 +25,7
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 <PluginManager/PluginManager.h>
29 #include <QDir>
29 #include <QDir>
30 #include <QtPlugin>
30 #include <QtPlugin>
31
31
@@ -133,7 +133,7 MainWindow::MainWindow(QWidget *parent)
133
133
134 auto openInspector = [this](bool checked, bool right, auto action) {
134 auto openInspector = [this](bool checked, bool right, auto action) {
135
135
136 action->setIcon(QIcon{(checked xor right) ? ":/icones/next.png" : ":/icones/previous.png"});
136 action->setIcon(QIcon{(checked ^ right) ? ":/icones/next.png" : ":/icones/previous.png"});
137
137
138 auto &lastInspectorSize
138 auto &lastInspectorSize
139 = right ? impl->m_LastOpenRightInspectorSize : impl->m_LastOpenLeftInspectorSize;
139 = right ? impl->m_LastOpenRightInspectorSize : impl->m_LastOpenLeftInspectorSize;
@@ -1,173 +1,31
1 ## core - CMakeLists.txt
1 FILE (GLOB_RECURSE core_SRCS
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
2 include/*.h
3 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
3 src/*.cpp
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
4 )
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
6 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
7
5
8 # Include core directory
6 add_definitions(-DCORE_STATIC)
9 include_directories("${INCLUDES_DIR}")
10
7
11 # Set a variable to display a warning in the version files.
8 add_library(sciqlopcore ${core_SRCS})
12 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
9 SET_TARGET_PROPERTIES(sciqlopcore PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
13 # Generate the version file from the cmake version variables. The version
14 # variables are defined in the cmake/sciqlop_version.cmake file.
15 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
16 "${INCLUDES_DIR}/Version.h")
17 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
18 "${SOURCES_DIR}/Version.cpp")
19
10
20 # Find dependent modules
11 target_include_directories(sciqlopcore PUBLIC
21 find_package(sciqlop-plugin)
12 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
22 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
13 $<INSTALL_INTERFACE:include/SciQLOP>
23
24 #
25 # Find Qt modules
26 #
27 SCIQLOP_FIND_QT(Core Network)
28
29 #
30 # Compile the library library
31 #
32
33 ADD_DEFINITIONS(-DCORE_LIB)
34
35 FILE (GLOB_RECURSE MODULE_SOURCES
36 ${INCLUDES_DIR}/*.h
37 ${SOURCES_DIR}/*.c
38 ${SOURCES_DIR}/*.cpp
39 ${SOURCES_DIR}/*.h)
40
41 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
42 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
43 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
44 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
45 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
46
47 # Find CATALOGUE_API
48 include_directories("${CATALOGUEAPI_INCLUDE}")
49 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
50 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
51 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
52 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
53 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
54 )
14 )
55
15
56 add_dependencies(${SQPCORE_LIBRARY_NAME} CatalogueAPI)
16 target_link_libraries(sciqlopcore PUBLIC
57
17 Qt5::Core
58 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
18 Qt5::Network
59 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
19 CatalogueAPI
60 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
61 IF(BUILD_SHARED_LIBS)
62 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
63 ELSE()
64 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
65 ENDIF()
66
67 # Set the variable to parent scope so that the other projects can copy the
68 # dependent shared libraries
69 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
70
71 ## Copy extern shared libraries to the lib folder
72 LIST (APPEND ${EXTERN_SHARED_LIBRARIES} ${CATALOGUEAPI_LIBRARIES})
73
74
75 SET (COPY_LIBS_DESTINATION LIBRARY)
76 if(APPLE)
77 SET (COPY_LIBS_DESTINATION RUNTIME)
78 endif()
79
80 add_custom_command(TARGET ${SQPCORE_LIBRARY_NAME} POST_BUILD
81 COMMAND ${CMAKE_COMMAND} -E copy ${CATALOGUEAPI_LIBRARIES} ${EXECUTABLE_OUTPUT_PATH}
82 )
20 )
83
21
84 # Add the files to the list of files to be analyzed
22 install(TARGETS sciqlopcore EXPORT SciQLOPCoreConfig
85 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
23 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
86 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
24 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
87 # Vera++ exclusion files
25 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
88 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
89 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
90
91 #
92 # Compile the tests
93 #
94 IF(BUILD_TESTS)
95 INCLUDE_DIRECTORIES(${SOURCES_DIR})
96 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
97 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
98 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
99 list(APPEND TEST_LIBRARIES ${CATALOGUEAPI_LIBRARIES})
100
101 SET(TARGETS_COV)
102 FOREACH( testFile ${TESTS_SOURCES} )
103 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
104 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
105
106 # Add to the list of sources files all the sources in the same
107 # directory that aren't another test
108 FILE (GLOB currentTestSources
109 ${testDirectory}/*.c
110 ${testDirectory}/*.cpp
111 ${testDirectory}/*.h)
112 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
113 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
114
115 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
116 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
117 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
118 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
119 qt5_use_modules(${testName} Test)
120
121 ADD_TEST( NAME ${testName} COMMAND ${testName} )
122
123 set(Coverage_NAME ${testName})
124 if(UNIX)
125 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
126 LIST( APPEND TARGETS_COV ${testName}_coverage)
127 endif(UNIX)
128
129 ENDFOREACH( testFile )
130
131 add_custom_target(coverage)
132
133 FOREACH( target_cov ${TARGETS_COV} )
134 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
135 ENDFOREACH( target_cov )
136
137 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
138 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
139 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
140 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
141
142 ADD_DEFINITIONS(-DCORE_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
143 ENDIF(BUILD_TESTS)
144
145 #
146 # Set the files that must be formatted by clang-format.
147 #
148 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
149 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
150
26
151 #
27 install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SciQLOP)
152 # Set the directories that doxygen must browse to generate the
28 install(EXPORT SciQLOPCoreConfig DESTINATION share/SciQLOPCore/cmake)
153 # documentation.
29 export(TARGETS sciqlopcore FILE SciQLOPCoreConfig.cmake)
154 #
155 # Source directories:
156 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
157 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
158 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
159 # Source directories to exclude from the documentation generation
160 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
161 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
162
30
163 #
31 add_subdirectory(tests)
164 # Set the directories with the sources to analyze and propagate the
165 # modification to the parent scope
166 #
167 # Source directories to analyze:
168 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
169 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
170 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
171 # Source directories to exclude from the analysis
172 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
173 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
1 NO CONTENT: file renamed from plugin/include/Plugin/IPlugin.h to core/include/Plugin/IPlugin.h
NO CONTENT: file renamed from plugin/include/Plugin/IPlugin.h to core/include/Plugin/IPlugin.h
@@ -14,7 +14,7 Q_DECLARE_LOGGING_CATEGORY(LOG_PluginManager)
14 /**
14 /**
15 * @brief The PluginManager class aims to handle the plugins loaded dynamically into SciQLop.
15 * @brief The PluginManager class aims to handle the plugins loaded dynamically into SciQLop.
16 */
16 */
17 class SCIQLOP_CORE_EXPORT PluginManager {
17 class PluginManager {
18 public:
18 public:
19 explicit PluginManager();
19 explicit PluginManager();
20
20
@@ -1,4 +1,4
1 #include <Plugin/PluginManager.h>
1 #include <PluginManager/PluginManager.h>
2
2
3 #include <Plugin/IPlugin.h>
3 #include <Plugin/IPlugin.h>
4
4
@@ -1,179 +1,52
1
1 FILE (GLOB_RECURSE gui_SRCS
2 ## gui - CMakeLists.txt
2 include/*.h
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 src/*.cpp
4 SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_gui${DEBUG_SUFFIX}")
4 resources/*.qrc
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
5 )
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
6
7 SET(UI_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/ui")
7 QT5_WRAP_UI(
8 SET(RES_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/resources")
8 UiGenerated_SRCS
9
9 ui/DataSource/DataSourceWidget.ui
10 # Include gui directory
10 ui/Settings/SqpSettingsDialog.ui
11 include_directories("${INCLUDES_DIR}")
11 ui/Settings/SqpSettingsGeneralWidget.ui
12 include_directories("${CMAKE_CURRENT_BINARY_DIR}")
12 ui/SidePane/SqpSidePane.ui
13
13 ui/TimeWidget/TimeWidget.ui
14 # Set a variable to display a warning in the version files.
14 ui/Variable/RenameVariableDialog.ui
15 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
15 ui/Variable/VariableInspectorWidget.ui
16
16 ui/Variable/VariableMenuHeaderWidget.ui
17 #
17 ui/Visualization/ColorScaleEditor.ui
18 # Find Qt modules
18 ui/Visualization/VisualizationGraphWidget.ui
19 #
19 ui/Visualization/VisualizationTabWidget.ui
20 SCIQLOP_FIND_QT(Core Widgets PrintSupport)
20 ui/Visualization/VisualizationWidget.ui
21
21 ui/Visualization/VisualizationZoneWidget.ui
22 #
22 ui/Visualization/VisualizationMultiZoneSelectionDialog.ui
23 # Find dependent libraries
23 ui/Catalogue/CatalogueEventsWidget.ui
24 # ========================
24 ui/Catalogue/CatalogueExplorer.ui
25 find_package(sciqlop-core)
25 ui/Catalogue/CatalogueInspectorWidget.ui
26
26 ui/Catalogue/CatalogueSideBarWidget.ui
27 SET(LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
27 ui/Catalogue/CreateEventDialog.ui
28
29 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
30
31 # Add sqpcore to the list of libraries to use
32 list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME})
33
34 # Add dependent shared libraries
35 list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES})
36
37
38 # Ui files
39 FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui)
40
41 # Resources files
42 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc)
43
44 #
45 # Compile the library library
46 #
47 FILE (GLOB_RECURSE MODULE_SOURCES
48 ${INCLUDES_DIR}/*.h
49 ${SOURCES_DIR}/*.c
50 ${SOURCES_DIR}/*.cpp
51 ${SOURCES_DIR}/*.h
52 ${PROJECT_FORMS})
53
54 QT5_ADD_RESOURCES(RCC_HDRS
55 ${PROJECT_RESOURCES}
56 )
57
58 QT5_WRAP_UI(UIS_HDRS
59 ${PROJECT_FORMS}
60 )
28 )
61
29
30 add_library(sciqlopgui ${gui_SRCS} ${UiGenerated_SRCS})
31 SET_TARGET_PROPERTIES(sciqlopgui PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
62
32
63 ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS} ${RCC_HDRS})
33 target_include_directories(sciqlopgui PUBLIC
64 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
34 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
65 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
35 $<INSTALL_INTERFACE:include/SciQLOP>
66
36 )
67 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
68 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets PrintSupport)
69
37
70
38 target_link_libraries(sciqlopgui PUBLIC
71 INSTALL(TARGETS ${SQPGUI_LIBRARY_NAME}
39 Qt5::Widgets
72 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
40 Qt5::PrintSupport
73 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
41 Qt5::Svg
74 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
42 sciqlopcore
75 )
76 add_dependencies(${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
77
78 # Find CATALOGUE_API
79 include_directories("${CATALOGUEAPI_INCLUDE}")
80 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
81 INSTALL(TARGETS ${SQPGUI_LIBRARY_NAME}
82 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
83 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
84 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
85 )
43 )
86
44
87 add_dependencies(${SQPGUI_LIBRARY_NAME} CatalogueAPI)
45 install(TARGETS sciqlopgui EXPORT SciQLOPGuiConfig
88
46 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
89 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
47 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
90 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
48 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
91 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
92 IF(BUILD_SHARED_LIBS)
93 SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
94 ELSE()
95 TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
96 ENDIF()
97
98 # Set the variable to parent scope so that the other projects can copy the
99 # dependent shared libraries
100 SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME)
101
102 # Copy extern shared libraries to the lib folder
103 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME})
104
105 # Add the files to the list of files to be analyzed
106 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
107 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
108 # Vera++ exclusion files
109 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
110 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
111
112 #
113 # Compile the tests
114 #
115 IF(BUILD_TESTS)
116 INCLUDE_DIRECTORIES(${SOURCES_DIR})
117 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
118 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
119 SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME})
120
121 FOREACH( testFile ${TESTS_SOURCES} )
122 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
123 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
124
125 # Add to the list of sources files all the sources in the same
126 # directory that aren't another test
127 FILE (GLOB currentTestSources
128 ${testDirectory}/*.c
129 ${testDirectory}/*.cpp
130 ${testDirectory}/*.h)
131 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
132 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
133
134 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
135 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
136 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
137 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
138 qt5_use_modules(${testName} Test)
139
140 ADD_TEST( NAME ${testName} COMMAND ${testName} )
141
142 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
143 ENDFOREACH( testFile )
144
145 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
146 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
147 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
148 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
149 ENDIF(BUILD_TESTS)
150
151 #
152 # Set the files that must be formatted by clang-format.
153 #
154 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
155 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
156
157 #
158 # Set the directories that doxygen must browse to generate the
159 # documentation.
160 #
161 # Source directories:
162 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
163 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
164 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
165 # Source directories to exclude from the documentation generation
166 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
167 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
168
49
169 #
50 install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SciQLOP)
170 # Set the directories with the sources to analyze and propagate the
51 install(EXPORT SciQLOPGuiConfig DESTINATION share/SciQLOPGui/cmake)
171 # modification to the parent scope
52 export(TARGETS sciqlopgui FILE SciQLOPGuiConfig.cmake)
172 #
173 # Source directories to analyze:
174 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
175 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
176 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
177 # Source directories to exclude from the analysis
178 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
179 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,168 +1,31
1 ## amda - CMakeLists.txt
1 include_directories(include)
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
2 FILE (GLOB_RECURSE amdaplugin_SRCS
3 SET(SQPAMDA_LIBRARY_NAME "${LIBRARY_PREFFIX}_amda${DEBUG_SUFFIX}")
3 include/*.h
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
4 src/*.cpp
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
5 resources/*.qrc
6 SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
6 )
7 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
8
7
9 # Include amda directory
8 add_definitions(-DQT_PLUGIN)
10 INCLUDE_DIRECTORIES(${INCLUDES_DIR})
9 add_definitions(-DSCIQLOP_PLUGIN_JSON_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/resources/amda.json")
11 INCLUDE_DIRECTORIES(${RESOURCES_DIR})
10 if(NOT BUILD_SHARED_LIBS)
11 add_definitions(-DQT_STATICPLUGIN)
12 endif()
12
13
13 #
14 add_library(amdaplugin ${amdaplugin_SRCS})
14 # Find Qt modules
15 SET_TARGET_PROPERTIES(amdaplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
15 #
16 SCIQLOP_FIND_QT(Core Widgets Network)
17
16
18 #
17 target_link_libraries(amdaplugin PUBLIC sciqlopgui)
19 # Find dependent libraries
20 # ========================
21
18
22 # sciqlop plugin
19 install(TARGETS amdaplugin
23 find_package(sciqlop-plugin)
20 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
24 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
21 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
22 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
25
23
26 # sciqlop core
24 include(sciqlop_tests)
27 find_package(sciqlop-core)
28 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
29 list(APPEND LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
30
25
31 # sciqlop gui
26 add_definitions(-DAMDA_TESTS_RESOURCES_DIR="${CMAKE_CURRENT_LIST_DIR}/tests-resources")
32 find_package(sciqlop-gui)
33 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
34 list(APPEND LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
35
27
36 # Description file
28 declare_test(TestAmdaParser TestAmdaParser tests/TestAmdaParser.cpp "amdaplugin;Qt5::Test")
37 FILE (GLOB_RECURSE PLUGIN_FILE ${RESOURCES_DIR}/amda.json)
29 declare_test(TestAmdaResultParser TestAmdaResultParser tests/TestAmdaResultParser.cpp "amdaplugin;Qt5::Test")
30 declare_test(TestAmdaAcquisition TestAmdaAcquisition tests/TestAmdaAcquisition.cpp "amdaplugin;Qt5::Test")
38
31
39 # Resources files
40 FILE (GLOB_RECURSE PROJECT_RESOURCES ${RESOURCES_DIR}/*.qrc)
41
42 #
43 # Compile the library
44 #
45
46 ADD_DEFINITIONS(-DAMDA_LIB)
47
48 FILE (GLOB_RECURSE MODULE_SOURCES
49 ${INCLUDES_DIR}/*.h
50 ${SOURCES_DIR}/*.c
51 ${SOURCES_DIR}/*.cpp
52 ${SOURCES_DIR}/*.h
53 ${PLUGIN_FILE})
54
55 QT5_ADD_RESOURCES(RCC_AMDA
56 ${PROJECT_RESOURCES}
57 )
58
59 ADD_LIBRARY(${SQPAMDA_LIBRARY_NAME} ${MODULE_SOURCES} ${RCC_AMDA})
60 set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
61 set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
62
63 INSTALL(TARGETS ${SQPAMDA_LIBRARY_NAME}
64 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
65 LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
66 ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
67 )
68
69
70 TARGET_LINK_LIBRARIES(${SQPAMDA_LIBRARY_NAME} ${LIBRARIES})
71 qt5_use_modules(${SQPAMDA_LIBRARY_NAME} Core Widgets Network)
72
73 add_dependencies(${SQPAMDA_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
74
75 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
76 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
77 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
78 IF(BUILD_SHARED_LIBS)
79 SET_TARGET_PROPERTIES(${SQPAMDA_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
80 ELSE()
81 TARGET_COMPILE_DEFINITIONS(${SQPAMDA_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
82 ENDIF()
83
84 # Set the variable to parent scope so that the other projects can copy the
85 # dependent shared libraries
86 SCIQLOP_SET_TO_PARENT_SCOPE(SQPAMDA_LIBRARY_NAME)
87
88 # Copy extern shared libraries to the lib folder
89 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPAMDA_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
90
91 # Add the files to the list of files to be analyzed
92 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
93 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
94 # Vera++ exclusion files
95 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
96 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
97
98 #
99 # Compile the tests
100 #
101 IF(BUILD_TESTS)
102 INCLUDE_DIRECTORIES(${SOURCES_DIR})
103 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
104 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
105 SET( TEST_LIBRARIES ${SQPAMDA_LIBRARY_NAME})
106
107 FOREACH( testFile ${TESTS_SOURCES} )
108 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
109 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
110
111 # Add to the list of sources files all the sources in the same
112 # directory that aren't another test
113 FILE (GLOB currentTestSources
114 ${testDirectory}/*.c
115 ${testDirectory}/*.cpp
116 ${testDirectory}/*.h)
117 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
118 LIST(APPEND testFilesToFormat ${currentTestSources})
119 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
120
121 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
122 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
123 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
124 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
125 qt5_use_modules(${testName} Test)
126
127 ADD_TEST( NAME ${testName} COMMAND ${testName} )
128
129 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
130 ENDFOREACH( testFile )
131
132 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
133 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
134 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
135 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
136
137 ADD_DEFINITIONS(-DAMDA_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
138 ENDIF(BUILD_TESTS)
139
140 #
141 # Set the files that must be formatted by clang-format.
142 #
143 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
144 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
145
146 #
147 # Set the directories that doxygen must browse to generate the
148 # documentation.
149 #
150 # Source directories:
151 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
152 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
153 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
154 # Source directories to exclude from the documentation generation
155 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
156 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
157
158 #
159 # Set the directories with the sources to analyze and propagate the
160 # modification to the parent scope
161 #
162 # Source directories to analyze:
163 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
164 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
165 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
166 # Source directories to exclude from the analysis
167 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
168 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,160 +1,29
1 ## mockplugin - CMakeLists.txt
1 include_directories(include)
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
2 FILE (GLOB_RECURSE mockplugin_SRCS
3 SET(SQPMOCKPLUGIN_LIBRARY_NAME "${LIBRARY_PREFFIX}_mockplugin${DEBUG_SUFFIX}")
3 include/*.h
4 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
4 src/*.cpp
5 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
5 resources/*.qrc
6 SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
6 )
7 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
8
7
9 # Include mockplugin directory
8 add_definitions(-DQT_PLUGIN)
10 INCLUDE_DIRECTORIES(${INCLUDES_DIR})
9 add_definitions(-DPLUGIN_JSON_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/resources/mockplugin.json")
11 INCLUDE_DIRECTORIES(${RESOURCES_DIR})
10 if(NOT BUILD_SHARED_LIBS)
11 add_definitions(-DQT_STATICPLUGIN)
12 endif()
12
13
13 #
14 add_library(mockplugin ${mockplugin_SRCS})
14 # Find Qt modules
15 SET_TARGET_PROPERTIES(mockplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
15 #
16 SCIQLOP_FIND_QT(Core Widgets)
17
16
18 #
17 target_link_libraries(mockplugin sciqlopgui)
19 # Find dependent libraries
20 # ========================
21
18
22 # sciqlop plugin
19 install(TARGETS mockplugin
23 find_package(sciqlop-plugin)
20 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
24 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
21 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
22 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
25
23
26 # sciqlop core
24 include(sciqlop_tests)
27 find_package(sciqlop-core)
28 INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR})
29 list(APPEND LIBRARIES ${SCIQLOP-CORE_LIBRARIES})
30
25
31 # sciqlop gui
26 add_definitions(-DMOCKPLUGIN_TESTS_RESOURCES_DIR="${CMAKE_CURRENT_LIST_DIR}/tests-resources")
32 find_package(sciqlop-gui)
33 INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR})
34 list(APPEND LIBRARIES ${SCIQLOP-GUI_LIBRARIES})
35
27
36 # Description file
28 declare_test(TestCosinusAcquisition TestCosinusAcquisition tests/TestCosinusAcquisition.cpp "mockplugin;Qt5::Test")
37 FILE (GLOB_RECURSE PLUGIN_FILE ${RESOURCES_DIR}/mockplugin.json)
38
29
39 #
40 # Compile the library
41 #
42
43 ADD_DEFINITIONS(-DMOCKPLUGIN_LIB)
44
45 FILE (GLOB_RECURSE MODULE_SOURCES
46 ${INCLUDES_DIR}/*.h
47 ${SOURCES_DIR}/*.c
48 ${SOURCES_DIR}/*.cpp
49 ${SOURCES_DIR}/*.h
50 ${PLUGIN_FILE})
51
52 ADD_LIBRARY(${SQPMOCKPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
53 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
54 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
55
56 INSTALL(TARGETS ${SQPMOCKPLUGIN_LIBRARY_NAME}
57 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
58 LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
59 ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
60 )
61
62
63 TARGET_LINK_LIBRARIES(${SQPMOCKPLUGIN_LIBRARY_NAME} ${LIBRARIES})
64 qt5_use_modules(${SQPMOCKPLUGIN_LIBRARY_NAME} Core Widgets)
65
66 add_dependencies(${SQPMOCKPLUGIN_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
67
68 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
69 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
70 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
71 IF(BUILD_SHARED_LIBS)
72 SET_TARGET_PROPERTIES(${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
73 ELSE()
74 TARGET_COMPILE_DEFINITIONS(${SQPMOCKPLUGIN_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
75 ENDIF()
76
77 # Set the variable to parent scope so that the other projects can copy the
78 # dependent shared libraries
79 SCIQLOP_SET_TO_PARENT_SCOPE(SQPMOCKPLUGIN_LIBRARY_NAME)
80
81 # Copy extern shared libraries to the lib folder
82 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPMOCKPLUGIN_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
83
84 # Add the files to the list of files to be analyzed
85 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
86 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
87 # Vera++ exclusion files
88 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
89 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
90
91 #
92 # Compile the tests
93 #
94 IF(BUILD_TESTS)
95 INCLUDE_DIRECTORIES(${SOURCES_DIR})
96 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
97 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
98 SET( TEST_LIBRARIES ${SQPMOCKPLUGIN_LIBRARY_NAME})
99
100 FOREACH( testFile ${TESTS_SOURCES} )
101 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
102 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
103
104 # Add to the list of sources files all the sources in the same
105 # directory that aren't another test
106 FILE (GLOB currentTestSources
107 ${testDirectory}/*.c
108 ${testDirectory}/*.cpp
109 ${testDirectory}/*.h)
110 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
111 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
112
113 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
114 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
115 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
116 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
117 qt5_use_modules(${testName} Test)
118
119 ADD_TEST( NAME ${testName} COMMAND ${testName} )
120
121 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
122 ENDFOREACH( testFile )
123
124 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
125 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
126 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
127 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
128
129 ADD_DEFINITIONS(-DMOCKPLUGIN_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
130 ENDIF(BUILD_TESTS)
131
132 #
133 # Set the files that must be formatted by clang-format.
134 #
135 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
136 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
137
138 #
139 # Set the directories that doxygen must browse to generate the
140 # documentation.
141 #
142 # Source directories:
143 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
144 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
145 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
146 # Source directories to exclude from the documentation generation
147 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
148 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
149
150 #
151 # Set the directories with the sources to analyze and propagate the
152 # modification to the parent scope
153 #
154 # Source directories to analyze:
155 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
156 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
157 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
158 # Source directories to exclude from the analysis
159 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
160 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now