Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

CMake command using Jetbrain's CMake works, but fails with original CMake

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'.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading