CMake File On SSH Server
Hi folks, a bit new to working on Clion with an SSH server and needed some help!
I have an SSH server which has a bunch of C code hosted on it but for some reason the cmake file isn't initialised correctly. Because of that the code doesn't execute when I try to run it. When I created an empty Cmake file and tried to get it to regenerate, I got the following error -
```CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /<dir> (I've intentionally removed this)
[Finished]
```
I know this is a relatively basic question but how do I just simply generate a new cmake file from scratch. The way I'd do this if it wasn't on SSH would be File > New > Project but that isn't an option here.
Thanks a ton
请先登录再写评论。
Hello!
There is no way to regenerate a CMakeLists.txt if it already exists. CLion can generate a CMakeLists.txt if you open a project without CMakeLists.txt - https://www.jetbrains.com/help/clion/creating-new-project-from-scratch.html#import-prj.
Do you use Remote with Gateway (https://www.jetbrains.com/help/clion/remote.html)?