Re: [Interest] Is there a command line call to qmake to test the bit width?
Den 04-03-2015 kl. 19:39 skrev Scott Aron Bloom: -Original Message- From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of Thiago Macieira Sent: Wednesday, March 04, 2015 9:44 AM To: interest@qt-project.org Subject: Re: [Interest] Is there a command line call to qmake to test the bit width? On Wednesday 04 March 2015 17:15:45 Scott Aron Bloom wrote: By then its too late.. I want the shell script that calls the make system to fail, saying you have the qmake setup wrong... Why would it be wrong? If qmake is installed, it's been installed correctly right? :-) And what is the issue you're trying to figure out? Its really only an issue when linking, since it will pick up the wrong libraries. No, it won't. The libraries come from the linker. -- No. Maybe Im not explaining myself correctly. Since this was purely a question on qmake, or if there was anyway to look at a Qt install an see what bit width it was built against. However here are all the gory details. On a single system, I have 2 versions of the SAME Qt installed, 64 bit and 32 bit, both installed correctly. Visual Studio has two compilers, one for 64 and one for 32. That said, when I used to release our tool for linux 32, we had a similar issue.. The developers setup build script, requires the cl to be pointing to the correct cl, ie, that you have run vsvars before you run cmake (which then has the dependency on qmake) If I am trying to build the 64 bit system, but my shell is pointing to the 32 bit compiler, but the 64 bit Qt system, it will most likely compile just fine, but it will not link correctly. Im trying to put the logic into my CMake system, to query the version of qmake to determine, if the user has selected the appropriate Visual Studio and Qt version. And yes, I would have had to do the same thing (though we dropped 32 bit linux support, and devs never really worked on it) to confirm they were building a 32 bit version of the tool against a 32 bit version of Qt (or vice versa) Sounds like you should do a simple cmake test case where you build a small dummy application and link it. This should give you the answer immediately. Bo. -- Viking Software Qt and C++ developers for hire http://www.vikingsoft.eu ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
Not a bad idea... -Original Message- From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of Bo Thorsen Sent: Wednesday, March 11, 2015 3:18 AM To: interest@qt-project.org Subject: Re: [Interest] Is there a command line call to qmake to test the bit width? Den 04-03-2015 kl. 19:39 skrev Scott Aron Bloom: -Original Message- From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of Thiago Macieira Sent: Wednesday, March 04, 2015 9:44 AM To: interest@qt-project.org Subject: Re: [Interest] Is there a command line call to qmake to test the bit width? On Wednesday 04 March 2015 17:15:45 Scott Aron Bloom wrote: By then its too late.. I want the shell script that calls the make system to fail, saying you have the qmake setup wrong... Why would it be wrong? If qmake is installed, it's been installed correctly right? :-) And what is the issue you're trying to figure out? Its really only an issue when linking, since it will pick up the wrong libraries. No, it won't. The libraries come from the linker. -- No. Maybe Im not explaining myself correctly. Since this was purely a question on qmake, or if there was anyway to look at a Qt install an see what bit width it was built against. However here are all the gory details. On a single system, I have 2 versions of the SAME Qt installed, 64 bit and 32 bit, both installed correctly. Visual Studio has two compilers, one for 64 and one for 32. That said, when I used to release our tool for linux 32, we had a similar issue.. The developers setup build script, requires the cl to be pointing to the correct cl, ie, that you have run vsvars before you run cmake (which then has the dependency on qmake) If I am trying to build the 64 bit system, but my shell is pointing to the 32 bit compiler, but the 64 bit Qt system, it will most likely compile just fine, but it will not link correctly. Im trying to put the logic into my CMake system, to query the version of qmake to determine, if the user has selected the appropriate Visual Studio and Qt version. And yes, I would have had to do the same thing (though we dropped 32 bit linux support, and devs never really worked on it) to confirm they were building a 32 bit version of the tool against a 32 bit version of Qt (or vice versa) Sounds like you should do a simple cmake test case where you build a small dummy application and link it. This should give you the answer immediately. Bo. -- Viking Software Qt and C++ developers for hire http://www.vikingsoft.eu ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
On Wednesday 04 March 2015 17:15:45 Scott Aron Bloom wrote: By then its too late.. I want the shell script that calls the make system to fail, saying you have the qmake setup wrong... Why would it be wrong? If qmake is installed, it's been installed correctly right? :-) And what is the issue you're trying to figure out? Its really only an issue when linking, since it will pick up the wrong libraries. No, it won't. The libraries come from the linker. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
On 4 March 2015 at 18:05, Scott Aron Bloom scott.bl...@onshorecs.com wrote: I am creating two versions of my tool, 32 and 64 bit. However, I have, more than once, started a build against the wrong path, so it was building against Qt 64 when it was supposed to build against Qt 32 (or vice versa) Is there a qmake or some way, that in the setup scripts to my build, I can confirm the version I am running against? In qmake see $$QT_ARCH, in your C++ file you can use QT_POINTER_SIZE. HTH, -- Giuseppe D'Angelo ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
If you are trying to figure out which qmake created the Makefile your script is using, you can try call make qmake -n. This will give you the qmake command that is being used including the path to qmake itself. You can then query that qmake for the QMAKE_SPEC it is defaults to (linux-g++-64 or linux-g++-32). On Wed, Mar 4, 2015 at 11:16 AM Scott Aron Bloom scott.bl...@onshorecs.com wrote: -Original Message- From: Giuseppe D'Angelo [mailto:dange...@gmail.com] Sent: Wednesday, March 04, 2015 9:10 AM To: Scott Aron Bloom Cc: interest@qt-project.org Subject: Re: [Interest] Is there a command line call to qmake to test the bit width? On 4 March 2015 at 18:05, Scott Aron Bloom scott.bl...@onshorecs.com wrote: I am creating two versions of my tool, 32 and 64 bit. However, I have, more than once, started a build against the wrong path, so it was building against Qt 64 when it was supposed to build against Qt 32 (or vice versa) Is there a qmake or some way, that in the setup scripts to my build, I can confirm the version I am running against? In qmake see $$QT_ARCH, in your C++ file you can use QT_POINTER_SIZE. HTH, -- By then its too late.. I want the shell script that calls the make system to fail, saying you have the qmake setup wrong... Its really only an issue when linking, since it will pick up the wrong libraries. Scott ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
Provided you defined a mkspec when you built Qt, you can put something like this in your project file: linux-g++-64{ message(Building for linux 64-bit) LIBS += -lusb -L../lib64 } linux-g++-32{ message(Building for linux 32-bit) LIBS += -L../lib } win32-g++{ message(Building for windows 32-bit) LIBS += -L../lib } win64-g++{ message(Building for windows 64-bit) LIBS += -lusb -L../lib64 } macx-clang{ message(Building for macx-clang) LIBS += -L../lib64 } This allows you print a message, set library paths, include paths, etc based on the mkspec of Qt you are building with. Karl On Mar 4, 2015, at 11:05 AM, Scott Aron Bloom scott.bl...@onshorecs.com wrote: I am creating two versions of my tool, 32 and 64 bit. However, I have, more than once, started a build against the wrong path, so it was building against Qt 64 when it was supposed to build against Qt 32 (or vice versa) Is there a qmake or some way, that in the setup scripts to my build, I can confirm the version I am running against? Scott ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
On Mar 4, 2015, at 11:44 AM, Thiago Macieira thiago.macie...@intel.com wrote: On Wednesday 04 March 2015 17:15:45 Scott Aron Bloom wrote: By then its too late.. I want the shell script that calls the make system to fail, saying you have the qmake setup wrong... Why would it be wrong? If qmake is installed, it's been installed correctly right? :-) And what is the issue you're trying to figure out? Its really only an issue when linking, since it will pick up the wrong libraries. No, it won't. The libraries come from the linker. Our cross platform programs have libraries that we build to link to them. We put them lib and lib64 directories depending on what platform we are building for. We switch to the correct library using the mkspec of the version of Qt we are building with in the qmake project file: linux-g++-64{ message(Building for linux 64-bit) LIBS += -L../lib64 } linux-g++-32{ message(Building for linux 32-bit) LIBS += -L../lib } linux-g++{ message(Building for linux-g++) LIBS += -L../lib } win32-g++{ message(Building for windows 32-bit) LIBS += -L../lib } win64-g++{ message(Building for windows 64-bit) LIBS += -L../lib64 } macx-clang{ message(Building for macx-clang) LIBS += -L../lib64 } Thus the project file can travel from platform to platform and access the correct libraries. Seems to work well for us. Karl ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
[Interest] Is there a command line call to qmake to test the bit width?
I am creating two versions of my tool, 32 and 64 bit. However, I have, more than once, started a build against the wrong path, so it was building against Qt 64 when it was supposed to build against Qt 32 (or vice versa) Is there a qmake or some way, that in the setup scripts to my build, I can confirm the version I am running against? Scott ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
-Original Message- From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of Thiago Macieira Sent: Wednesday, March 04, 2015 9:44 AM To: interest@qt-project.org Subject: Re: [Interest] Is there a command line call to qmake to test the bit width? On Wednesday 04 March 2015 17:15:45 Scott Aron Bloom wrote: By then its too late.. I want the shell script that calls the make system to fail, saying you have the qmake setup wrong... Why would it be wrong? If qmake is installed, it's been installed correctly right? :-) And what is the issue you're trying to figure out? Its really only an issue when linking, since it will pick up the wrong libraries. No, it won't. The libraries come from the linker. -- No. Maybe Im not explaining myself correctly. Since this was purely a question on qmake, or if there was anyway to look at a Qt install an see what bit width it was built against. However here are all the gory details. On a single system, I have 2 versions of the SAME Qt installed, 64 bit and 32 bit, both installed correctly. Visual Studio has two compilers, one for 64 and one for 32. That said, when I used to release our tool for linux 32, we had a similar issue.. The developers setup build script, requires the cl to be pointing to the correct cl, ie, that you have run vsvars before you run cmake (which then has the dependency on qmake) If I am trying to build the 64 bit system, but my shell is pointing to the 32 bit compiler, but the 64 bit Qt system, it will most likely compile just fine, but it will not link correctly. Im trying to put the logic into my CMake system, to query the version of qmake to determine, if the user has selected the appropriate Visual Studio and Qt version. And yes, I would have had to do the same thing (though we dropped 32 bit linux support, and devs never really worked on it) to confirm they were building a 32 bit version of the tool against a 32 bit version of Qt (or vice versa) Scott ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Is there a command line call to qmake to test the bit width?
On Wednesday 04 March 2015 18:39:55 Scott Aron Bloom wrote: No. Maybe Im not explaining myself correctly. Since this was purely a question on qmake, or if there was anyway to look at a Qt install an see what bit width it was built against. However here are all the gory details. On a single system, I have 2 versions of the SAME Qt installed, 64 bit and 32 bit, both installed correctly. Good, I have that too. Actually, 6 builds of the same Qt. Visual Studio has two compilers, one for 64 and one for 32. That said, when I used to release our tool for linux 32, we had a similar issue.. The developers setup build script, requires the cl to be pointing to the correct cl, ie, that you have run vsvars before you run cmake (which then has the dependency on qmake) Right. If I am trying to build the 64 bit system, but my shell is pointing to the 32 bit compiler, but the 64 bit Qt system, it will most likely compile just fine, but it will not link correctly. Right. Im trying to put the logic into my CMake system, to query the version of qmake to determine, if the user has selected the appropriate Visual Studio and Qt version. $ qmake -o /dev/null /dev/stdin 'message($$QT_ARCH)' Project MESSAGE: x86_64 $ qmake -qt5-i386 -o /dev/null /dev/stdin 'message($$QT_ARCH)' Project MESSAGE: i386 $ qmake -qt5-arm -o /dev/null /dev/stdin 'message($$QT_ARCH)' Project MESSAGE: arm $ qmake -qt5-mips -o /dev/null /dev/stdin 'message($$QT_ARCH)' Project MESSAGE: mips Since you're in a less-than-capable shell and OS, you'll need to create a file to pass to qmake instead of /dev/stdin. Note that this does not catch different ABIs in the same OS. If there's interest for that, we can start recording the ABI in a qmake variable for Qt 5.5. For me, they'd be: x86_64-little_endian-lp64 i386-little_endian-ilp32 arm-little_endian-ilp32-eabi mips-little_endian-ilp32-o32-hardfloat Note: on Windows, 64-bit says x86_64-little_endian-llp64 (note the extra l). See http://doc.qt.io/qt-5/qsysinfo.html#buildAbi -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest