Repository: conan-io/conan

Issue:
QBS generator cppflags -vs- cxxflags
Given the refactor of the `cppflags` variable in https://github.com/conan-io/conan/pull/4716, we realized that we are mixing the meaning of `cppflags` and `cxxflags` variable in the output file. According to the [docs](https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#cppFlags-prop):

![image](https://user-images.githubusercontent.com/1406456/54273048-47423900-4585-11e9-896c-4a27050bfe3e.png)

Now the template for the file content is

```python
        template = ('    Product {{\n'
                    '        name: "{dep}"\n'
                    '        Export {{\n'
                    '            Depends {{ name: "cpp" }}\n'
                    '            cpp.includePaths: [{deps.include_paths}]\n'
                    '            cpp.libraryPaths: [{deps.lib_paths}]\n'
                    '            cpp.systemIncludePaths: [{deps.bin_paths}]\n'
                    '            cpp.dynamicLibraries: [{deps.libs}]\n'
                    '            cpp.defines: [{deps.defines}]\n'
                    '            cpp.cppFlags: [{deps.cxxflags}]\n'  # TODO: cppFlags -> cxxFlags?
                    '            cpp.cFlags: [{deps.cflags}]\n'
                    '            cpp.linkerFlags: [{deps.linkerFlags}]\n'
                    '        }}\n'
                    '    }}\n')
```

we should reassign those `cppFlags` and `cxxFlags`.


QBS generator cppflags -vs- cxxflags
Given the refactor of the `cppflags` variable in https://github.com/conan-io/conan/pull/4716, we realized that we are mixing the meaning of `cppflags` and `cxxflags` variable in the output file. According to the [docs](https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#cppFlags-prop):

![image](https://user-images.githubusercontent.com/1406456/54273048-47423900-4585-11e9-896c-4a27050bfe3e.png)

Now the template for the file content is

```python
        template = ('    Product {{\n'
                    '        name: "{dep}"\n'
                    '        Export {{\n'
                    '            Depends {{ name: "cpp" }}\n'
                    '            cpp.includePaths: [{deps.include_paths}]\n'
                    '            cpp.libraryPaths: [{deps.lib_paths}]\n'
                    '            cpp.systemIncludePaths: [{deps.bin_paths}]\n'
                    '            cpp.dynamicLibraries: [{deps.libs}]\n'
                    '            cpp.defines: [{deps.defines}]\n'
                    '            cpp.cppFlags: [{deps.cxxflags}]\n'  # TODO: cppFlags -> cxxFlags?
                    '            cpp.cFlags: [{deps.cflags}]\n'
                    '            cpp.linkerFlags: [{deps.linkerFlags}]\n'
                    '        }}\n'
                    '    }}\n')
```

we should reassign those `cppFlags` and `cxxFlags`.




Discussion:
@jgsogo, in Qbs cxxFlags is not recognized by toolchain implementations other than "gcc" and probably "clang" which is based upon gcc:

```
/qbs/modules/cpp(master) $ grep -R cxxFlags
CppModule.qbs:    property stringList cxxFlags
CppModule.qbs:        name: "cxxFlags"
CppModule.qbs:    property stringList objcxxFlags
CppModule.qbs:        name: "objcxxFlags"
CppModule.qbs:    property stringList platformObjcxxFlags
GenericGCC.qbs:        validator.addCustomValidator("cxxFlags", cxxFlags, validateFlagsFunction, msg);
GenericGCC.qbs:        validator.addCustomValidator("objcxxFlags", objcxxFlags, validateFlagsFunction, msg);
GenericGCC.qbs:        validator.addCustomValidator("platformObjcxxFlags", platformObjcxxFlags, validateFlagsFunction, msg);
ios-gcc.qbs:    platformObjcxxFlags: base.concat(simulatorObjcFlags)
```

But neither is `cppFlags` This should probably become a ticket in Qbs.
Qt deprecated `QBS` on October 29th, 2018, so I think they won't pay much attention to new issues 😞  +info: https://wiki.qt.io/Qbs
I know, but that doesn't mean the project is dead. See https://github.com/qbs/qbs/commits/master for the recent commit history. The Qt Company has always put only a minimum amount of resources to Qbs. Shutting that down to 0 doesn't make much difference.
@jgsogo, in Qbs cxxFlags is not recognized by toolchain implementations other than "gcc" and probably "clang" which is based upon gcc:

```
/qbs/modules/cpp(master) $ grep -R cxxFlags
CppModule.qbs:    property stringList cxxFlags
CppModule.qbs:        name: "cxxFlags"
CppModule.qbs:    property stringList objcxxFlags
CppModule.qbs:        name: "objcxxFlags"
CppModule.qbs:    property stringList platformObjcxxFlags
GenericGCC.qbs:        validator.addCustomValidator("cxxFlags", cxxFlags, validateFlagsFunction, msg);
GenericGCC.qbs:        validator.addCustomValidator("objcxxFlags", objcxxFlags, validateFlagsFunction, msg);
GenericGCC.qbs:        validator.addCustomValidator("platformObjcxxFlags", platformObjcxxFlags, validateFlagsFunction, msg);
ios-gcc.qbs:    platformObjcxxFlags: base.concat(simulatorObjcFlags)
```

But neither is `cppFlags` This should probably become a ticket in Qbs.
Qt deprecated `QBS` on October 29th, 2018, so I think they won't pay much attention to new issues 😞  +info: https://wiki.qt.io/Qbs
I know, but that doesn't mean the project is dead. See https://github.com/qbs/qbs/commits/master for the recent commit history. The Qt Company has always put only a minimum amount of resources to Qbs. Shutting that down to 0 doesn't make much difference.

Resolving patch:
diff --git a/conans/client/generators/qbs.py b/conans/client/generators/qbs.py
old mode 100644
new mode 100755
--- a/conans/client/generators/qbs.py
+++ b/conans/client/generators/qbs.py
@@ -40,7 +40,7 @@ def content(self):
                     '            cpp.systemIncludePaths: [{deps.bin_paths}]\n'
                     '            cpp.dynamicLibraries: [{deps.libs}]\n'
                     '            cpp.defines: [{deps.defines}]\n'
-                    '            cpp.cppFlags: [{deps.cxxflags}]\n'  # TODO: cppFlags -> cxxFlags?
+                    '            cpp.cxxFlags: [{deps.cxxflags}]\n'
                     '            cpp.cFlags: [{deps.cflags}]\n'
                     '            cpp.linkerFlags: [{deps.linkerFlags}]\n'
                     '        }}\n'


Test patch: