Open PTavse opened 6 years ago
I must admit I do not particularly like this solution... It is too "unconventional". Have you tried to build a vcpkg port? I am just curious if one could create an out-of-source vcpkg port and inject it into user's %USERPRFILE%\.vcpkg
folder...:
mklink "%~d0..\..\ports\qglviewer" "%VCPKGROOT%\ports"
@apattnaik0721013 Would vcpkg recognize it? I see no reason why it shouldn't. This way we could use the official repo with injected ports which we maintain separately...
@PTavse It does not work for me. Whatever I do qmake libQGLViewer-2.7.1.pro -spec win32-msvc CONFIG+=Debug
produces the following error:
Could not find qmake configuration file win32-msvc.
Error processing project file: libQGLViewer-2.7.1.pro
I hate Qt... I have tried everything except re-building qt5-base which I am doing now.
Note that the qmake.exe
inside vcpkg is currently only meant for us to build other qt projects internally -- it won't work "out-of-the-box" to build other projects because you need to generate an appropriate qt.conf
on demand[1] for your configuration.
Thus it will probably be easier to package QGLViewer as a port and use our helper vcpkg_configure_qmake()
to deal with it.
Yeah, I was too optimistic... The qmake.exe in tools\qt5 seems partially functional. It finds all tools and builds the libs. It just puts everything into weird locations and I'm unable to figure out how to control it. So making a port is definitely a better choice...
That's right. qmake.exe won't work out-of-box without proper configuration. I will try preparing vcpkg port for that.
@PTavse Did it work for you in the first place? For me, I actually could use qmake and other Qt tools as proposed with few exceptions: The command line for qmake
is qmake libQGLViewer-2.7.1.pro CONFIG-=debug CONFIG+=release
for a Release
build and qmake libQGLViewer-2.7.1.pro CONFIG-=release CONFIG+=debug
for a Debug
build (case sensitive). I haven't seen any influence of the -spec win32-msvc
option, it is either completely controlled by the environment prepared via vcvarsall.bat
or there is other magic involved. Please check how vcpkg
sets the toolchain options (-spec
) starting at the file referenced by @ras0219-msft There seems to be a pair of CMake template files qt_release.conf
and qt_release.conf
which are configured at proper locations whenever qmake
is used, please check the content to see what we were doing wrong.
I was spending time on this in order to see if we can use the Qt tooling built via vcpkg install qt5-base
for building "side-project", i.e. projects for which we do not have (or do not want) a vcpkg port. I guess it should work, this would be a question for @ras0219-msft: How is the Qt installation created by vcpkg
special? The toolchain is complete, the environment is compatible so it should work. I'd like to consider the vcpkg Qt installation process a fully functional substitute for the official Qt installer... This would solve all the compatibility problems you usually run into when trying to use the official Qt binaries with other projects.
How is the Qt installation created by vcpkg special?
@paul-michalik Unfortunately, I don't completely know. I've only made sure our local "installation" works for:
So it's possible that they could be used externally, but I don't know enough about the qmake buildsystem to properly validate it one way or another.
Looking at the current scripts, here's how we internally build libraries:
qmake.exe
from the current release installed directory.<installed>/tools/qt5/qt_release.conf
into a fresh directory to do a release build. This fills in Prefix =
with the current installed directory (e.g. installed\x64-windows\
).qmake.exe
from (1) with -qtconf path/to/qt.conf
from (2)${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5
to the pathjom.exe qmake_all
to generate Makefileszlib.lib
instead of zlibd.lib
) as well as adding lib\manual-link\
to the link directories and adding shell32.lib
to the link line.jom.exe
to do the main buildfixcmake.py
jom.exe install
If it's possible to make things more externally useful, I'd be happy to accept PRs towards that goal!
@ras0219-msft Ok, so qmake will remain a mystery until the next Steven Hawking emerges :-) I have had this struggle with other projects several times before and have always given up at some point.
@PTavse Assuming we want to try the "side-project" idea, I guess it would be simpler to write CMake script to build libqglviewer. From what I understand, this scenario should be fully supported by vcpkg provided machinery. All the automoc et. al. support via CMake should work (provided the toolchain file from vcpkg is loaded), so no reason to hassle with qmake. What do you think?
Next time, please use the convention for naming of feature branches:
feature/#<issue-Jira-or-GitHub>-title