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). When you use
SFML_ROOT when you compiled sfml yourself then you will have to watch out for three 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 Visual Studio 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 .lib (and .dll) files to a new “lib” folder in the TGUI root directory.
In both debug and release mode (this time seperately), you must add the library to link with. When you are only going to use one mode then you obviously don’t have to change the other one.
When linking statically you will need to link to tgui-s.lib and tgui-s-d.lib instead of tgui.lib and tgui-d.lib. The order of linking is also important: first sfml, then tgui.
When linking dynamically, don’t forget to copy the needed dlls to the directory where your compiled executable is.
You should now be able to use TGUI.