@@ -0,0 +1,12 | |||||
|
1 | #ifndef SCIQLOP_AMDAGLOBAL_H | |||
|
2 | #define SCIQLOP_AMDAGLOBAL_H | |||
|
3 | ||||
|
4 | #include <QtCore/QtGlobal> | |||
|
5 | ||||
|
6 | #if defined(AMDA_LIB) | |||
|
7 | #define SCIQLOP_AMDA_EXPORT Q_DECL_EXPORT | |||
|
8 | #else | |||
|
9 | #define SCIQLOP_AMDA_EXPORT Q_DECL_IMPORT | |||
|
10 | #endif | |||
|
11 | ||||
|
12 | #endif // SCIQLOP_AMDAGLOBAL_H |
@@ -1,154 +1,157 | |||||
1 | ## amda - CMakeLists.txt |
|
1 | ## amda - CMakeLists.txt | |
2 | STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) |
|
2 | STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) | |
3 | SET(SQPAMDA_LIBRARY_NAME "${LIBRARY_PREFFIX}_amda${DEBUG_SUFFIX}") |
|
3 | SET(SQPAMDA_LIBRARY_NAME "${LIBRARY_PREFFIX}_amda${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 amda directory |
|
8 | # Include amda 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 | # Description file |
|
35 | # Description file | |
36 | FILE (GLOB_RECURSE PLUGIN_FILE ${RESOURCES_DIR}/amda.json) |
|
36 | FILE (GLOB_RECURSE PLUGIN_FILE ${RESOURCES_DIR}/amda.json) | |
37 |
|
37 | |||
38 | # |
|
38 | # | |
39 | # Compile the library |
|
39 | # Compile the library | |
40 | # |
|
40 | # | |
|
41 | ||||
|
42 | ADD_DEFINITIONS(-DAMDA_LIB) | |||
|
43 | ||||
41 | FILE (GLOB_RECURSE MODULE_SOURCES |
|
44 | FILE (GLOB_RECURSE MODULE_SOURCES | |
42 | ${INCLUDES_DIR}/*.h |
|
45 | ${INCLUDES_DIR}/*.h | |
43 | ${SOURCES_DIR}/*.c |
|
46 | ${SOURCES_DIR}/*.c | |
44 | ${SOURCES_DIR}/*.cpp |
|
47 | ${SOURCES_DIR}/*.cpp | |
45 | ${SOURCES_DIR}/*.h |
|
48 | ${SOURCES_DIR}/*.h | |
46 | ${PLUGIN_FILE}) |
|
49 | ${PLUGIN_FILE}) | |
47 |
|
50 | |||
48 | ADD_LIBRARY(${SQPAMDA_LIBRARY_NAME} ${MODULE_SOURCES}) |
|
51 | ADD_LIBRARY(${SQPAMDA_LIBRARY_NAME} ${MODULE_SOURCES}) | |
49 | set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) |
|
52 | set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) | |
50 | set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) |
|
53 | set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) | |
51 |
|
54 | |||
52 | INSTALL(TARGETS ${SQPAMDA_LIBRARY_NAME} |
|
55 | INSTALL(TARGETS ${SQPAMDA_LIBRARY_NAME} | |
53 | RUNTIME DESTINATION ${INSTALL_BINARY_DIR} |
|
56 | RUNTIME DESTINATION ${INSTALL_BINARY_DIR} | |
54 | LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} |
|
57 | LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} | |
55 | ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} |
|
58 | ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} | |
56 | ) |
|
59 | ) | |
57 |
|
60 | |||
58 |
|
61 | |||
59 | TARGET_LINK_LIBRARIES(${SQPAMDA_LIBRARY_NAME} ${LIBRARIES}) |
|
62 | TARGET_LINK_LIBRARIES(${SQPAMDA_LIBRARY_NAME} ${LIBRARIES}) | |
60 | qt5_use_modules(${SQPAMDA_LIBRARY_NAME} Core Widgets) |
|
63 | qt5_use_modules(${SQPAMDA_LIBRARY_NAME} Core Widgets) | |
61 |
|
64 | |||
62 | add_dependencies(${SQPAMDA_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME}) |
|
65 | add_dependencies(${SQPAMDA_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME}) | |
63 |
|
66 | |||
64 | # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html |
|
67 | # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html | |
65 | # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. |
|
68 | # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. | |
66 | # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets |
|
69 | # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets | |
67 | IF(BUILD_SHARED_LIBS) |
|
70 | IF(BUILD_SHARED_LIBS) | |
68 | SET_TARGET_PROPERTIES(${SQPAMDA_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") |
|
71 | SET_TARGET_PROPERTIES(${SQPAMDA_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") | |
69 | ELSE() |
|
72 | ELSE() | |
70 | TARGET_COMPILE_DEFINITIONS(${SQPAMDA_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") |
|
73 | TARGET_COMPILE_DEFINITIONS(${SQPAMDA_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") | |
71 | ENDIF() |
|
74 | ENDIF() | |
72 |
|
75 | |||
73 | # Set the variable to parent scope so that the other projects can copy the |
|
76 | # Set the variable to parent scope so that the other projects can copy the | |
74 | # dependent shared libraries |
|
77 | # dependent shared libraries | |
75 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPAMDA_LIBRARY_NAME) |
|
78 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPAMDA_LIBRARY_NAME) | |
76 |
|
79 | |||
77 | # Copy extern shared libraries to the lib folder |
|
80 | # Copy extern shared libraries to the lib folder | |
78 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPAMDA_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) |
|
81 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPAMDA_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) | |
79 |
|
82 | |||
80 | # Add the files to the list of files to be analyzed |
|
83 | # Add the files to the list of files to be analyzed | |
81 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) |
|
84 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) | |
82 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) |
|
85 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) | |
83 | # Vera++ exclusion files |
|
86 | # Vera++ exclusion files | |
84 | #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) | |
85 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
88 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) | |
86 |
|
89 | |||
87 | # |
|
90 | # | |
88 | # Compile the tests |
|
91 | # Compile the tests | |
89 | # |
|
92 | # | |
90 | IF(BUILD_TESTS) |
|
93 | IF(BUILD_TESTS) | |
91 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) |
|
94 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) | |
92 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) |
|
95 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) | |
93 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
96 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) | |
94 | SET( TEST_LIBRARIES ${SQPAMDA_LIBRARY_NAME}) |
|
97 | SET( TEST_LIBRARIES ${SQPAMDA_LIBRARY_NAME}) | |
95 |
|
98 | |||
96 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
99 | FOREACH( testFile ${TESTS_SOURCES} ) | |
97 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) |
|
100 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) | |
98 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
101 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) | |
99 |
|
102 | |||
100 | # Add to the list of sources files all the sources in the same |
|
103 | # Add to the list of sources files all the sources in the same | |
101 | # directory that aren't another test |
|
104 | # directory that aren't another test | |
102 | FILE (GLOB currentTestSources |
|
105 | FILE (GLOB currentTestSources | |
103 | ${testDirectory}/*.c |
|
106 | ${testDirectory}/*.c | |
104 | ${testDirectory}/*.cpp |
|
107 | ${testDirectory}/*.cpp | |
105 | ${testDirectory}/*.h) |
|
108 | ${testDirectory}/*.h) | |
106 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) |
|
109 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) | |
107 | # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
110 | # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) | |
108 |
|
111 | |||
109 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
112 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) | |
110 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14) |
|
113 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14) | |
111 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON) |
|
114 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON) | |
112 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
115 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) | |
113 | qt5_use_modules(${testName} Test) |
|
116 | qt5_use_modules(${testName} Test) | |
114 |
|
117 | |||
115 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
|
118 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) | |
116 |
|
119 | |||
117 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
120 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) | |
118 | ENDFOREACH( testFile ) |
|
121 | ENDFOREACH( testFile ) | |
119 |
|
122 | |||
120 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
123 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) | |
121 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
|
124 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) | |
122 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) |
|
125 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) | |
123 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
126 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |
124 | ENDIF(BUILD_TESTS) |
|
127 | ENDIF(BUILD_TESTS) | |
125 |
|
128 | |||
126 | # |
|
129 | # | |
127 | # Set the files that must be formatted by clang-format. |
|
130 | # Set the files that must be formatted by clang-format. | |
128 | # |
|
131 | # | |
129 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) |
|
132 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) | |
130 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
133 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |
131 |
|
134 | |||
132 | # |
|
135 | # | |
133 | # Set the directories that doxygen must browse to generate the |
|
136 | # Set the directories that doxygen must browse to generate the | |
134 | # documentation. |
|
137 | # documentation. | |
135 | # |
|
138 | # | |
136 | # Source directories: |
|
139 | # Source directories: | |
137 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") |
|
140 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") | |
138 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
141 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |
139 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) |
|
142 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) | |
140 | # Source directories to exclude from the documentation generation |
|
143 | # Source directories to exclude from the documentation generation | |
141 | #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/*") | |
142 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) |
|
145 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) | |
143 |
|
146 | |||
144 | # |
|
147 | # | |
145 | # Set the directories with the sources to analyze and propagate the |
|
148 | # Set the directories with the sources to analyze and propagate the | |
146 | # modification to the parent scope |
|
149 | # modification to the parent scope | |
147 | # |
|
150 | # | |
148 | # Source directories to analyze: |
|
151 | # Source directories to analyze: | |
149 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
152 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |
150 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") |
|
153 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") | |
151 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) |
|
154 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) | |
152 | # Source directories to exclude from the analysis |
|
155 | # Source directories to exclude from the analysis | |
153 | #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") | |
154 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
|
157 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
General Comments 0
You need to be logged in to leave comments.
Login now