Building Libs for Windows Debug Version with VS2017/Qt5.12

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

wmayer wrote: Thu Jul 18, 2019 12:48 pm Yes, it also annoys me to always copy these files manually when making a complete fresh build. I have this on my to-do list.
In your normal workflow do you create separate release and debug build directories or do you commingle them? If the later how do you manage the .pdb files?
"fight the good fight"
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

For some years now I use QtCreator as IDE and there the Debug and Release build directories are completely separate.
If the later how do you manage the .pdb files?
But for testing purposes I use msbuild from the command line which VS internally uses, too. There debug in release libraries are in a common directory. I don't see a problem with .pdb files because debug output files have the suffix "_d" which applies to .dll, .lib, .pdb, ... files.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by Syres »

Are the contributors here aware of https://forum.freecadweb.org/viewtopic.php?f=8&t=37837 ? It's obviously not a workflow that many end users would carry out but I thought it should be brought to your attention.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

Syres wrote: Sat Jul 20, 2019 8:57 pm Are the contributors here aware of https://forum.freecadweb.org/viewtopic.php?f=8&t=37837 ? It's obviously not a workflow that many end users would carry out but I thought it should be brought to your attention.
Thanks for the heads up. I responded in the thread.
"fight the good fight"
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

wmayer wrote: Sat Jul 20, 2019 8:47 am For some years now I use QtCreator as IDE and there the Debug and Release build directories are completely separate.
Thanks again for the valuable info.
I'm very interested in making the transition to QTCreator myself. msbuild is open source and only the VS IDE is propriety making this transition would be great.
Any hints on setting up the QTCreator environment (a link would do), I'm short on time presently, but I think this would be a good step forward for the Win toolchain.
"fight the good fight"
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

Any hints on setting up the QTCreator environment (a link would do), I'm short on time presently, but I think this would be a good step forward for the Win toolchain.
First of all QtCreator is only an IDE without its own compiler, i.e. it uses that what it finds on your system. So, you still have to install the msvc compiler. And to save some space on your HDD you don't have to install the full VS IDE but only its compiler. Therefore download the utility "Visual Studio Installer" and follow the instructions.

Now install QtCreator. Now make sure that the LibPack's bin directory and your cmake is listed in your PATH environment. Start QtCreator and open Tools > Options and go to the first item called Kits. In the second tab "Qt Versions" add a new entry (assuming that the Qt version of the already existing entry doesn't match with Qt of the LibPack) and select qmake.exe of the LibPack.

Go back to the first tab and define the C/C++ compiler versions for the new Qt entry, select the CMake version and most important the generator. Recommended are NMake Makefile JOM or Ninja (don't choose NMake Makefile because it's too slow because it doesn't support parallel builds) and as Extra generator choose CodeBlocks.
Remark: With older QtCreator versions choosing the VS generators never worked, maybe this has changed.

Now configure the project with CMake. You can do that by opening the top-level CMakeLists.txt and running Configure but IMO it's a bit painful to do that inside QtCreator -- I prefer using CMakeGui. Create the two build directories for Debug and Release and choose the same generator as you defined inside QtCreator.

Now open the CMakeLists.txt file in QtCreator and define the already created build directories for Debug and Release.

If you go to File > Sessions > Manage you can create a new session e.g. called FreeCAD which saves all opened files when closing the project. Next time you start QtCreator choose the session FreeCAD.

Every time you load the FreeCAD project it runs CMake which is a bit annoying and it takes some minutes to parse it. No idea whether this behaviour can be changed.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by Kunda1 »

#documentation
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

Kunda1 wrote: Wed Jul 24, 2019 11:51 am #documentation
This is not considered to be a complete tutorial. So, @sgrogan when you go through these steps you could note the details for a better documentation.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

wmayer wrote: Wed Jul 24, 2019 1:16 pm This is not considered to be a complete tutorial. So, @sgrogan when you go through these steps you could note the details for a better documentation.
For sure! I hope to have time on the weekend. Thanks for the helpful starting point.
"fight the good fight"
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by uwestoehr »

OCCT 7.4 is out and I would like to contribute to create a new LibPack for it. Can we therefore please put the LibPack-specific files directly to the FreeCAD GitHub? This would e.g. the work on the .cmake files easier and we would have a central repository. I mean we have already e.g. a folder for Conda (/package/conda), so it should not be an issue to have a folder for LibPack (/package/LibPack).
Post Reply