|
@@
-1,153
+1,153
|
|
1
|
|
|
1
|
|
|
2
|
## core - CMakeLists.txt
|
|
2
|
## core - CMakeLists.txt
|
|
3
|
STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
|
|
3
|
STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
|
|
4
|
SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
|
|
4
|
SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
|
|
5
|
SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
|
|
5
|
SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
|
|
6
|
SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
|
|
6
|
SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
|
|
7
|
|
|
7
|
|
|
8
|
# Include core directory
|
|
8
|
# Include core directory
|
|
9
|
include_directories("${INCLUDES_DIR}")
|
|
9
|
include_directories("${INCLUDES_DIR}")
|
|
10
|
|
|
10
|
|
|
11
|
# Set a variable to display a warning in the version files.
|
|
11
|
# Set a variable to display a warning in the version files.
|
|
12
|
SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
|
|
12
|
SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
|
|
13
|
# Generate the version file from the cmake version variables. The version
|
|
13
|
# Generate the version file from the cmake version variables. The version
|
|
14
|
# variables are defined in the cmake/sciqlop_version.cmake file.
|
|
14
|
# variables are defined in the cmake/sciqlop_version.cmake file.
|
|
15
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
|
|
15
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
|
|
16
|
"${INCLUDES_DIR}/Version.h")
|
|
16
|
"${INCLUDES_DIR}/Version.h")
|
|
17
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
|
|
17
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
|
|
18
|
"${SOURCES_DIR}/Version.cpp")
|
|
18
|
"${SOURCES_DIR}/Version.cpp")
|
|
19
|
|
|
19
|
|
|
20
|
# Find dependent modules
|
|
20
|
# Find dependent modules
|
|
21
|
find_package(sciqlop-plugin)
|
|
21
|
find_package(sciqlop-plugin)
|
|
22
|
INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
|
|
22
|
INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
|
|
23
|
|
|
23
|
|
|
24
|
#
|
|
24
|
#
|
|
25
|
# Find Qt modules
|
|
25
|
# Find Qt modules
|
|
26
|
#
|
|
26
|
#
|
|
27
|
SCIQLOP_FIND_QT(Core)
|
|
27
|
SCIQLOP_FIND_QT(Core Network)
|
|
28
|
|
|
28
|
|
|
29
|
#
|
|
29
|
#
|
|
30
|
# Compile the library library
|
|
30
|
# Compile the library library
|
|
31
|
#
|
|
31
|
#
|
|
32
|
FILE (GLOB_RECURSE MODULE_SOURCES
|
|
32
|
FILE (GLOB_RECURSE MODULE_SOURCES
|
|
33
|
${INCLUDES_DIR}/*.h
|
|
33
|
${INCLUDES_DIR}/*.h
|
|
34
|
${SOURCES_DIR}/*.c
|
|
34
|
${SOURCES_DIR}/*.c
|
|
35
|
${SOURCES_DIR}/*.cpp
|
|
35
|
${SOURCES_DIR}/*.cpp
|
|
36
|
${SOURCES_DIR}/*.h)
|
|
36
|
${SOURCES_DIR}/*.h)
|
|
37
|
|
|
37
|
|
|
38
|
ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
|
|
38
|
ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
|
|
39
|
set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
|
|
39
|
set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
|
|
40
|
set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
40
|
set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
41
|
TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
|
|
41
|
TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
|
|
42
|
qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
|
|
42
|
qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
|
|
43
|
|
|
43
|
|
|
44
|
INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
|
|
44
|
INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
|
|
45
|
RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
|
|
45
|
RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
|
|
46
|
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
|
|
46
|
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
|
|
47
|
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
|
|
47
|
ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
|
|
48
|
)
|
|
48
|
)
|
|
49
|
|
|
49
|
|
|
50
|
# From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
|
|
50
|
# From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
|
|
51
|
# Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
|
|
51
|
# Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
|
|
52
|
# The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
|
|
52
|
# The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
|
|
53
|
IF(BUILD_SHARED_LIBS)
|
|
53
|
IF(BUILD_SHARED_LIBS)
|
|
54
|
SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
|
|
54
|
SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
|
|
55
|
ELSE()
|
|
55
|
ELSE()
|
|
56
|
TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
|
|
56
|
TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
|
|
57
|
ENDIF()
|
|
57
|
ENDIF()
|
|
58
|
|
|
58
|
|
|
59
|
# Set the variable to parent scope so that the other projects can copy the
|
|
59
|
# Set the variable to parent scope so that the other projects can copy the
|
|
60
|
# dependent shared libraries
|
|
60
|
# dependent shared libraries
|
|
61
|
SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
|
|
61
|
SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
|
|
62
|
|
|
62
|
|
|
63
|
# Copy extern shared libraries to the lib folder
|
|
63
|
# Copy extern shared libraries to the lib folder
|
|
64
|
SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
|
|
64
|
SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
|
|
65
|
|
|
65
|
|
|
66
|
# Add the files to the list of files to be analyzed
|
|
66
|
# Add the files to the list of files to be analyzed
|
|
67
|
LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
|
|
67
|
LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
|
|
68
|
SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
|
|
68
|
SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
|
|
69
|
# Vera++ exclusion files
|
|
69
|
# Vera++ exclusion files
|
|
70
|
LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
|
|
70
|
LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
|
|
71
|
SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
|
|
71
|
SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
|
|
72
|
|
|
72
|
|
|
73
|
#
|
|
73
|
#
|
|
74
|
# Compile the tests
|
|
74
|
# Compile the tests
|
|
75
|
#
|
|
75
|
#
|
|
76
|
IF(BUILD_TESTS)
|
|
76
|
IF(BUILD_TESTS)
|
|
77
|
INCLUDE_DIRECTORIES(${SOURCES_DIR})
|
|
77
|
INCLUDE_DIRECTORIES(${SOURCES_DIR})
|
|
78
|
FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
|
|
78
|
FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
|
|
79
|
FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
|
|
79
|
FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
|
|
80
|
SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
|
|
80
|
SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
|
|
81
|
|
|
81
|
|
|
82
|
SET(TARGETS_COV)
|
|
82
|
SET(TARGETS_COV)
|
|
83
|
FOREACH( testFile ${TESTS_SOURCES} )
|
|
83
|
FOREACH( testFile ${TESTS_SOURCES} )
|
|
84
|
GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
|
|
84
|
GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
|
|
85
|
GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
|
|
85
|
GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
|
|
86
|
|
|
86
|
|
|
87
|
# Add to the list of sources files all the sources in the same
|
|
87
|
# Add to the list of sources files all the sources in the same
|
|
88
|
# directory that aren't another test
|
|
88
|
# directory that aren't another test
|
|
89
|
FILE (GLOB currentTestSources
|
|
89
|
FILE (GLOB currentTestSources
|
|
90
|
${testDirectory}/*.c
|
|
90
|
${testDirectory}/*.c
|
|
91
|
${testDirectory}/*.cpp
|
|
91
|
${testDirectory}/*.cpp
|
|
92
|
${testDirectory}/*.h)
|
|
92
|
${testDirectory}/*.h)
|
|
93
|
LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
|
|
93
|
LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
|
|
94
|
# LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
|
|
94
|
# LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
|
|
95
|
|
|
95
|
|
|
96
|
ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
|
|
96
|
ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
|
|
97
|
set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
|
|
97
|
set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
|
|
98
|
set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
98
|
set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
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
|
set(Coverage_NAME ${testName})
|
|
105
|
set(Coverage_NAME ${testName})
|
|
106
|
if(UNIX)
|
|
106
|
if(UNIX)
|
|
107
|
SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
|
|
107
|
SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
|
|
108
|
LIST( APPEND TARGETS_COV ${testName}_coverage)
|
|
108
|
LIST( APPEND TARGETS_COV ${testName}_coverage)
|
|
109
|
endif(UNIX)
|
|
109
|
endif(UNIX)
|
|
110
|
|
|
110
|
|
|
111
|
ENDFOREACH( testFile )
|
|
111
|
ENDFOREACH( testFile )
|
|
112
|
|
|
112
|
|
|
113
|
add_custom_target(coverage)
|
|
113
|
add_custom_target(coverage)
|
|
114
|
|
|
114
|
|
|
115
|
FOREACH( target_cov ${TARGETS_COV} )
|
|
115
|
FOREACH( target_cov ${TARGETS_COV} )
|
|
116
|
add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
|
|
116
|
add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
|
|
117
|
ENDFOREACH( target_cov )
|
|
117
|
ENDFOREACH( target_cov )
|
|
118
|
|
|
118
|
|
|
119
|
LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
|
|
119
|
LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
|
|
120
|
LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
|
|
120
|
LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
|
|
121
|
LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
|
|
121
|
LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
|
|
122
|
SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
|
|
122
|
SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
|
|
123
|
ENDIF(BUILD_TESTS)
|
|
123
|
ENDIF(BUILD_TESTS)
|
|
124
|
|
|
124
|
|
|
125
|
#
|
|
125
|
#
|
|
126
|
# Set the files that must be formatted by clang-format.
|
|
126
|
# Set the files that must be formatted by clang-format.
|
|
127
|
#
|
|
127
|
#
|
|
128
|
LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
|
|
128
|
LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
|
|
129
|
SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
|
|
129
|
SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
|
|
130
|
|
|
130
|
|
|
131
|
#
|
|
131
|
#
|
|
132
|
# Set the directories that doxygen must browse to generate the
|
|
132
|
# Set the directories that doxygen must browse to generate the
|
|
133
|
# documentation.
|
|
133
|
# documentation.
|
|
134
|
#
|
|
134
|
#
|
|
135
|
# Source directories:
|
|
135
|
# Source directories:
|
|
136
|
LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
|
|
136
|
LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
|
|
137
|
LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
137
|
LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
138
|
SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
|
|
138
|
SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
|
|
139
|
# Source directories to exclude from the documentation generation
|
|
139
|
# Source directories to exclude from the documentation generation
|
|
140
|
#LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
|
|
140
|
#LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
|
|
141
|
SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
|
|
141
|
SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
|
|
142
|
|
|
142
|
|
|
143
|
#
|
|
143
|
#
|
|
144
|
# Set the directories with the sources to analyze and propagate the
|
|
144
|
# Set the directories with the sources to analyze and propagate the
|
|
145
|
# modification to the parent scope
|
|
145
|
# modification to the parent scope
|
|
146
|
#
|
|
146
|
#
|
|
147
|
# Source directories to analyze:
|
|
147
|
# Source directories to analyze:
|
|
148
|
LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
148
|
LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
149
|
LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
|
149
|
LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
|
150
|
SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
|
|
150
|
SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
|
|
151
|
# Source directories to exclude from the analysis
|
|
151
|
# Source directories to exclude from the analysis
|
|
152
|
#LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
|
|
152
|
#LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
|
|
153
|
SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
|
|
153
|
SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
|