Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everyone.
I made some changes so a minimal Visual Studio 2022 solution can be generated with CMake. The only dependency necessary is zlib: https://www.zlib.net/.
These are the steps to build it.
Get zlib and add as an dependency
1.) Clone the repo and create a new folder in the repo's root called
dependencies
.2.) Copy the zlib source directory inside
dependencies
.Why is this step required? I changed the CMakeLists.txt the following way:
This means CMake does not look for an installed version of zlib on the system but rather includes the zlib sources into the final solution and zlib will be built ourselves. You can provide the relative directory path to the zlib sources via
-DZLIB_SOURCE_DIR
, eg.-DZLIB_SOURCE_DIR=dependencies/zlib-1.3.1
.Create a build directory
Now, create another directory called
build
inside this repo's root directory. It doesn't have to be calledbuild
, it is just a CMake convention. Go insidebuild
. Open a console and type:You will se a lot of (funny) messages that dependencies could not be found. This is fine but in the end no error should appear and a
FTEQuake.sln
should appear insidebuild
. Open the solution and build the projectfteqw
. Depending onthe build configuration (
Debug
/Release
), you should now have a folder calledbin
. Inside the repo's root directory.This
bin
directory is another change I made to the CMakeLists.txt:This makes sure that all dll's lib's and executables land inside
bin/Debug
(orbin/Release
). I have foundit convenient (on windows) to have all the stuff combined in one folder and you don't have to manually
copy DLL's or whatever around to get the
fteqw.exe
running.All that is left to do is copy the game data (eg.
Id1
) alongside the.exe
. It should run now.Changes to source files
fs_zip.c
:I uncommented the following preprocessor code:
because when we build zlib, the resulting library will be just called zlib.lib (even when built in 64 bit mode).
fs.c
:The ternary operator without providing a statement for the
true
case would not compile on msvc:So I made this change:
This, I have to admit, is just a quick fix to get it running. While it's not wrong, it certainly is lengthy and not nice to read.
I think it might be possible to set some CMake flags to let the compiler know that it is allowed.
sv_main.c
:Include
stdint.h
:The compile wouldn't find
intmax_t
without this. Again, it might be possible to set some compiler flag, so it is notnecessary to include the header, I don't know.
.gitignore
I added the folders
dependencies
,build
andbin
.Final words
get the other things included and build on Windows with cmake.
Cheers, pythno