@@ -0,0 +1,154 | |||||
|
1 | ## amda - CMakeLists.txt | |||
|
2 | STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) | |||
|
3 | SET(SQPAMDA_LIBRARY_NAME "${LIBRARY_PREFFIX}_amda${DEBUG_SUFFIX}") | |||
|
4 | SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") | |||
|
5 | SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") | |||
|
6 | SET(RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources") | |||
|
7 | ||||
|
8 | # Include amda directory | |||
|
9 | INCLUDE_DIRECTORIES(${INCLUDES_DIR}) | |||
|
10 | INCLUDE_DIRECTORIES(${RESOURCES_DIR}) | |||
|
11 | ||||
|
12 | # | |||
|
13 | # Find Qt modules | |||
|
14 | # | |||
|
15 | SCIQLOP_FIND_QT(Core Widgets) | |||
|
16 | ||||
|
17 | # | |||
|
18 | # Find dependent libraries | |||
|
19 | # ======================== | |||
|
20 | ||||
|
21 | # sciqlop plugin | |||
|
22 | find_package(sciqlop-plugin) | |||
|
23 | INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR}) | |||
|
24 | ||||
|
25 | # sciqlop core | |||
|
26 | find_package(sciqlop-core) | |||
|
27 | INCLUDE_DIRECTORIES(${SCIQLOP-CORE_INCLUDE_DIR}) | |||
|
28 | list(APPEND LIBRARIES ${SCIQLOP-CORE_LIBRARIES}) | |||
|
29 | ||||
|
30 | # sciqlop gui | |||
|
31 | find_package(sciqlop-gui) | |||
|
32 | INCLUDE_DIRECTORIES(${SCIQLOP-GUI_INCLUDE_DIR}) | |||
|
33 | list(APPEND LIBRARIES ${SCIQLOP-GUI_LIBRARIES}) | |||
|
34 | ||||
|
35 | # Description file | |||
|
36 | FILE (GLOB_RECURSE PLUGIN_FILE ${RESOURCES_DIR}/amda.json) | |||
|
37 | ||||
|
38 | # | |||
|
39 | # Compile the library | |||
|
40 | # | |||
|
41 | FILE (GLOB_RECURSE MODULE_SOURCES | |||
|
42 | ${INCLUDES_DIR}/*.h | |||
|
43 | ${SOURCES_DIR}/*.c | |||
|
44 | ${SOURCES_DIR}/*.cpp | |||
|
45 | ${SOURCES_DIR}/*.h | |||
|
46 | ${PLUGIN_FILE}) | |||
|
47 | ||||
|
48 | ADD_LIBRARY(${SQPAMDA_LIBRARY_NAME} ${MODULE_SOURCES}) | |||
|
49 | set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) | |||
|
50 | set_property(TARGET ${SQPAMDA_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) | |||
|
51 | ||||
|
52 | INSTALL(TARGETS ${SQPAMDA_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 | ||||
|
59 | TARGET_LINK_LIBRARIES(${SQPAMDA_LIBRARY_NAME} ${LIBRARIES}) | |||
|
60 | qt5_use_modules(${SQPAMDA_LIBRARY_NAME} Core Widgets) | |||
|
61 | ||||
|
62 | add_dependencies(${SQPAMDA_LIBRARY_NAME} ${SQPPLUGIN_LIBRARY_NAME} ${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME}) | |||
|
63 | ||||
|
64 | # 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. | |||
|
66 | # 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) | |||
|
68 | SET_TARGET_PROPERTIES(${SQPAMDA_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") | |||
|
69 | ELSE() | |||
|
70 | TARGET_COMPILE_DEFINITIONS(${SQPAMDA_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") | |||
|
71 | ENDIF() | |||
|
72 | ||||
|
73 | # Set the variable to parent scope so that the other projects can copy the | |||
|
74 | # dependent shared libraries | |||
|
75 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPAMDA_LIBRARY_NAME) | |||
|
76 | ||||
|
77 | # Copy extern shared libraries to the lib folder | |||
|
78 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPAMDA_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) | |||
|
79 | ||||
|
80 | # Add the files to the list of files to be analyzed | |||
|
81 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) | |||
|
82 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) | |||
|
83 | # Vera++ exclusion files | |||
|
84 | #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt) | |||
|
85 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) | |||
|
86 | ||||
|
87 | # | |||
|
88 | # Compile the tests | |||
|
89 | # | |||
|
90 | IF(BUILD_TESTS) | |||
|
91 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) | |||
|
92 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) | |||
|
93 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) | |||
|
94 | SET( TEST_LIBRARIES ${SQPAMDA_LIBRARY_NAME}) | |||
|
95 | ||||
|
96 | FOREACH( testFile ${TESTS_SOURCES} ) | |||
|
97 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) | |||
|
98 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) | |||
|
99 | ||||
|
100 | # Add to the list of sources files all the sources in the same | |||
|
101 | # directory that aren't another test | |||
|
102 | FILE (GLOB currentTestSources | |||
|
103 | ${testDirectory}/*.c | |||
|
104 | ${testDirectory}/*.cpp | |||
|
105 | ${testDirectory}/*.h) | |||
|
106 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) | |||
|
107 | # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) | |||
|
108 | ||||
|
109 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) | |||
|
110 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14) | |||
|
111 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON) | |||
|
112 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) | |||
|
113 | qt5_use_modules(${testName} Test) | |||
|
114 | ||||
|
115 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) | |||
|
116 | ||||
|
117 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) | |||
|
118 | ENDFOREACH( testFile ) | |||
|
119 | ||||
|
120 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) | |||
|
121 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) | |||
|
122 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) | |||
|
123 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |||
|
124 | ENDIF(BUILD_TESTS) | |||
|
125 | ||||
|
126 | # | |||
|
127 | # Set the files that must be formatted by clang-format. | |||
|
128 | # | |||
|
129 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) | |||
|
130 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |||
|
131 | ||||
|
132 | # | |||
|
133 | # Set the directories that doxygen must browse to generate the | |||
|
134 | # documentation. | |||
|
135 | # | |||
|
136 | # Source directories: | |||
|
137 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") | |||
|
138 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |||
|
139 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) | |||
|
140 | # Source directories to exclude from the documentation generation | |||
|
141 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") | |||
|
142 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) | |||
|
143 | ||||
|
144 | # | |||
|
145 | # Set the directories with the sources to analyze and propagate the | |||
|
146 | # modification to the parent scope | |||
|
147 | # | |||
|
148 | # Source directories to analyze: | |||
|
149 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |||
|
150 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") | |||
|
151 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) | |||
|
152 | # Source directories to exclude from the analysis | |||
|
153 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") | |||
|
154 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
@@ -0,0 +1,22 | |||||
|
1 | # - Try to find sciqlop-amda | |||
|
2 | # Once done this will define | |||
|
3 | # SCIQLOP-AMDA_FOUND - System has sciqlop-amda | |||
|
4 | # SCIQLOP-AMDA_INCLUDE_DIR - The sciqlop-amda include directories | |||
|
5 | # SCIQLOP-AMDA_LIBRARIES - The libraries needed to use sciqlop-amda | |||
|
6 | ||||
|
7 | if(SCIQLOP-AMDA_FOUND) | |||
|
8 | return() | |||
|
9 | endif(SCIQLOP-AMDA_FOUND) | |||
|
10 | ||||
|
11 | set(SCIQLOP-AMDA_INCLUDE_DIR ${sciqlop-amda_DIR}/../include) | |||
|
12 | ||||
|
13 | set (OS_LIB_EXTENSION "so") | |||
|
14 | ||||
|
15 | if(WIN32) | |||
|
16 | set (OS_LIB_EXTENSION "dll") | |||
|
17 | endif(WIN32) | |||
|
18 | # TODO: Add Mac Support | |||
|
19 | set(SCIQLOP-AMDA_LIBRARIES_NAME "libsciqlop_amda${DEBUG_SUFFIX}.${OS_LIB_EXTENSION}") | |||
|
20 | set(SCIQLOP-AMDA_LIBRARIES "${LIBRARY_OUTPUT_PATH}/${SCIQLOP-AMDA_LIBRARIES_NAME}") | |||
|
21 | ||||
|
22 | set(SCIQLOP-AMDA_FOUND TRUE) |
@@ -1,53 +1,65 | |||||
1 |
|
1 | |||
2 | if(BUILD_TESTS) |
|
2 | if(BUILD_TESTS) | |
3 | INCLUDE ("cmake/sciqlop_code_coverage.cmake") |
|
3 | INCLUDE ("cmake/sciqlop_code_coverage.cmake") | |
4 | APPEND_COVERAGE_COMPILER_FLAGS() |
|
4 | APPEND_COVERAGE_COMPILER_FLAGS() | |
5 | endif(BUILD_TESTS) |
|
5 | endif(BUILD_TESTS) | |
6 |
|
6 | |||
7 | # |
|
7 | # | |
8 | # Compile the diffents modules |
|
8 | # Compile the diffents modules | |
9 | # |
|
9 | # | |
10 | set(sciqlop-plugin_DIR "${CMAKE_SOURCE_DIR}/plugin/cmake") |
|
10 | set(sciqlop-plugin_DIR "${CMAKE_SOURCE_DIR}/plugin/cmake") | |
11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-plugin_DIR}") |
|
11 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-plugin_DIR}") | |
12 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugin") |
|
12 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugin") | |
13 |
|
13 | |||
14 | set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake") |
|
14 | set(sciqlop-core_DIR "${CMAKE_SOURCE_DIR}/core/cmake") | |
15 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}") |
|
15 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-core_DIR}") | |
16 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core") |
|
16 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/core") | |
17 |
|
17 | |||
18 | set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake") |
|
18 | set(sciqlop-gui_DIR "${CMAKE_SOURCE_DIR}/gui/cmake") | |
19 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}") |
|
19 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-gui_DIR}") | |
20 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui") |
|
20 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/gui") | |
21 |
|
21 | |||
22 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app") |
|
22 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/app") | |
23 |
|
23 | |||
24 | OPTION (BUILD_PLUGINS "Build the plugins" OFF) |
|
24 | OPTION (BUILD_PLUGINS "Build the plugins" OFF) | |
25 | IF(BUILD_PLUGINS) |
|
25 | IF(BUILD_PLUGINS) | |
26 | set(sciqlop-mockplugin_DIR "${CMAKE_SOURCE_DIR}/plugins/mockplugin/cmake") |
|
26 | set(sciqlop-mockplugin_DIR "${CMAKE_SOURCE_DIR}/plugins/mockplugin/cmake") | |
27 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-mockplugin_DIR}") |
|
27 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-mockplugin_DIR}") | |
28 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/mockplugin") |
|
28 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/mockplugin") | |
|
29 | ||||
|
30 | set(sciqlop-amda_DIR "${CMAKE_SOURCE_DIR}/plugins/amda/cmake") | |||
|
31 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${sciqlop-amda_DIR}") | |||
|
32 | ADD_SUBDIRECTORY("${CMAKE_SOURCE_DIR}/plugins/amda") | |||
|
33 | ||||
|
34 | # Temporary target to copy to plugins dir | |||
|
35 | find_package(sciqlop-mockplugin) | |||
|
36 | find_package(sciqlop-amda) | |||
|
37 | ADD_CUSTOM_TARGET(plugins | |||
|
38 | COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-MOCKPLUGIN_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-MOCKPLUGIN_LIBRARIES_NAME}" | |||
|
39 | COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-AMDA_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-AMDA_LIBRARIES_NAME}" | |||
|
40 | ) | |||
29 | ENDIF(BUILD_PLUGINS) |
|
41 | ENDIF(BUILD_PLUGINS) | |
30 |
|
42 | |||
31 | # LOGGER |
|
43 | # LOGGER | |
32 | set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini") |
|
44 | set(QTLOGGING_INI_FILE "${CMAKE_SOURCE_DIR}/config/QtProject/qtlogging.ini") | |
33 | FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH}) |
|
45 | FILE(COPY ${QTLOGGING_INI_FILE} DESTINATION ${CONFIG_OUTPUT_PATH}) | |
34 |
|
46 | |||
35 |
|
47 | |||
36 | # |
|
48 | # | |
37 | # Code formatting |
|
49 | # Code formatting | |
38 | # |
|
50 | # | |
39 | # Vera++ exclusion files |
|
51 | # Vera++ exclusion files | |
40 | LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt) |
|
52 | LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/formatting/vera-exclusions/exclusions.txt) | |
41 | #SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
53 | #SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) | |
42 | INCLUDE ("cmake/sciqlop_formatting.cmake") |
|
54 | INCLUDE ("cmake/sciqlop_formatting.cmake") | |
43 |
|
55 | |||
44 | # |
|
56 | # | |
45 | # Documentation generation |
|
57 | # Documentation generation | |
46 | # |
|
58 | # | |
47 | INCLUDE ("cmake/sciqlop_doxygen.cmake") |
|
59 | INCLUDE ("cmake/sciqlop_doxygen.cmake") | |
48 |
|
60 | |||
49 | # |
|
61 | # | |
50 | # Source code analysis |
|
62 | # Source code analysis | |
51 | # |
|
63 | # | |
52 | INCLUDE ("cmake/sciqlop_code_analysis.cmake") |
|
64 | INCLUDE ("cmake/sciqlop_code_analysis.cmake") | |
53 | INCLUDE ("cmake/sciqlop_code_cppcheck.cmake") |
|
65 | INCLUDE ("cmake/sciqlop_code_cppcheck.cmake") |
@@ -1,160 +1,154 | |||||
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 | # Description file | |
36 |
FILE (GLOB_RECURSE P |
|
36 | FILE (GLOB_RECURSE PLUGIN_FILE ${RESOURCES_DIR}/mockplugin.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 | ${PLUGIN_FILE}) | |
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} |
|
52 | INSTALL(TARGETS ${SQPMOCKPLUGIN_LIBRARY_NAME} | |
53 | RUNTIME DESTINATION ${INSTALL_BINARY_DIR} |
|
53 | RUNTIME DESTINATION ${INSTALL_BINARY_DIR} | |
54 | LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} |
|
54 | LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} | |
55 | ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} |
|
55 | ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR} | |
56 | ) |
|
56 | ) | |
57 |
|
57 | |||
58 |
|
58 | |||
59 | TARGET_LINK_LIBRARIES(${SQPMOCKPLUGIN_LIBRARY_NAME} ${LIBRARIES}) |
|
59 | TARGET_LINK_LIBRARIES(${SQPMOCKPLUGIN_LIBRARY_NAME} ${LIBRARIES}) | |
60 | qt5_use_modules(${SQPMOCKPLUGIN_LIBRARY_NAME} Core Widgets) |
|
60 | qt5_use_modules(${SQPMOCKPLUGIN_LIBRARY_NAME} Core Widgets) | |
61 |
|
61 | |||
62 | 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}) | |
63 |
|
63 | |||
64 | # 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 | |
65 | # 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. | |
66 | # 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 | |
67 | IF(BUILD_SHARED_LIBS) |
|
67 | IF(BUILD_SHARED_LIBS) | |
68 | SET_TARGET_PROPERTIES(${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") |
|
68 | SET_TARGET_PROPERTIES(${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") | |
69 | ELSE() |
|
69 | ELSE() | |
70 | TARGET_COMPILE_DEFINITIONS(${SQPMOCKPLUGIN_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") |
|
70 | TARGET_COMPILE_DEFINITIONS(${SQPMOCKPLUGIN_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") | |
71 | ENDIF() |
|
71 | ENDIF() | |
72 |
|
72 | |||
73 | # 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 | |
74 | # dependent shared libraries |
|
74 | # dependent shared libraries | |
75 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPMOCKPLUGIN_LIBRARY_NAME) |
|
75 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPMOCKPLUGIN_LIBRARY_NAME) | |
76 |
|
76 | |||
77 | # Copy extern shared libraries to the lib folder |
|
77 | # Copy extern shared libraries to the lib folder | |
78 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPMOCKPLUGIN_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) |
|
78 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPMOCKPLUGIN_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) | |
79 |
|
79 | |||
80 | # Add the files to the list of files to be analyzed |
|
80 | # Add the files to the list of files to be analyzed | |
81 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) |
|
81 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) | |
82 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) |
|
82 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) | |
83 | # Vera++ exclusion files |
|
83 | # Vera++ exclusion files | |
84 | #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) | |
85 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
85 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) | |
86 |
|
86 | |||
87 | # Temporary target to copy to plugins dir |
|
|||
88 | find_package(sciqlop-mockplugin) |
|
|||
89 | ADD_CUSTOM_TARGET(plugins |
|
|||
90 | COMMAND ${CMAKE_COMMAND} -E copy ${SCIQLOP-MOCKPLUGIN_LIBRARIES} "${LIBRARY_OUTPUT_PATH}/plugins/${SCIQLOP-MOCKPLUGIN_LIBRARIES_NAME}" |
|
|||
91 | ) |
|
|||
92 |
|
||||
93 | # |
|
87 | # | |
94 | # Compile the tests |
|
88 | # Compile the tests | |
95 | # |
|
89 | # | |
96 | IF(BUILD_TESTS) |
|
90 | IF(BUILD_TESTS) | |
97 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) |
|
91 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) | |
98 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) |
|
92 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) | |
99 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
93 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) | |
100 | SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME}) |
|
94 | SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME}) | |
101 |
|
95 | |||
102 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
96 | FOREACH( testFile ${TESTS_SOURCES} ) | |
103 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) |
|
97 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) | |
104 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
98 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) | |
105 |
|
99 | |||
106 | # Add to the list of sources files all the sources in the same |
|
100 | # Add to the list of sources files all the sources in the same | |
107 | # directory that aren't another test |
|
101 | # directory that aren't another test | |
108 | FILE (GLOB currentTestSources |
|
102 | FILE (GLOB currentTestSources | |
109 | ${testDirectory}/*.c |
|
103 | ${testDirectory}/*.c | |
110 | ${testDirectory}/*.cpp |
|
104 | ${testDirectory}/*.cpp | |
111 | ${testDirectory}/*.h) |
|
105 | ${testDirectory}/*.h) | |
112 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) |
|
106 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) | |
113 | # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
107 | # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) | |
114 |
|
108 | |||
115 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
109 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) | |
116 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14) |
|
110 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14) | |
117 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON) |
|
111 | set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON) | |
118 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
112 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) | |
119 | qt5_use_modules(${testName} Test) |
|
113 | qt5_use_modules(${testName} Test) | |
120 |
|
114 | |||
121 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
|
115 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) | |
122 |
|
116 | |||
123 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
117 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) | |
124 | ENDFOREACH( testFile ) |
|
118 | ENDFOREACH( testFile ) | |
125 |
|
119 | |||
126 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
120 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) | |
127 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
|
121 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) | |
128 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) |
|
122 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) | |
129 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
123 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |
130 | ENDIF(BUILD_TESTS) |
|
124 | ENDIF(BUILD_TESTS) | |
131 |
|
125 | |||
132 | # |
|
126 | # | |
133 | # Set the files that must be formatted by clang-format. |
|
127 | # Set the files that must be formatted by clang-format. | |
134 | # |
|
128 | # | |
135 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) |
|
129 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) | |
136 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
130 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |
137 |
|
131 | |||
138 | # |
|
132 | # | |
139 | # Set the directories that doxygen must browse to generate the |
|
133 | # Set the directories that doxygen must browse to generate the | |
140 | # documentation. |
|
134 | # documentation. | |
141 | # |
|
135 | # | |
142 | # Source directories: |
|
136 | # Source directories: | |
143 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") |
|
137 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") | |
144 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
138 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |
145 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) |
|
139 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) | |
146 | # Source directories to exclude from the documentation generation |
|
140 | # Source directories to exclude from the documentation generation | |
147 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") |
|
141 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") | |
148 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) |
|
142 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) | |
149 |
|
143 | |||
150 | # |
|
144 | # | |
151 | # Set the directories with the sources to analyze and propagate the |
|
145 | # Set the directories with the sources to analyze and propagate the | |
152 | # modification to the parent scope |
|
146 | # modification to the parent scope | |
153 | # |
|
147 | # | |
154 | # Source directories to analyze: |
|
148 | # Source directories to analyze: | |
155 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
149 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |
156 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") |
|
150 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") | |
157 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) |
|
151 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) | |
158 | # Source directories to exclude from the analysis |
|
152 | # Source directories to exclude from the analysis | |
159 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") |
|
153 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") | |
160 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
|
154 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
General Comments 0
You need to be logged in to leave comments.
Login now