@@ -1,141 +1,141 | |||||
1 |
|
1 | |||
2 | ## sciqlop - CMakeLists.txt |
|
2 | ## sciqlop - CMakeLists.txt | |
3 | SET(EXECUTABLE_NAME "sciqlop") |
|
3 | SET(EXECUTABLE_NAME "sciqlop") | |
4 | SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) |
|
4 | SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) | |
5 | SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) |
|
5 | SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) | |
6 | SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src) |
|
6 | SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src) | |
7 | SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) |
|
7 | SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) | |
8 |
|
8 | |||
9 | # |
|
9 | # | |
10 | # Find Qt modules |
|
10 | # Find Qt modules | |
11 | # |
|
11 | # | |
12 | SCIQLOP_FIND_QT(Core Widgets) |
|
12 | SCIQLOP_FIND_QT(Core Widgets) | |
13 |
|
13 | |||
14 | # |
|
14 | # | |
15 | # Find dependent libraries |
|
15 | # Find dependent libraries | |
16 | # ======================== |
|
16 | # ======================== | |
17 | SET(LIBRARIES) |
|
17 | SET(LIBRARIES) | |
18 | SET(EXTERN_LIBRARIES) |
|
18 | SET(EXTERN_LIBRARIES) | |
19 | SET(EXTERN_SHARED_LIBRARIES) |
|
19 | SET(EXTERN_SHARED_LIBRARIES) | |
20 |
|
20 | |||
21 | # Add sqpcore to the list of libraries to use |
|
21 | # Add sqpcore to the list of libraries to use | |
22 | list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME}) |
|
22 | list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME}) | |
23 |
|
23 | |||
24 | # Include sqpcore directory |
|
24 | # Include sqpcore directory | |
25 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../sqpcore/src") |
|
25 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../sqpcore/src") | |
26 |
|
26 | |||
27 | # Add dependent shared libraries |
|
27 | # Add dependent shared libraries | |
28 | list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES}) |
|
28 | list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES}) | |
29 |
|
29 | |||
30 | # Retrieve the location of the dynamic library to copy it to the output path |
|
30 | # Retrieve the location of the dynamic library to copy it to the output path | |
31 | get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION) |
|
31 | #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION) | |
32 | list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation}) |
|
32 | list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation}) | |
33 |
|
33 | |||
34 | # |
|
34 | # | |
35 | # Compile the application |
|
35 | # Compile the application | |
36 | # |
|
36 | # | |
37 | FILE (GLOB_RECURSE APPLICATION_SOURCES |
|
37 | FILE (GLOB_RECURSE APPLICATION_SOURCES | |
38 | ${SOURCES_DIR}/*.c |
|
38 | ${SOURCES_DIR}/*.c | |
39 | ${SOURCES_DIR}/*.cpp |
|
39 | ${SOURCES_DIR}/*.cpp | |
40 | ${SOURCES_DIR}/*.h) |
|
40 | ${SOURCES_DIR}/*.h) | |
41 |
|
41 | |||
42 | # Headers files (.h) |
|
42 | # Headers files (.h) | |
43 | FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) |
|
43 | FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) | |
44 |
|
44 | |||
45 | # Ui files |
|
45 | # Ui files | |
46 | FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) |
|
46 | FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) | |
47 |
|
47 | |||
48 | # Resources files |
|
48 | # Resources files | |
49 | FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) |
|
49 | FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) | |
50 |
|
50 | |||
51 | # Retrieve resources files |
|
51 | # Retrieve resources files | |
52 | FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc) |
|
52 | FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc) | |
53 |
|
53 | |||
54 | QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} ) |
|
54 | QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} ) | |
55 |
|
55 | |||
56 | QT5_WRAP_UI(UIS_HDRS |
|
56 | QT5_WRAP_UI(UIS_HDRS | |
57 | ${PROJECT_FORMS} |
|
57 | ${PROJECT_FORMS} | |
58 | ) |
|
58 | ) | |
59 |
|
59 | |||
60 |
|
60 | |||
61 | ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS}) |
|
61 | ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS}) | |
62 | target_link_libraries(${EXECUTABLE_NAME} |
|
62 | target_link_libraries(${EXECUTABLE_NAME} | |
63 | ${LIBRARIES}) |
|
63 | ${LIBRARIES}) | |
64 |
|
64 | |||
65 | # Link with Qt5 modules |
|
65 | # Link with Qt5 modules | |
66 | qt5_use_modules(${EXECUTABLE_NAME} Core Widgets) |
|
66 | qt5_use_modules(${EXECUTABLE_NAME} Core Widgets) | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | # Add the files to the list of files to be analyzed |
|
69 | # Add the files to the list of files to be analyzed | |
70 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES}) |
|
70 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES}) | |
71 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) |
|
71 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) | |
72 | # Vera++ exclusion files |
|
72 | # Vera++ exclusion files | |
73 | #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) |
|
73 | #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) | |
74 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
74 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) | |
75 |
|
75 | |||
76 | # |
|
76 | # | |
77 | # Compile the tests |
|
77 | # Compile the tests | |
78 | # |
|
78 | # | |
79 | IF(BUILD_TESTS) |
|
79 | IF(BUILD_TESTS) | |
80 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) |
|
80 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) | |
81 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) |
|
81 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) | |
82 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
82 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) | |
83 | SET( TEST_LIBRARIES ${LIBRARIES} ${EXTERN_LIBRARIES}) |
|
83 | SET( TEST_LIBRARIES ${LIBRARIES} ${EXTERN_LIBRARIES}) | |
84 |
|
84 | |||
85 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
85 | FOREACH( testFile ${TESTS_SOURCES} ) | |
86 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) |
|
86 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) | |
87 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
87 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) | |
88 |
|
88 | |||
89 | # Add to the list of sources files all the sources in the same |
|
89 | # Add to the list of sources files all the sources in the same | |
90 | # directory that aren't another test |
|
90 | # directory that aren't another test | |
91 | FILE (GLOB currentTestSources |
|
91 | FILE (GLOB currentTestSources | |
92 | ${testDirectory}/*.c |
|
92 | ${testDirectory}/*.c | |
93 | ${testDirectory}/*.cpp |
|
93 | ${testDirectory}/*.cpp | |
94 | ${testDirectory}/*.h) |
|
94 | ${testDirectory}/*.h) | |
95 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) |
|
95 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) | |
96 | LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
96 | LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) | |
97 |
|
97 | |||
98 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
98 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) | |
99 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
99 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) | |
100 | qt5_use_modules(${testName} Test) |
|
100 | qt5_use_modules(${testName} Test) | |
101 |
|
101 | |||
102 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
|
102 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) | |
103 |
|
103 | |||
104 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
104 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) | |
105 | ENDFOREACH( testFile ) |
|
105 | ENDFOREACH( testFile ) | |
106 |
|
106 | |||
107 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
107 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) | |
108 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
|
108 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) | |
109 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) |
|
109 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) | |
110 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
110 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |
111 | ENDIF(BUILD_TESTS) |
|
111 | ENDIF(BUILD_TESTS) | |
112 |
|
112 | |||
113 | # |
|
113 | # | |
114 | # Set the files that must be formatted by clang-format. |
|
114 | # Set the files that must be formatted by clang-format. | |
115 | # |
|
115 | # | |
116 | LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES}) |
|
116 | LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES}) | |
117 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
117 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) | |
118 |
|
118 | |||
119 | # |
|
119 | # | |
120 | # Set the directories that doxygen must browse to generate the |
|
120 | # Set the directories that doxygen must browse to generate the | |
121 | # documentation. |
|
121 | # documentation. | |
122 | # |
|
122 | # | |
123 | # Source directories: |
|
123 | # Source directories: | |
124 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") |
|
124 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") | |
125 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
125 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |
126 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) |
|
126 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) | |
127 | # Source directories to exclude from the documentation generation |
|
127 | # Source directories to exclude from the documentation generation | |
128 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") |
|
128 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") | |
129 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) |
|
129 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) | |
130 |
|
130 | |||
131 | # |
|
131 | # | |
132 | # Set the directories with the sources to analyze and propagate the |
|
132 | # Set the directories with the sources to analyze and propagate the | |
133 | # modification to the parent scope |
|
133 | # modification to the parent scope | |
134 | # |
|
134 | # | |
135 | # Source directories to analyze: |
|
135 | # Source directories to analyze: | |
136 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
136 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") | |
137 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") |
|
137 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") | |
138 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) |
|
138 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) | |
139 | # Source directories to exclude from the analysis |
|
139 | # Source directories to exclude from the analysis | |
140 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") |
|
140 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") | |
141 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
|
141 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
General Comments 0
You need to be logged in to leave comments.
Login now