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