If SFML was not found then you should set SFML_DIR to the folder containing SFMLConfig.cmake (SFML >= 2.5) or alternatively set the SFML_ROOT variable to the root SFML folder (the directory that contains the include and lib folders). If you use SFML_ROOT when you compiled sfml yourself then you will have to watch out for two things:
You can now configure the settings. Set the CMAKE_BUILD_TYPE option either to “Debug” or to “Release” depending on the type of library you want. You should also look at the TGUI_SHARED_LIBS option, check it to build dynamic libraries (.dll files), uncheck it to build static libraries. This option has to match with the one chosen for SFML.
You are not done yet. CMake created a CodeBlocks project in the build directory that has to be build first.
Once this is done, you will find the libraries inside the lib subdirectory of the build folder. To make it easier to use tgui in your project, you should probably copy the .a (and .dll) files to a new “lib” folder in the TGUI root directory.
On the left side you can choose whether you want to change debug or release target settings. Or you can just click on the name of your project (here TGUI-Test) to set them for both. TGUI requires C++14, so check the “-std=c++14” option.
In “Linker settings” under “Other linker options” add ‘-ltgui’ in the ‘Release’ settings and/or add ‘-ltgui-d’ in the ‘Debug’ settings. When linking statically, you have to use ‘-ltgui-s’ and ‘-ltgui-s-d’ instead of course. Also note that the order has to be correct: first tgui, then the libraries from sfml.
When using shared libraries, don’t forget to copy tgui.dll to your project’s folder.
You should now be able to use TGUI.