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