We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.8.9
windows10
QT工程,使用xmake project -k cmake 指令生成CMake文件之后,无法直接使用Qt Creator编译,提示错误
似乎是因为生成的cl 指令参数中带有 将cmake工程生成脚本中的 _translate_flag函数修改后可以正常运行,修改后的文件位于工程目录下的 plugins/project_test/cmake文件夹中
-- translate flag function _translate_flag(flag, outputdir) if flag then if path.instance_of(flag) then --flag = flag:clone():set(_get_relative_unix_path_to_cmake(flag:str(), outputdir)):str() flag = flag:clone():set(_get_relative_unix_path_to_cmake(flag:rawstr(), outputdir)):str() -- it may be table, https://github.com/xmake-io/xmake/issues/4816 elseif type(flag) == "string" then if path.is_absolute(flag) then flag = _get_relative_unix_path_to_cmake(flag, outputdir) elseif flag:startswith("-fmodule-file=") then flag = "-fmodule-file=" .. _get_relative_unix_path_to_cmake(flag:sub(15), outputdir) elseif flag:startswith("-fmodule-mapper=") then flag = "-fmodule-mapper=" .. _get_relative_unix_path_to_cmake(flag:sub(17), outputdir) elseif flag:startswith("-F") then if flag:startswith("-Fd") then flag = '-Fd' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-Fe") then flag = '-Fe' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-Fi") then flag = '-Fi' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-FI") then flag = '-FI' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-Fo") then flag = '-Fo' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-Fp") then flag = '-Fp' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-FR") then flag = '-FR' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:startswith("-Fr") then flag = '-Fr' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif string.len(flag) > 5 then flag = '-F' .. _get_relative_unix_path_to_cmake(flag:sub(3), outputdir) end elseif flag:startswith("-I") then flag = '-I' .. _get_relative_unix_path_to_cmake(flag:sub(3), outputdir) elseif flag:startswith("-external:I") then flag = '-external:I' .. _get_relative_unix_path_to_cmake(flag:sub(12), outputdir) elseif flag:startswith("-Yu") then flag = '-Yu' .. _get_relative_unix_path_to_cmake(flag:sub(4), outputdir) elseif flag:match("(.+)=(.+)") then local k, v = flag:match("(.+)=(.+)") if v and (v:endswith(".ifc") or v:endswith(".map")) then -- e.g. hello=xxx/hello.ifc flag = k .. "=" .. _get_relative_unix_path_to_cmake(v, outputdir) end end end end return flag end
测试工程 qt_test.zip
生成后可以直接生成
...
....
The text was updated successfully, but these errors were encountered:
Bot detected the issue body's language is not English, translate it automatically.
Title: QT project, after generating the CMake file, cannot be compiled directly using Qt Creator
Sorry, something went wrong.
试下这个 patch #4888
xmake update -s dev
可以了么
Is it okay?
No branches or pull requests
Xmake 版本
2.8.9
操作系统版本和架构
windows10
描述问题
QT工程,使用xmake project -k cmake 指令生成CMake文件之后,无法直接使用Qt Creator编译,提示错误
似乎是因为生成的cl 指令参数中带有
将cmake工程生成脚本中的 _translate_flag函数修改后可以正常运行,修改后的文件位于工程目录下的 plugins/project_test/cmake文件夹中
测试工程
qt_test.zip
期待的结果
生成后可以直接生成
工程配置
...
附加信息和错误日志
....
The text was updated successfully, but these errors were encountered: