Reputation: 510
Im trying to use the CLion IDE for Cpp development where actual compilation is happening on a remote sever, Although all the headers files are available, the compiling on local environment would fail since the required libraries are only available in the remote server . Is there a way to use CLion just as an IDE with code completion option only. I've used NetBeans like this where it only provides code completion and i just cant find a way to do this with CLion
Upvotes: 0
Views: 342
Reputation: 11
If I understand the question correctly, yes, it is possible. I'm using Clion to write code for microcontroller applications where the actual compilation is done on the command line, not from within the IDE.
I feel like I'm stating the obvious, but you can just not click the "Build" button. You can point your include path to where your header files reside and Clion will give you code completion, as it only needs the headers for that. Since Clion reads the CMakeLists.txt to figure out your project configuration, you'd need that and set your include path there.
cmake_minimum_required(VERSION 2.8.4)
project(my_cool_project)
set(INCLUDE_DIRECTORIES "/path/to/your/headers")
set(SOURCE_FILES src/main.cpp
src/foo.cpp
src/foo.h
src/bar.cpp
src/bar.h)
add_executable(my_cool_project ${SOURCE_FILES})
As I said, Clion uses the CMakeLists.txt as the project configuration, so look into setting up this file if you're not familiar with it already and you'll be set.
Upvotes: 1