@@ -1,14 +1,14 | |||
|
1 | 1 | # |
|
2 | 2 | # compiler.cmake : configure the compilation flags |
|
3 | 3 | # |
|
4 | 4 | |
|
5 |
message("Compiler id: ${CMAKE_CXX_COMPILER_ID}") |
|
|
5 | message("Compiler id: ${CMAKE_CXX_COMPILER_ID}") | |
|
6 | 6 | IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
|
7 | INCLUDE("cmake/compiler/compiler_gnu.cmake") | |
|
7 | MESSAGE("Compiler supported") | |
|
8 | 8 | ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
|
9 | INCLUDE("cmake/compiler/compiler_gnu.cmake") | |
|
9 | MESSAGE("Compiler supported") | |
|
10 | 10 | ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") |
|
11 |
|
|
|
11 | INCLUDE("cmake/compiler/compiler_msvc.cmake") | |
|
12 | 12 | ELSE() |
|
13 | 13 | MESSAGE(FATAL_ERROR "Compiler not supported") |
|
14 | 14 | ENDIF() |
@@ -1,141 +1,144 | |||
|
1 | 1 | |
|
2 | 2 | ## sciqlop - CMakeLists.txt |
|
3 | 3 | SET(EXECUTABLE_NAME "sciqlop") |
|
4 | 4 | SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) |
|
5 | 5 | SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) |
|
6 | 6 | SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src) |
|
7 | 7 | SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) |
|
8 | 8 | |
|
9 | 9 | # |
|
10 | 10 | # Find Qt modules |
|
11 | 11 | # |
|
12 | 12 | SCIQLOP_FIND_QT(Core Widgets) |
|
13 | 13 | |
|
14 | 14 | # |
|
15 | 15 | # Find dependent libraries |
|
16 | 16 | # ======================== |
|
17 | 17 | SET(LIBRARIES) |
|
18 | 18 | SET(EXTERN_LIBRARIES) |
|
19 | 19 | SET(EXTERN_SHARED_LIBRARIES) |
|
20 | 20 | |
|
21 | 21 | # Add sqpcore to the list of libraries to use |
|
22 | 22 | list(APPEND LIBRARIES ${SQPCORE_LIBRARY_NAME}) |
|
23 | 23 | |
|
24 | 24 | # Include sqpcore directory |
|
25 | 25 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../sqpcore/src") |
|
26 | 26 | |
|
27 | 27 | # Add dependent shared libraries |
|
28 | 28 | list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES}) |
|
29 | 29 | |
|
30 | 30 | # Retrieve the location of the dynamic library to copy it to the output path |
|
31 | 31 | #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION) |
|
32 | 32 | list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation}) |
|
33 | 33 | |
|
34 | 34 | # |
|
35 | 35 | # Compile the application |
|
36 | 36 | # |
|
37 | 37 | FILE (GLOB_RECURSE APPLICATION_SOURCES |
|
38 | 38 | ${SOURCES_DIR}/*.c |
|
39 | 39 | ${SOURCES_DIR}/*.cpp |
|
40 | 40 | ${SOURCES_DIR}/*.h) |
|
41 | 41 | |
|
42 | 42 | # Headers files (.h) |
|
43 | 43 | FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) |
|
44 | 44 | |
|
45 | 45 | # Ui files |
|
46 | 46 | FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) |
|
47 | 47 | |
|
48 | 48 | # Resources files |
|
49 | 49 | FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) |
|
50 | 50 | |
|
51 | 51 | # Retrieve resources files |
|
52 | 52 | FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc) |
|
53 | 53 | |
|
54 | 54 | QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} ) |
|
55 | 55 | |
|
56 | 56 | QT5_WRAP_UI(UIS_HDRS |
|
57 | 57 | ${PROJECT_FORMS} |
|
58 | 58 | ) |
|
59 | 59 | |
|
60 | 60 | |
|
61 | 61 | ADD_EXECUTABLE(${EXECUTABLE_NAME} ${APPLICATION_SOURCES} ${RCC_HDRS} ${UIS_HDRS}) |
|
62 | set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD 14) | |
|
63 | set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) | |
|
64 | ||
|
62 | 65 | target_link_libraries(${EXECUTABLE_NAME} |
|
63 | 66 | ${LIBRARIES}) |
|
64 | 67 | |
|
65 | 68 | # Link with Qt5 modules |
|
66 | 69 | qt5_use_modules(${EXECUTABLE_NAME} Core Widgets) |
|
67 | 70 | |
|
68 | 71 | |
|
69 | 72 | # Add the files to the list of files to be analyzed |
|
70 | 73 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES}) |
|
71 | 74 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) |
|
72 | 75 | # Vera++ exclusion files |
|
73 | 76 | #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) |
|
74 | 77 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
75 | 78 | |
|
76 | 79 | # |
|
77 | 80 | # Compile the tests |
|
78 | 81 | # |
|
79 | 82 | IF(BUILD_TESTS) |
|
80 | 83 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) |
|
81 | 84 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) |
|
82 | 85 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
83 | 86 | SET( TEST_LIBRARIES ${LIBRARIES} ${EXTERN_LIBRARIES}) |
|
84 | 87 | |
|
85 | 88 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
86 | 89 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) |
|
87 | 90 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
88 | 91 | |
|
89 | 92 | # Add to the list of sources files all the sources in the same |
|
90 | 93 | # directory that aren't another test |
|
91 | 94 | FILE (GLOB currentTestSources |
|
92 | 95 | ${testDirectory}/*.c |
|
93 | 96 | ${testDirectory}/*.cpp |
|
94 | 97 | ${testDirectory}/*.h) |
|
95 | 98 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) |
|
96 | 99 | LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
97 | 100 | |
|
98 | 101 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
99 | 102 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
100 | 103 | qt5_use_modules(${testName} Test) |
|
101 | 104 | |
|
102 | 105 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
|
103 | 106 | |
|
104 | 107 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
105 | 108 | ENDFOREACH( testFile ) |
|
106 | 109 | |
|
107 | 110 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
108 | 111 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
|
109 | 112 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) |
|
110 | 113 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
111 | 114 | ENDIF(BUILD_TESTS) |
|
112 | 115 | |
|
113 | 116 | # |
|
114 | 117 | # Set the files that must be formatted by clang-format. |
|
115 | 118 | # |
|
116 | 119 | LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES}) |
|
117 | 120 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
118 | 121 | |
|
119 | 122 | # |
|
120 | 123 | # Set the directories that doxygen must browse to generate the |
|
121 | 124 | # documentation. |
|
122 | 125 | # |
|
123 | 126 | # Source directories: |
|
124 | 127 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") |
|
125 | 128 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
126 | 129 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) |
|
127 | 130 | # Source directories to exclude from the documentation generation |
|
128 | 131 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") |
|
129 | 132 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) |
|
130 | 133 | |
|
131 | 134 | # |
|
132 | 135 | # Set the directories with the sources to analyze and propagate the |
|
133 | 136 | # modification to the parent scope |
|
134 | 137 | # |
|
135 | 138 | # Source directories to analyze: |
|
136 | 139 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
137 | 140 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") |
|
138 | 141 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) |
|
139 | 142 | # Source directories to exclude from the analysis |
|
140 | 143 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") |
|
141 | 144 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
@@ -1,121 +1,123 | |||
|
1 | 1 | |
|
2 | 2 | ## sqpcore - CMakeLists.txt |
|
3 | 3 | STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) |
|
4 | 4 | SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_sqpcore${DEBUG_SUFFIX}") |
|
5 | 5 | SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/") |
|
6 | 6 | |
|
7 | 7 | # Set a variable to display a warning in the version files. |
|
8 | 8 | SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.") |
|
9 | 9 | # Generate the version file from the cmake version variables. The version |
|
10 | 10 | # variables are defined in the cmake/sciqlop_version.cmake file. |
|
11 | 11 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in" |
|
12 | 12 | "${SOURCES_DIR}/Version.h") |
|
13 | 13 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in" |
|
14 | 14 | "${SOURCES_DIR}/Version.cpp") |
|
15 | 15 | |
|
16 | 16 | # |
|
17 | 17 | # Find Qt modules |
|
18 | 18 | # |
|
19 | 19 | SCIQLOP_FIND_QT(Core) |
|
20 | 20 | |
|
21 | 21 | # |
|
22 | 22 | # Compile the library library |
|
23 | 23 | # |
|
24 | 24 | FILE (GLOB_RECURSE MODULE_SOURCES |
|
25 | 25 | ${SOURCES_DIR}/*.c |
|
26 | 26 | ${SOURCES_DIR}/*.cpp |
|
27 | 27 | ${SOURCES_DIR}/*.h) |
|
28 | 28 | |
|
29 | 29 | ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES}) |
|
30 | set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) | |
|
31 | set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) | |
|
30 | 32 | TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${EXTERN_LIBRARIES}) |
|
31 | 33 | qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core) |
|
32 | 34 | |
|
33 | 35 | # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html |
|
34 | 36 | # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. |
|
35 | 37 | # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets |
|
36 | 38 | IF(BUILD_SHARED_LIBS) |
|
37 | 39 | SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") |
|
38 | 40 | ELSE() |
|
39 | 41 | TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") |
|
40 | 42 | ENDIF() |
|
41 | 43 | |
|
42 | 44 | # Set the variable to parent scope so that the other projects can copy the |
|
43 | 45 | # dependent shared libraries |
|
44 | 46 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME) |
|
45 | 47 | |
|
46 | 48 | # Copy extern shared libraries to the lib folder |
|
47 | 49 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) |
|
48 | 50 | |
|
49 | 51 | # Add the files to the list of files to be analyzed |
|
50 | 52 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) |
|
51 | 53 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) |
|
52 | 54 | # Vera++ exclusion files |
|
53 | 55 | #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) |
|
54 | 56 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
55 | 57 | |
|
56 | 58 | # |
|
57 | 59 | # Compile the tests |
|
58 | 60 | # |
|
59 | 61 | IF(BUILD_TESTS) |
|
60 | 62 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) |
|
61 | 63 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) |
|
62 | 64 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
63 | 65 | SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME} ${EXTERN_LIBRARIES}) |
|
64 | 66 | |
|
65 | 67 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
66 | 68 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) |
|
67 | 69 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
68 | 70 | |
|
69 | 71 | # Add to the list of sources files all the sources in the same |
|
70 | 72 | # directory that aren't another test |
|
71 | 73 | FILE (GLOB currentTestSources |
|
72 | 74 | ${testDirectory}/*.c |
|
73 | 75 | ${testDirectory}/*.cpp |
|
74 | 76 | ${testDirectory}/*.h) |
|
75 | 77 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) |
|
76 | 78 | LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
77 | 79 | |
|
78 | 80 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
79 | 81 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
80 | 82 | qt5_use_modules(${testName} Test) |
|
81 | 83 | |
|
82 | 84 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
|
83 | 85 | |
|
84 | 86 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
85 | 87 | ENDFOREACH( testFile ) |
|
86 | 88 | |
|
87 | 89 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
88 | 90 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
|
89 | 91 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) |
|
90 | 92 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
91 | 93 | ENDIF(BUILD_TESTS) |
|
92 | 94 | |
|
93 | 95 | # |
|
94 | 96 | # Set the files that must be formatted by clang-format. |
|
95 | 97 | # |
|
96 | 98 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) |
|
97 | 99 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
98 | 100 | |
|
99 | 101 | # |
|
100 | 102 | # Set the directories that doxygen must browse to generate the |
|
101 | 103 | # documentation. |
|
102 | 104 | # |
|
103 | 105 | # Source directories: |
|
104 | 106 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") |
|
105 | 107 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
106 | 108 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) |
|
107 | 109 | # Source directories to exclude from the documentation generation |
|
108 | 110 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") |
|
109 | 111 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) |
|
110 | 112 | |
|
111 | 113 | # |
|
112 | 114 | # Set the directories with the sources to analyze and propagate the |
|
113 | 115 | # modification to the parent scope |
|
114 | 116 | # |
|
115 | 117 | # Source directories to analyze: |
|
116 | 118 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
117 | 119 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") |
|
118 | 120 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) |
|
119 | 121 | # Source directories to exclude from the analysis |
|
120 | 122 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") |
|
121 | 123 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
@@ -1,138 +1,140 | |||
|
1 | 1 | |
|
2 | 2 | ## sqpgui - CMakeLists.txt |
|
3 | 3 | STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX) |
|
4 | 4 | SET(SQPGUI_LIBRARY_NAME "${LIBRARY_PREFFIX}_sqpgui${DEBUG_SUFFIX}") |
|
5 | 5 | SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
6 | 6 | SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) |
|
7 | 7 | SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/ui) |
|
8 | 8 | SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) |
|
9 | 9 | |
|
10 | 10 | # Set a variable to display a warning in the version files. |
|
11 | 11 | SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.") |
|
12 | 12 | |
|
13 | 13 | # |
|
14 | 14 | # Find Qt modules |
|
15 | 15 | # |
|
16 | 16 | SCIQLOP_FIND_QT(Core Widgets) |
|
17 | 17 | |
|
18 | 18 | # |
|
19 | 19 | # Compile the library library |
|
20 | 20 | # |
|
21 | 21 | FILE (GLOB_RECURSE MODULE_SOURCES |
|
22 | 22 | ${SOURCES_DIR}/*.c |
|
23 | 23 | ${SOURCES_DIR}/*.cpp |
|
24 | 24 | ${SOURCES_DIR}/*.h) |
|
25 | 25 | |
|
26 | 26 | # Headers files (.h) |
|
27 | 27 | FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) |
|
28 | 28 | |
|
29 | 29 | # Ui files |
|
30 | 30 | FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) |
|
31 | 31 | |
|
32 | 32 | # Resources files |
|
33 | 33 | FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) |
|
34 | 34 | |
|
35 | 35 | QT5_ADD_RESOURCES(RCC_HDRS |
|
36 | 36 | ${PROJECT_RESOURCES} |
|
37 | 37 | ) |
|
38 | 38 | |
|
39 | 39 | QT5_WRAP_UI(UIS_HDRS |
|
40 | 40 | ${PROJECT_FORMS} |
|
41 | 41 | ) |
|
42 | 42 | |
|
43 | 43 | include_directories("${CMAKE_CURRENT_BINARY_DIR}") |
|
44 | 44 | message(CURRENT INCLUDE : ${CMAKE_CURRENT_BINARY_DIR}) |
|
45 | 45 | |
|
46 | 46 | ADD_LIBRARY(${SQPGUI_LIBRARY_NAME} ${MODULE_SOURCES} ${UIS_HDRS}) |
|
47 | set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD 14) | |
|
48 | set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) | |
|
47 | 49 | TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${EXTERN_LIBRARIES}) |
|
48 | 50 | qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets) |
|
49 | 51 | |
|
50 | 52 | # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html |
|
51 | 53 | # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order. |
|
52 | 54 | # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets |
|
53 | 55 | IF(BUILD_SHARED_LIBS) |
|
54 | 56 | SET_TARGET_PROPERTIES(${SQPGUI_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT") |
|
55 | 57 | ELSE() |
|
56 | 58 | TARGET_COMPILE_DEFINITIONS(${SQPGUI_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES") |
|
57 | 59 | ENDIF() |
|
58 | 60 | |
|
59 | 61 | # Set the variable to parent scope so that the other projects can copy the |
|
60 | 62 | # dependent shared libraries |
|
61 | 63 | SCIQLOP_SET_TO_PARENT_SCOPE(SQPGUI_LIBRARY_NAME) |
|
62 | 64 | |
|
63 | 65 | # Copy extern shared libraries to the lib folder |
|
64 | 66 | SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPGUI_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES}) |
|
65 | 67 | |
|
66 | 68 | # Add the files to the list of files to be analyzed |
|
67 | 69 | LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES}) |
|
68 | 70 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES) |
|
69 | 71 | # Vera++ exclusion files |
|
70 | 72 | #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl) |
|
71 | 73 | SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES) |
|
72 | 74 | |
|
73 | 75 | # |
|
74 | 76 | # Compile the tests |
|
75 | 77 | # |
|
76 | 78 | IF(BUILD_TESTS) |
|
77 | 79 | INCLUDE_DIRECTORIES(${SOURCES_DIR}) |
|
78 | 80 | FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp) |
|
79 | 81 | FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h) |
|
80 | 82 | SET( TEST_LIBRARIES ${SQPGUI_LIBRARY_NAME} ${EXTERN_LIBRARIES}) |
|
81 | 83 | |
|
82 | 84 | FOREACH( testFile ${TESTS_SOURCES} ) |
|
83 | 85 | GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY ) |
|
84 | 86 | GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE ) |
|
85 | 87 | |
|
86 | 88 | # Add to the list of sources files all the sources in the same |
|
87 | 89 | # directory that aren't another test |
|
88 | 90 | FILE (GLOB currentTestSources |
|
89 | 91 | ${testDirectory}/*.c |
|
90 | 92 | ${testDirectory}/*.cpp |
|
91 | 93 | ${testDirectory}/*.h) |
|
92 | 94 | LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES}) |
|
93 | 95 | LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS}) |
|
94 | 96 | |
|
95 | 97 | ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources}) |
|
96 | 98 | TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} ) |
|
97 | 99 | qt5_use_modules(${testName} Test) |
|
98 | 100 | |
|
99 | 101 | ADD_TEST( NAME ${testName} COMMAND ${testName} ) |
|
100 | 102 | |
|
101 | 103 | SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES}) |
|
102 | 104 | ENDFOREACH( testFile ) |
|
103 | 105 | |
|
104 | 106 | LIST(APPEND testFilesToFormat ${TESTS_SOURCES}) |
|
105 | 107 | LIST(APPEND testFilesToFormat ${TESTS_HEADERS}) |
|
106 | 108 | LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat}) |
|
107 | 109 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
108 | 110 | ENDIF(BUILD_TESTS) |
|
109 | 111 | |
|
110 | 112 | # |
|
111 | 113 | # Set the files that must be formatted by clang-format. |
|
112 | 114 | # |
|
113 | 115 | LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES}) |
|
114 | 116 | SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES) |
|
115 | 117 | |
|
116 | 118 | # |
|
117 | 119 | # Set the directories that doxygen must browse to generate the |
|
118 | 120 | # documentation. |
|
119 | 121 | # |
|
120 | 122 | # Source directories: |
|
121 | 123 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs") |
|
122 | 124 | LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
123 | 125 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS) |
|
124 | 126 | # Source directories to exclude from the documentation generation |
|
125 | 127 | #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*") |
|
126 | 128 | SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS) |
|
127 | 129 | |
|
128 | 130 | # |
|
129 | 131 | # Set the directories with the sources to analyze and propagate the |
|
130 | 132 | # modification to the parent scope |
|
131 | 133 | # |
|
132 | 134 | # Source directories to analyze: |
|
133 | 135 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src") |
|
134 | 136 | LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests") |
|
135 | 137 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS) |
|
136 | 138 | # Source directories to exclude from the analysis |
|
137 | 139 | #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir") |
|
138 | 140 | SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS) |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now