Difference between revisions of "How to use CLion with our software"

From OPeNDAP Documentation
m (Open a directory that contains code)
m (Open a directory that contains code)
(4 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
== Open a directory that contains code ==
 
== Open a directory that contains code ==
 
When you start CLion, you will see a dialog box
 
When you start CLion, you will see a dialog box
[[File:New project 2019-10-10 at 09.14.00.png|border|New Project dialog]]
+
[[File:New project 2019-10-10 at 09.14.00.png|1280px|border|New Project dialog]]
  
 
Click on the '''New CMake Project from Sources''' and you will see the following
 
Click on the '''New CMake Project from Sources''' and you will see the following
 +
[[File:Choose files 2019-10-10 at 09.16.21.png|900px|border|Choose the directories to scan]]
 +
 +
Use this dialog to choose which directories to scan. CLion will scan the selected directories. looking for code to be compiled and also, in the lower panel, for headers to be included. In the later case, code all the dirs with headers you want to be found. For Hyrax, that means the $prefix/build/deps/include and $prefix/build/include directories. The end result will take a few seconds to load and will show messages at the bottom of the screen regarding various scanning and indexing operations.
 +
 +
Drive around in the source panel and open some code. It should look 'good' in the sense that there are not many false positive error flags.
 +
 +
== Building the code ==
 +
 +
== Running the debugger ==

Revision as of 23:27, 11 October 2019

Setting up CLion to work with our software is really the same as using CLion with a 'Makefile' project. By default, CLion uses CMake to to figure out which files are part of a program or library. The problem for our software, and any software that does not use CMake, is that most of the benefit(s) of CLion (or any IDE) depend on knowing all the files that are used to build a program or library.

This page shows how to set up CLion with software that uses make and/or autotools.

1 The whole server or just parts

First, you need to decide if you want to work with all of the C++ code as one 'project' or use a separate project for each of 'hyrax-dependencies,' 'libdap4,' and 'bes.' In practice, you choose one way and then switch without paying too great a penalty.

For the rest of this HowTo, I'll assume you have done the following:

  1. Checkout the hyrax git repo from GitHub (https://github.com/opendap/hyrax) and ...
  2. Have used the script(s) to checkout the three C++ projects 'hyrax-dependencies,' 'libdap4,' 'bes.'
  3. Or, you've done something else to get our server code...

2 Open a directory that contains code

When you start CLion, you will see a dialog box New Project dialog

Click on the New CMake Project from Sources and you will see the following Choose the directories to scan

Use this dialog to choose which directories to scan. CLion will scan the selected directories. looking for code to be compiled and also, in the lower panel, for headers to be included. In the later case, code all the dirs with headers you want to be found. For Hyrax, that means the $prefix/build/deps/include and $prefix/build/include directories. The end result will take a few seconds to load and will show messages at the bottom of the screen regarding various scanning and indexing operations.

Drive around in the source panel and open some code. It should look 'good' in the sense that there are not many false positive error flags.

3 Building the code

4 Running the debugger