Open Wongboo opened 3 years ago
looks like cmake doesn't support variable with unicode name like 한국어
, instead of generating ${}
, maybe generating ${other char}
is better?
Better rename your symbols to latin words that cmake supports
For existing project with loads of unicode variable, It might be hard to change, how about: CMakesLists.txt
source_group("help" FILES ${help})
source_group("中文Πhappy" FILES ${unicode_var1}) # unicode_var1 means 中文Πhappy
source_group("한국어" FILES ${unicode_var2}) # unicode_var2 means 한국어
source_group("にほんご" FILES ${unicode_var3}) # unicode_var1 means にほんご
stdout
info/warning: detect unicode variable "にほんご", rename to unicode_var3
I don't like Idea of generating names. Considered this from the very beginning.
I shall not implement a thing that CMake does not support. You may help CMake to implement it first if you want.
I fixed this problem with 33d75594660e746bdec. You should get warning like check conversion "{}" -> "{}"
Have you checked all the warnings before creating this issue?
And renaming is not hard. Just open UI and rename all non latin filters. It's prepearing step for conversion. Then you may convert easily.
I find that I may need to reopen this issue, because visual studio under certain default language will generate unicode character forever as they are default choose, the words in English are Source Files
, Header Files
, Resource Files
Language | word1 | word2 | word3 |
---|---|---|---|
English | Source Files | Header Files | Resource Files |
Chinese(Simplified) | 源文件 | 头文件 | 资源文件 |
Chinese(Traditional) | 原始程式檔 | 標頭檔 | 資源檔 |
Japanese | ソースファイル | ヘッダーファイル | リソースファイル |
Korean | 원본 파일 | 헤더 파일 | 리소스 파일 |
Maybe a map for these words are necessary
What are you proposing? Translate with cmake-converter?
If you need to convert you may create your own tool that replace unicode at your files with generated latin ones. Convert. Then replace back at CMakeLists.txt to that format that you would like.
No, visual studio seems only generate these 3 unicode words for each language(all in my table), just map them to English can fix the problem, no need to translate every unicode word
If user use some unicode words, they should fix themselves. But for the words generated by visual studio default setting for these language mode, map them to English, because you can't assume everyone use VS in English mode
Source Files
, Header Files
, Resource Files
are predefined logical folders (filters) in vcproj.filter. If you don't use VS in English, VS will translate Source Files
, Header Files
, Resource Files
, for some language like French, it doesn't matter, for some, it does.
No need to translate every word, just these three predefined logical filters
Again. I do not want to check in any translator into cmake-converter codebase. I do not want to implement any "hacky and partial solution". This is partial solution at least because you cannot guarantee that you have the full list of predefined values. Also this is partial solution because it does not cover all languages that have unicode symbols. Since it's partial - I won't implement and support this.
But nice try for hack this for asian users.
People can complete this dictionary later on, this need more people's help. This partial dictionary won't even slow down for English users, will bring help to asian language users and actually give a template for other language, This is a partial fix, but the only downside is that it slow down a bit for unicode users, I don't see why don't use it.
If we have such lines with unicode in
vcxproj.filters
they will eventually become
As you can see, because cmakeconverter ignore all unicode character, the filter with only unicode character will become variable with no name, eventually cause trouble, such as
한국어
, we can fix in two ways: