Merge "[CMakeList generator] Fix executable name"

This commit is contained in:
Fabien Sanglard 2017-03-28 00:30:17 +00:00 committed by Gerrit Code Review
commit 27b812d0d2
1 changed files with 7 additions and 1 deletions

View File

@ -163,9 +163,15 @@ func generateCLionProject(compiledModule CompiledInterface, ctx blueprint.Single
translateToCMake(cppParameters, f, false, true)
// Add project executable.
f.WriteString(fmt.Sprintf("\nadd_executable(%s ${SOURCE_FILES})\n", ccModule.ModuleBase.Name()))
f.WriteString(fmt.Sprintf("\nadd_executable(%s ${SOURCE_FILES})\n",
cleanExecutableName(ccModule.ModuleBase.Name())))
}
func cleanExecutableName(s string) string {
return strings.Replace(s, "@", "-", -1)
}
func translateToCMake(c compilerParameters, f *os.File, cflags bool, cppflags bool) {
writeAllSystemDirectories(c.systemHeaderSearchPath, f)
writeAllIncludeDirectories(c.headerSearchPath, f)