stdware / qwindowkit

Cross-platform frameless window framework for Qt. Support Windows, macOS, Linux.
Apache License 2.0
442 stars 67 forks source link

Does not work with qmsetup (generating unnecessary outputs from a folder) #70

Closed Sepera-okeq closed 2 months ago

Sepera-okeq commented 3 months ago

Using this repository as a library causes strange behavior that leads to a breakdown.

Reproducing the problem:

For my project, I made an addition as a qmsetup module in the qmsetup folder, then I made it as a QWK module in the resources/library folder

I used add_subdirectory(resources/library/qwindowkit) and stuff like LINKS QWKWidgets from the example MainWindow.

When building a project, it outputs the following log:

\resources\library\qwindowkit\src\widgets\widgetitemdelegate.cpp(11): fatal error C1083: The file cannot be opened: QWKCore/private/abstractwindowcontext_p.h: No such file or directory,
resources\library\qwindowkit\include\QWKCore\private\../../../../../../../NewLaucnher/resources/library/qwindowkit/src/core/windowagentbase_p.h(18): fatal error C1083: Не удается открыть файл включение: QWKCore/private/abstractwindowcontext_p.h: No such file or directory,
resources\library\qwindowkit\include\QWKCore\private\../../../../../../../NewLaucnher/resources/library/qwindowkit/src/core/windowagentbase_p.h(18): fatal error C1083: Не удается открыть файл включение: QWKCore/private/abstractwindowcontext_p.h: No such file or directory,

I decided to just add it as in your example (I moved it to the repository as a submodule in the library) - as a result, there are some problems with qmsetup (or in the project itself), but it does not want to collect private QWKCore headers.

Use Windows 11, Qt 6, MSVS

