'How to create a cmake variable

I just asked a question here

That problem is solved by myself. All i want is to create two project configurations x86-Linux and x64-Linux in Visual studio CMake Project.

I have both WSL and remote linux.

See, in the link, i have a variable FORCE_32. If it is set to 1, i hope cmake will proceed to build the correct binaries. But the problem is how to set this variable via "Manage Configurations" or "CMakeSettings.json". I tried

 "variables": [
        {
          "name": "FORCE_32",
          "value": "1",
          "type": "INTEGER"
        }
      ]

in CMakeSettings.json and to which i got this warning in Visual Studio

manually-specified variables were not used by the project visual studio FORCE_32

Linux -x64

I do not know how to proceed. All i am trying to do is a way so that 32 or 64 bit builds can be built any time without editing CMakeLists.txt each time



Solution 1:[1]

In CMakeSettings.json modify

"cmakeCommandArgs": "-DFORCE_32:INTEGER=1",

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 habi