Spoiler:
Moving forward GZDoom will be utilizing vcpkg to help reduce the amount of dependencies that its source code is bundled with. Here's a rundown on how to build GZDoom with the new system.
Step 1: Use Git or TortoiseGit to clone vcpkg to any location on your hard disk. This is no different than cloning GZDoom from before.
Step 2: Inside the newly-cloned vcpkg folder, run bootstrap-vcpkg.bat (Windows) or bootstrap-vcpkg.sh (other OSes). It should finish fairly quickly. That's fine.
Step 3: Run CMake GUI. If you have a previous CMake build of the source code, you should nuke it entirely. We'll have to do this from scratch.
Step 4: Input the source code and build directories as usual here; if you've built GZDoom before, this step hasn't changed. Now press Configure.
Step 5: Choose whichever version of Visual Studio you want to use (here for me, I only have VS 2022 installed, so that's what it defaults to) and then select "Specifiy toolchain for cross-compiling". It's important to select this, otherwise you won't be able to proceed.
Step 6: In the next dialog, navigate to scripts/buildsystems/vcpkg.cmake that's contained inside the vcpkg folder you cloned earlier. Proceed by clicking on "Finish".
That's it! Sit back and let CMake do its thing. It might take a while because it will download and build stuff for you.
After this point, everything should be the same as pre-vcpkg. Set whatever options you need, and then hit Generate and you'll get your .sln file.
[DEPRECATED] [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Moderators: GZDoom Developers, Raze Developers
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
-
-
- Posts: 17462
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
[DEPRECATED] [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Deprecated as of April 2024. You don't need vcpkg anymore.
Spoiler:
Last edited by Nash on Sun Apr 14, 2024 9:42 am, edited 2 times in total.
-
- Posts: 13780
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Thank you for doing this Nash. You turned my technical babblespeak into something everyone could use. And you also were the one to figure out that the only piece of the puzzle that was missing was the toolchain file thing - it was my mistake to not think of that, first.
-
- Posts: 3
- Joined: Tue Aug 22, 2023 6:05 am
Re: Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
> Step 2: Inside the newly-cloned vcpkg folder, run bootstrap-vcpkg.bat (Windows) or bootstrap-vcpkg.sh (other OSes). It should finish fairly quickly. That's fine.
That step is not required in manifest mode. vcpkg should be able to bootstrap itself.
That step is not required in manifest mode. vcpkg should be able to bootstrap itself.
-
- Posts: 2042
- Joined: Mon Aug 11, 2003 1:50 pm
- Location: Waveney, United Kingdom
Re: Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
This is good for the GUI crowd, but what about terminal only building? I have a set of scripts that "just work" for building GZDoom and would hate to see them require user input during the process Presumably it will still be possible on Linux to build entirely from terminal commands?
-
-
- Posts: 523
- Joined: Mon Apr 09, 2012 12:27 pm
Re: Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Might be worth appending "in Windows" to the title of this thread to preempt people coming into this thread to ask about support for other build methods / OSes. Likewise a separate "compiling the new way in Linux" might be able to collect what would otherwise be lots of smaller more isolated support requests.
-
-
- Posts: 63
- Joined: Tue Aug 21, 2018 9:31 pm
- Preferred Pronouns: She/Her
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
The "old" way isn't really going away, what this update is doing is adding vcpkg support and removing the bundled windows dependencies -- ex. on Linux you'll be free to continue using the system package manager, use vcpkg, or get the dependencies you need any other method (basically, the build method for non-windows platfoms hasn't changed at all)
-
-
- Posts: 17462
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Done.JPL wrote: ↑Wed Aug 23, 2023 2:05 pm Might be worth appending "in Windows" to the title of this thread to preempt people coming into this thread to ask about support for other build methods / OSes. Likewise a separate "compiling the new way in Linux" might be able to collect what would otherwise be lots of smaller more isolated support requests.
Yeah sorry this thread is only for the GUI crowd, for command lines, only new thing you need to add to your CMake call is the -DCMAKE_TOOLCHAIN_FILE=<path to vcpkg.cmake> parameter. I won't be covering it though, someone else may feel free to take care of that. :DMartinHowe wrote: ↑Wed Aug 23, 2023 11:02 am This is good for the GUI crowd, but what about terminal only building? I have a set of scripts that "just work" for building GZDoom and would hate to see them require user input during the process :( Presumably it will still be possible on Linux to build entirely from terminal commands?
-
- Posts: 13780
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
It's basically the same for other OS's, and Cmake-GUI is available on all platforms, so saying "for windows" is really a bit misleading.
The command line is indeed just simply using -DCMAKE_TOOLCHAIN_FILE to point to your vcpkg installation with the script inside, it requires a very specific file but it should be pretty clear which one if you follow the instructions here.
The command line is indeed just simply using -DCMAKE_TOOLCHAIN_FILE to point to your vcpkg installation with the script inside, it requires a very specific file but it should be pretty clear which one if you follow the instructions here.
-
- Posts: 2042
- Joined: Mon Aug 11, 2003 1:50 pm
- Location: Waveney, United Kingdom
Re: [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Thanks everyone, I'll look into this next time I need to build it. Hopefully the Wiki for it will be updated eventually.
-
- Posts: 8196
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
And the windows instructions need updating as well but also there has to be a way not to rely upon vcpkg. Apparently all someone has to do is not load the toolchain file, build libwebp with 'vcpkg install' and link manually to it, but right now I'm struggling with some of this.
If it could be explained more in detail, that'd be definitely appreciated.
To be clear, I've only ever set up GZDoom before and I've never had to deal with this prior.
If it could be explained more in detail, that'd be definitely appreciated.
To be clear, I've only ever set up GZDoom before and I've never had to deal with this prior.
-
- Lead GZDoom+Raze Developer
- Posts: 49176
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
There isn't really more to it. All you need is manually provide the path to libwebp.
The path should be {vcpkg_dir}/installed/x64-windows-static/share/WebP
For just building an EXE, and not working with the project, auto-setup-windows.cmd should be enough. It downloads everything you need, except CMake and then builds everything in one go.
The path should be {vcpkg_dir}/installed/x64-windows-static/share/WebP
For just building an EXE, and not working with the project, auto-setup-windows.cmd should be enough. It downloads everything you need, except CMake and then builds everything in one go.
-
-
- Posts: 17462
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: [DEPRECATED] [WINDOWS] Compiling GZDoom with CMake GUI, Visual Studio and vcpkg
Deprecated as of April 2024. You don't need vcpkg anymore.