Issue
I have a CLion project and I wish to configure and build it in command line.
The following command (in powershell) works:
& "C:/Users/[username]/AppData/Local/Programs/CLion Nova/bin/cmake/win/x64/bin/cmake.exe" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_MAKE_PROGRAM=C:/Users/[username]/AppData/Local/Programs/CLion Nova/bin/ninja/win/x64/ninja.exe" -G Ninja -S [source dir] -B [build dir]
Simply using original CMake (same version), causes the command to fail with LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
.
Does anyone know what Jetbrain's CMake is doing differently?
Solution
JetBrains CLion might use a specific CMake generator that sets up the project differently. In your standalone CMake command, you're using the Ninja generator, which should work. However, you can try using a different generator, such as "Visual Studio" or "Visual Studio 16 2019" if they are available on your system:
cmake -G "Visual Studio 16 2019" -S [source dir] -B [build dir]
replace "Visual Studio 16 2019" with the appropriate generator name for your system.
Answered By - Afaq Ali Shah Answer Checked By - Timothy Miller (WPSolving Admin)