My temporary solution (It's a crutch of some kind...)

Open file in build folder (abstractwindowcontext_p.h)

// broken (autogen)
#include "../../../../../../../<root project>/resources/library/qwindowkit/src/core/contexts/abstractwindowcontext_p.h"
// normal
#include "../../../../../<root project>/resources/library/qwindowkit/src/core/contexts/abstractwindowcontext_p.h"
Sepera-okeq commented 3 months ago

P.S Changing this parameter made it possible to use the repository without any corrections (as a submodule + using add_subdirectory() and LINKS) (except for this of course!)

set(QWINDOWKIT_BUILD_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/../etc/include)

Remove ../

set(QWINDOWKIT_BUILD_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/etc/include)

In fact, your repository does not allow you to just use it in another project on qmsetup, because it was expected that it would collect and then just spit it out in build (+with automatic installation). Or maybe I made a mistake in something?

SineStriker commented 3 months ago

Sorry I cannot quite understand your description. Could you please upload a minimum project that reprocudes this issue?

mentalfl0w commented 2 months ago

@SineStriker 你好,我也遇到了这个问题,qwindowkit不能被置于多重目录下,如果是2-3层,如3rdparty/qwindowkit是可以的,但是如果是3rdparty/RibbonUI/lib_source/3rdparty/qwindowkit这样多重的目录,将会出现与@Sepera-okeq 一样的错误,我最终通过放置在二级目录下解决。 复现步骤:

  1. git clone https://github.com/mentalfl0w/RibbonTemplate.git
  2. cd RibbonTemplate
  3. git switch -d c61c647
  4. mkdir build
  5. cmake --build ./build --target all
SineStriker commented 2 months ago

@SineStriker 你好,我也遇到了这个问题,qwindowkit不能被置于多重目录下,如果是2-3层,如3rdparty/qwindowkit是可以的,但是如果是3rdparty/RibbonUI/lib_source/3rdparty/qwindowkit这样多重的目录,将会出现与@Sepera-okeq 一样的错误,我最终通过放置在二级目录下解决。 复现步骤:

  1. git clone https://github.com/mentalfl0w/RibbonTemplate.git
  2. cd RibbonTemplate
  3. git switch -d c61c647
  4. mkdir build
  5. cmake --build ./build --target all

我试了一下,放在四层目录里都没发现问题...

mentalfl0w commented 2 months ago

@SineStriker 你好,我也遇到了这个问题,qwindowkit不能被置于多重目录下,如果是2-3层,如3rdparty/qwindowkit是可以的,但是如果是3rdparty/RibbonUI/lib_source/3rdparty/qwindowkit这样多重的目录,将会出现与@Sepera-okeq 一样的错误,我最终通过放置在二级目录下解决。 复现步骤:

  1. git clone https://github.com/mentalfl0w/RibbonTemplate.git
  2. cd RibbonTemplate
  3. git switch -d c61c647
  4. mkdir build
  5. cmake --build ./build --target all

我试了一下,放在四层目录里都没发现问题...

也有可能是子项目嵌套导致的,因为我是Aadd_subdirectoryB,Badd_subdirectoryqwindowkit,然后编译A的时候就出现这个问题了,直接从A链接B目录下的qwindowkit也是一样的问题,但如果将qwindowkit放在A的二级目录下再编译就可以了。 如果方便的话,可以直接在Qt Creator内打开我昨天提到的那个样本项目,切换到c61c647提交,再编译,将在mingw和msvc两个编译链下复现此问题。

SineStriker commented 2 months ago

3. c61c647

这个分支在我这里成功编译通过了

mentalfl0w commented 2 months ago

我在GitHub Action的Windows Server上也测试通过,但是在AMD64的电脑/虚拟机中编译不通过,出现上述报错。系统:Windows 11和Windows 10环境:Qt 6.5.3、Qt 6.6.3、Qt 6.7.0但是macOS下均测试通过。方便告知一下测试环境吗?在 2024年5月4日,16:00,SineStriker @.***> 写道:

  1. c61c647

这个分支在我这里成功编译通过了

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

SineStriker commented 2 months ago

我在GitHub Action的Windows Server上也测试通过,但是在AMD64的电脑/虚拟机中编译不通过,出现上述报错。系统:Windows 11和Windows 10环境:Qt 6.5.3、Qt 6.6.3、Qt 6.7.0但是macOS下均测试通过。方便告知一下测试环境吗?在 2024年5月4日,16:00,SineStriker @.> 写道: 3. c61c647 这个分支在我这里成功编译通过了 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.>

Windows 10,Qt 6.6.1

mentalfl0w commented 2 months ago

我在GitHub Action的Windows Server上也测试通过,但是在AMD64的电脑/虚拟机中编译不通过,出现上述报错。系统:Windows 11和Windows 10环境:Qt 6.5.3、Qt 6.6.3、Qt 6.7.0但是macOS下均测试通过。方便告知一下测试环境吗?在 2024年5月4日,16:00,SineStriker @.**> 写道: 3. c61c647 这个分支在我这里成功编译通过了 —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.**>

Windows 10,Qt 6.6.1

Windows 11, Qt 6.6.1,MSVC2019测试不通过

image

补充:Qt 6.6.1,MinGW测试也不通过,同时它只有管理员权限运行才可以完成cmake的configure

image
SineStriker commented 2 months ago

管理员权限这事你去看看是不是qmcorecmd被Windows识别为安装包了。我建议你把你的项目放在某个盘的根目录编译试试,我怀疑是路径太长的缘故。

mentalfl0w commented 2 months ago

管理员权限这事你去看看是不是qmcorecmd被Windows识别为安装包了。我建议你把你的项目放在某个盘的根目录编译试试,我怀疑是路径太长的缘故。

确实是路径太长了,放在C盘根目录下就一切正常。 MinGW版本的configure流程是在install步骤下出的错,有可能是被识别成安装包了。

image
SineStriker commented 2 months ago

管理员权限这事你去看看是不是qmcorecmd被Windows识别为安装包了。我建议你把你的项目放在某个盘的根目录编译试试,我怀疑是路径太长的缘故。

确实是路径太长了,放在C盘根目录下就一切正常。 MinGW版本的configure流程是在install步骤下出的错,有可能是被识别成安装包了。 image

我明白了,是mingw把清单给忽略了,那我稍微改改qmsetup。

SineStriker commented 2 months ago

麻烦您现在再试试

mentalfl0w commented 2 months ago

麻烦您现在再试试

MinGW一切正常,非常感谢👍

image
SineStriker commented 2 months ago

Using this repository as a library causes strange behavior that leads to a breakdown.

Reproducing the problem:

For my project, I made an addition as a qmsetup module in the qmsetup folder, then I made it as a QWK module in the resources/library folder

I used add_subdirectory(resources/library/qwindowkit) and stuff like LINKS QWKWidgets from the example MainWindow.

When building a project, it outputs the following log:

\resources\library\qwindowkit\src\widgets\widgetitemdelegate.cpp(11): fatal error C1083: The file cannot be opened: QWKCore/private/abstractwindowcontext_p.h: No such file or directory,
resources\library\qwindowkit\include\QWKCore\private\../../../../../../../NewLaucnher/resources/library/qwindowkit/src/core/windowagentbase_p.h(18): fatal error C1083: Не удается открыть файл включение: QWKCore/private/abstractwindowcontext_p.h: No such file or directory,
resources\library\qwindowkit\include\QWKCore\private\../../../../../../../NewLaucnher/resources/library/qwindowkit/src/core/windowagentbase_p.h(18): fatal error C1083: Не удается открыть файл включение: QWKCore/private/abstractwindowcontext_p.h: No such file or directory,

I decided to just add it as in your example (I moved it to the repository as a submodule in the library) - as a result, there are some problems with qmsetup (or in the project itself), but it does not want to collect private QWKCore headers.

Use Windows 11, Qt 6, MSVS

My temporary solution (It's a crutch of some kind...)

Open file in build folder (abstractwindowcontext_p.h)

// broken (autogen)
#include "../../../../../../../<root project>/resources/library/qwindowkit/src/core/contexts/abstractwindowcontext_p.h"
// normal
#include "../../../../../<root project>/resources/library/qwindowkit/src/core/contexts/abstractwindowcontext_p.h"

Consider put your repository in the root of the drive, I guess the issue should be caused by the long-path strategy.