@@ -42,12 +42,12 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
42
42
for ext := range globals .SourceFilesValidExtensions {
43
43
validExportExtensions = append (validExportExtensions , ext )
44
44
}
45
- var dotHExtension = []string {}
45
+ var validHeaderExtensions = []string {}
46
46
for ext := range globals .HeaderFilesValidExtensions {
47
47
validExportExtensions = append (validExportExtensions , ext )
48
- dotHExtension = append (dotHExtension , ext )
48
+ validHeaderExtensions = append (validHeaderExtensions , ext )
49
49
}
50
- var dotAExtension = []string {".a" }
50
+ var validStaticLibExtensions = []string {".a" }
51
51
52
52
if s .SketchError || ! canExportCmakeProject (ctx ) {
53
53
return nil
@@ -95,7 +95,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
95
95
}
96
96
97
97
// Remove stray folders contining incompatible or not needed libraries archives
98
- files , _ := utils .FindFilesInFolder (libDir .Join ("src" ), true , dotAExtension )
98
+ files , _ := utils .FindFilesInFolder (libDir .Join ("src" ), true , validStaticLibExtensions )
99
99
for _ , file := range files {
100
100
staticLibDir := file .Parent ()
101
101
if ! isStaticLib || ! strings .Contains (staticLibDir .String (), mcu ) {
@@ -165,11 +165,11 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
165
165
extractCompileFlags (ctx , "recipe.cpp.o.pattern" , & defines , & dynamicLibsFromGccMinusL , & linkerflags , & linkDirectories )
166
166
167
167
// Extract folders with .h in them for adding in include list
168
- headerFiles , _ := utils .FindFilesInFolder (cmakeFolder , true , dotHExtension )
169
- foldersContainingDotH := findUniqueFoldersRelative (headerFiles .AsStrings (), cmakeFolder .String ())
168
+ headerFiles , _ := utils .FindFilesInFolder (cmakeFolder , true , validHeaderExtensions )
169
+ foldersContainingHeaders := findUniqueFoldersRelative (headerFiles .AsStrings (), cmakeFolder .String ())
170
170
171
171
// Extract folders with .a in them for adding in static libs paths list
172
- staticLibs , _ := utils .FindFilesInFolder (cmakeFolder , true , dotAExtension )
172
+ staticLibs , _ := utils .FindFilesInFolder (cmakeFolder , true , validStaticLibExtensions )
173
173
174
174
// Generate the CMakeLists global file
175
175
@@ -179,7 +179,7 @@ func (s *ExportProjectCMake) Run(ctx *types.Context) error {
179
179
cmakelist += "INCLUDE(FindPkgConfig)\n "
180
180
cmakelist += "project (" + projectName + " C CXX)\n "
181
181
cmakelist += "add_definitions (" + strings .Join (defines , " " ) + " " + strings .Join (linkerflags , " " ) + ")\n "
182
- cmakelist += "include_directories (" + foldersContainingDotH + ")\n "
182
+ cmakelist += "include_directories (" + foldersContainingHeaders + ")\n "
183
183
184
184
// Make link directories relative
185
185
// We can totally discard them since they mostly are outside the core folder
0 commit comments