SFML community forums

Help => General => Topic started by: Martin Lefevre on March 30, 2020, 12:54:49 pm

Title: Cmake does not yield a x86 compatible Visual Studio solution.
Post by: Martin Lefevre on March 30, 2020, 12:54:49 pm
 Hi,

I was trying to compile a static version of SFML with CMake for Visual Studio 2019, I think I followed the tutorial (https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php) correctly. The problem is that once I open the CMake generated solution to finally build SFML, I see that I cannot switch the solution configuration to x86, thus preventing me to build SFML in 32-bits.

Here are all the steps I did to compile SFML with CMake:

Firstly, I downloaded the SFML source code,
then, I opened CMake, chose the SFML file as source code and a build folder to put built files into.
Then, I clicked on configure, chose Visual studio 16 2019 as generator, and clicked on finish.
Once the configuring done, I unchecked BUILD_SHARED_LIBS, checked SFML_USE_STATIC_STD_LIBS, clicked on configure, then generate. Once everything is done, I clicked on the Open_Project button which opens the generated Visual Studio solution.

And there is the issue: I cannot switch the project's configuration to something else than x64...

What did I do wrong?
Title: Re: Cmake does not yield a x86 compatible Visual Studio solution.
Post by: eXpl0it3r on March 30, 2020, 01:40:28 pm
CMake changed their generator setup in some more recent updates.
When you pick a generator, you also need to pick the platform if you don't want x64.

(https://en.sfml-dev.org/forums/index.php?action=dlattach;topic=27058.0;attach=4866;image)
Title: Re: Cmake does not yield a x86 compatible Visual Studio solution.
Post by: Martin Lefevre on March 30, 2020, 02:20:29 pm
Oh, that was simple... thanks!