4coder»Forums
Riana
2 posts
Cmake?
Edited by Riana on Reason: Initial post
I have just started using 4coder today and I want to know how I could set it up to work with Cmake. Just in case this is needed, I am using version 1.6 since anything newer crashes.
Simon Anciaux
1341 posts
Cmake?
The preferred way of compiling the custom layer is to use the script files in the custom/bin folder.

If you absolutely want to use cmake, you need to compile 4coder_default_bindings.cpp (or the file that is the entry point of your custom layer) as this file will include all the necessary files and use only a single translation unit. For the required defines and compiler flags you'll need to look into the build scripts what's necessary.

You'll also need to compile the metadata generator and run it before compiling 4coder_default_bindings.cpp. Once again you need to look at the build scripts to see what's happening.

You'll also need to move the resulting shared library (.dll or .so) to the root directory.

Customization layer - getting started ( 4coder 4.1 )
Riana
2 posts
Cmake?
I don't have to use Cmake. I just want to be able to say #include <GLFW/glfw3.h>.
Mārtiņš Možeiko
2562 posts / 2 projects
Cmake?
Edited by Mārtiņš Možeiko on
Using glfw or any other library does not require anything special in 4coder. As long as you have your "build.bat" file that you run from 4coder, then you can use it to compile/link any 3rd party library easily. Just pass correct include folder to cl.exe and path to glfw library file to linker.

If library would require using cmake (glfw doesn't, it just allows to use cmake as one of options), then you would simply put cmake --build command inside your "build.bat" - and again everything would just work without doing anything extra from 4coder.
Simon Anciaux
1341 posts
Cmake?
Also depending on what you want to do, 4coder provides some function to draw things. Look into 4coder_draw.cpp.