Forums Gallery LOGIN |REGISTER

[TOOL] Simple CMakeLists helper tool

Please use this forum for questions on C++, Lua, XML, and any other languages used in CryENGINE development.


 

User avatar uniflare__deletedNO6809
Just getting started
Just getting started
 
Posts: 84
Member since: 08.10.2016, 22:48
Likes: 9

[TOOL] Simple CMakeLists helper tool

Postby uniflare__deletedNO6809 » 02.01.2017, 02:08

So I'm new to this and got fed up constantly modifying the cmake lists by hand everytime i added and removed any source files so I wrote a quick c++ windows app to generate one using a template and the source file system structure.

[CmakeAutoGen]
https://github.com/uniflare/CMakeGen
Auto generates CMakeLists.txt based off of source file directory structure.

Usage:
Backup your CMakeLists.txt
Build/Download and drop the exe next to your cryproject file
Run the exe

-OR-

Backup your CMakeLists.txt
Place CMakeGen.exe where you like,
Drag and drop your Code folder onto the exe


Note before using:
CMakeGen uses a CMakeLists template file (located in your project root folder) called CMakeLists_Template.txt.
By default it will only include the CryCommon library. If your project requires any other libraries (CryAction/CryLobby) you will have to modify cmakelists template file to include those. Look at your original cmakelists.txt file to see what is needed (simple copy+paste, look for mentions of CryCommon and you will notice what you need to copy/change).

Take note of the token "%%CMakeGen_SOURCES%%" - this string is replaced my cmakegen with the generated sourcegroups.

--
I started doing it in batch but then I quickly realised how much I hate writing batch files.
Anyway you can grab the source and precompiled binaries from here;
Probably is already a proper tool for this but I don't know of it yet.

Maybe someone finds this useful
Last edited by uniflare__deletedNO6809 on 11.01.2017, 01:20, edited 1 time in total.
User avatar uniflare__deletedNO6809
Just getting started
Just getting started
 
Posts: 84
Member since: 08.10.2016, 22:48
Likes: 9

Re: [TOOL] Simple CMakeLists helper tool

Postby uniflare__deletedNO6809 » 09.01.2017, 04:46

Updated*
Fixed it, realised I committed a broken build.

Fixed backslash appearing in cmakelists and breaking cmake.
Fixed an error that corrupted the cmakelists file by replacing more than the token length with the generated source groups.
Updated to a more respectable readme
User avatar SalahAdDin
Senior Developer
Senior Developer
 
Posts: 876
Member since: 20.01.2012, 01:57
Location: Bogotà, Colombia - Istanbul, Turkiye
Likes: 23

Re: [TOOL] Simple CMakeLists helper tool

Postby SalahAdDin » 22.04.2017, 18:31

Honestly, i can't understand this. Before CryEngine V development was very easy, not we need many thigs for begin with CryEngine.

THank you for your tool.
Please, don`t Kill me. I speak English so so. Some times i used google translator XD.