##// END OF EJS Templates
Inclusion de core dans app commenté pour éviter un warning cmake. Sera remis au norme lors des implémentation
perrinel -
r12:173cd0fbc359
parent child
Show More
@@ -1,141 +1,141
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 get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION)
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 62 target_link_libraries(${EXECUTABLE_NAME}
63 63 ${LIBRARIES})
64 64
65 65 # Link with Qt5 modules
66 66 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
67 67
68 68
69 69 # Add the files to the list of files to be analyzed
70 70 LIST(APPEND CHECKSTYLE_INPUT_FILES ${APPLICATION_SOURCES})
71 71 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
72 72 # Vera++ exclusion files
73 73 #LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/path/to/exclusionFiles.tcl)
74 74 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
75 75
76 76 #
77 77 # Compile the tests
78 78 #
79 79 IF(BUILD_TESTS)
80 80 INCLUDE_DIRECTORIES(${SOURCES_DIR})
81 81 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
82 82 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
83 83 SET( TEST_LIBRARIES ${LIBRARIES} ${EXTERN_LIBRARIES})
84 84
85 85 FOREACH( testFile ${TESTS_SOURCES} )
86 86 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
87 87 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
88 88
89 89 # Add to the list of sources files all the sources in the same
90 90 # directory that aren't another test
91 91 FILE (GLOB currentTestSources
92 92 ${testDirectory}/*.c
93 93 ${testDirectory}/*.cpp
94 94 ${testDirectory}/*.h)
95 95 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
96 96 LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
97 97
98 98 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
99 99 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
100 100 qt5_use_modules(${testName} Test)
101 101
102 102 ADD_TEST( NAME ${testName} COMMAND ${testName} )
103 103
104 104 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
105 105 ENDFOREACH( testFile )
106 106
107 107 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
108 108 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
109 109 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
110 110 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
111 111 ENDIF(BUILD_TESTS)
112 112
113 113 #
114 114 # Set the files that must be formatted by clang-format.
115 115 #
116 116 LIST (APPEND FORMATTING_INPUT_FILES ${APPLICATION_SOURCES})
117 117 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
118 118
119 119 #
120 120 # Set the directories that doxygen must browse to generate the
121 121 # documentation.
122 122 #
123 123 # Source directories:
124 124 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
125 125 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
126 126 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
127 127 # Source directories to exclude from the documentation generation
128 128 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
129 129 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
130 130
131 131 #
132 132 # Set the directories with the sources to analyze and propagate the
133 133 # modification to the parent scope
134 134 #
135 135 # Source directories to analyze:
136 136 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
137 137 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
138 138 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
139 139 # Source directories to exclude from the analysis
140 140 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
141 141 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
General Comments 0
You need to be logged in to leave comments. Login now