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