title: Is it possible to develop linux kernel module in CLion?
body: <p>I want to develop some small linux kernel modules in CLion. For example, I want to compile these files:</p>
  
  <p><strong>stack.h:</strong></p>
  
  <pre><code>#ifndef _LL_STACK_H
  #define _LL_STACK_H
  #include &lt;linux/list.h&gt;
  
  typedef struct stack_entry {
      struct list_head lh;
      void *data;
  } stack_entry_t;
  
  stack_entry_t* create_stack_entry(void *data);
  void delete_stack_entry(stack_entry_t *entry);
  
  void stack_push(struct list_head *stack, stack_entry_t *entry);
  stack_entry_t* stack_pop(struct list_head *stack);
  #define stack_empty(stack) list_empty((stack))
  
  #define STACK_DATA(stack_entry, data_ptr_type) \
      ((data_ptr_type)(stack_entry)-&gt;data)
  
  #define STACK_DATA_RESET(stack_entry, new_data) \
      do { \
          (stack_entry)-&gt;data = new_data; \
      } while(0)
  
  #endif //_LL_STACK_H
  </code></pre>
  
  <p><strong>main.c:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "stack.h"
  
  int main() {
      printf("hello");
      return 0;
  }
  </code></pre>
  
  <p>Is it possible to configure <strong>CMakeLists.txt</strong> to complete my task? I try to <a href="https://stackoverflow.com/a/19997098/1756750">add</a> some directories (linux, include, kernel), but I have no success.</p>