##// END OF EJS Templates
Merge pull request 136 from SCIQLOP-Initialisation feature/GCovAsScript...
perrinel -
r46:b7525153deb1 merge
parent child
Show More
@@ -1,148 +1,148
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}/vera-exclusions/exclusions.txt)
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
85
86 INCLUDE_DIRECTORIES(${SOURCES_DIR})
86 INCLUDE_DIRECTORIES(${SOURCES_DIR})
87 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
87 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
88 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
88 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
89 SET( TEST_LIBRARIES ${LIBRARIES})
89 SET( TEST_LIBRARIES ${LIBRARIES})
90
90
91 FOREACH( testFile ${TESTS_SOURCES} )
91 FOREACH( testFile ${TESTS_SOURCES} )
92 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
92 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
93 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
93 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
94
94
95 # Add to the list of sources files all the sources in the same
95 # Add to the list of sources files all the sources in the same
96 # directory that aren't another test
96 # directory that aren't another test
97 FILE (GLOB currentTestSources
97 FILE (GLOB currentTestSources
98 ${testDirectory}/*.c
98 ${testDirectory}/*.c
99 ${testDirectory}/*.cpp
99 ${testDirectory}/*.cpp
100 ${testDirectory}/*.h)
100 ${testDirectory}/*.h)
101 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
101 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
102 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
103
103
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
104 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} gcov)
105 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
106 qt5_use_modules(${testName} Test)
106 qt5_use_modules(${testName} Test)
107
107
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
108 ADD_TEST( NAME ${testName} COMMAND ${testName} )
109
109
110 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
110 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName})
111 ENDFOREACH( testFile )
111 ENDFOREACH( testFile )
112
112
113 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
113 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
114 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
114 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
115 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
115 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
116
116
117 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
117 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
118 ENDIF(BUILD_TESTS)
118 ENDIF(BUILD_TESTS)
119
119
120 #
120 #
121 # Set the files that must be formatted by clang-format.
121 # Set the files that must be formatted by clang-format.
122 #
122 #
123 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
123 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
124 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
124 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
125
125
126 #
126 #
127 # Set the directories that doxygen must browse to generate the
127 # Set the directories that doxygen must browse to generate the
128 # documentation.
128 # documentation.
129 #
129 #
130 # Source directories:
130 # Source directories:
131 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
131 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
132 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
132 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
133 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
133 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
134 # Source directories to exclude from the documentation generation
134 # Source directories to exclude from the documentation generation
135 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
135 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
136 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
136 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
137
137
138 #
138 #
139 # Set the directories with the sources to analyze and propagate the
139 # Set the directories with the sources to analyze and propagate the
140 # modification to the parent scope
140 # modification to the parent scope
141 #
141 #
142 # Source directories to analyze:
142 # Source directories to analyze:
143 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
143 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
144 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
144 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
145 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
145 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
146 # Source directories to exclude from the analysis
146 # Source directories to exclude from the analysis
147 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
147 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
148 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
148 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
@@ -1,132 +1,141
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 #
20 #
21 # Find Qt modules
21 # Find Qt modules
22 #
22 #
23 SCIQLOP_FIND_QT(Core)
23 SCIQLOP_FIND_QT(Core)
24
24
25 #
25 #
26 # Compile the library library
26 # Compile the library library
27 #
27 #
28 FILE (GLOB_RECURSE MODULE_SOURCES
28 FILE (GLOB_RECURSE MODULE_SOURCES
29 ${INCLUDES_DIR}/*.h
29 ${INCLUDES_DIR}/*.h
30 ${SOURCES_DIR}/*.c
30 ${SOURCES_DIR}/*.c
31 ${SOURCES_DIR}/*.cpp
31 ${SOURCES_DIR}/*.cpp
32 ${SOURCES_DIR}/*.h)
32 ${SOURCES_DIR}/*.h)
33
33
34 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
34 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
35 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
35 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
36 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
36 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
37 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
37 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
38 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
38 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
39
39
40 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
40 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
41 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
41 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
42 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
42 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
43 IF(BUILD_SHARED_LIBS)
43 IF(BUILD_SHARED_LIBS)
44 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
44 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
45 ELSE()
45 ELSE()
46 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
46 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
47 ENDIF()
47 ENDIF()
48
48
49 # Set the variable to parent scope so that the other projects can copy the
49 # Set the variable to parent scope so that the other projects can copy the
50 # dependent shared libraries
50 # dependent shared libraries
51 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
51 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
52
52
53 # Copy extern shared libraries to the lib folder
53 # Copy extern shared libraries to the lib folder
54 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
54 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
55
55
56 # Add the files to the list of files to be analyzed
56 # Add the files to the list of files to be analyzed
57 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
57 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
58 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
58 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
59 # Vera++ exclusion files
59 # Vera++ exclusion files
60 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
60 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
61 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
61 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
62
62
63 #
63 #
64 # Compile the tests
64 # Compile the tests
65 #
65 #
66 IF(BUILD_TESTS)
66 IF(BUILD_TESTS)
67 INCLUDE_DIRECTORIES(${SOURCES_DIR})
67 INCLUDE_DIRECTORIES(${SOURCES_DIR})
68 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
68 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
69 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
69 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
70 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
70 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
71
71
72 SET(TARGETS_COV)
72 FOREACH( testFile ${TESTS_SOURCES} )
73 FOREACH( testFile ${TESTS_SOURCES} )
73 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
74 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
74 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
75 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
75
76
76 # Add to the list of sources files all the sources in the same
77 # Add to the list of sources files all the sources in the same
77 # directory that aren't another test
78 # directory that aren't another test
78 FILE (GLOB currentTestSources
79 FILE (GLOB currentTestSources
79 ${testDirectory}/*.c
80 ${testDirectory}/*.c
80 ${testDirectory}/*.cpp
81 ${testDirectory}/*.cpp
81 ${testDirectory}/*.h)
82 ${testDirectory}/*.h)
82 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
83 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
83 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
84 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
84
85
85 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
86 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
86 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
87 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
87 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
88 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
88 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
89 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
89 qt5_use_modules(${testName} Test)
90 qt5_use_modules(${testName} Test)
90
91
91 ADD_TEST( NAME ${testName} COMMAND ${testDirectory} )
92 ADD_TEST( NAME ${testName} COMMAND ${testName} )
92
93
93 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
94 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
94 set(Coverage_NAME ${testName})
95 set(Coverage_NAME ${testName})
95 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
96 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
97 LIST( APPEND TARGETS_COV ${testName}_coverage)
98
96 ENDFOREACH( testFile )
99 ENDFOREACH( testFile )
97
100
101 add_custom_target(coverage)
102
103 FOREACH( target_cov ${TARGETS_COV} )
104 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
105 ENDFOREACH( target_cov )
106
98 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
107 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
99 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
108 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
100 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
109 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
101 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
110 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
102 ENDIF(BUILD_TESTS)
111 ENDIF(BUILD_TESTS)
103
112
104 #
113 #
105 # Set the files that must be formatted by clang-format.
114 # Set the files that must be formatted by clang-format.
106 #
115 #
107 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
116 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
108 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
117 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
109
118
110 #
119 #
111 # Set the directories that doxygen must browse to generate the
120 # Set the directories that doxygen must browse to generate the
112 # documentation.
121 # documentation.
113 #
122 #
114 # Source directories:
123 # Source directories:
115 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
124 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
116 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
125 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
117 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
126 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
118 # Source directories to exclude from the documentation generation
127 # Source directories to exclude from the documentation generation
119 #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/*")
120 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
129 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
121
130
122 #
131 #
123 # Set the directories with the sources to analyze and propagate the
132 # Set the directories with the sources to analyze and propagate the
124 # modification to the parent scope
133 # modification to the parent scope
125 #
134 #
126 # Source directories to analyze:
135 # Source directories to analyze:
127 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
136 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
128 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
137 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
129 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
138 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
130 # Source directories to exclude from the analysis
139 # Source directories to exclude from the analysis
131 #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")
132 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