Link ncurses in CLion CMake
<p>I'm currently playing around with ncurses. Ncurses is a library I installed, NOT my own file. I already did some stuff but using an IDE is much easier so I decided to use CLion (I'm on Linux so can't use Visual Studio). I got the following CMakeLists.txt:</p>

<pre><code>cmake_minimum_required(VERSION 3.6)
project(ncurses)

set(CMAKE_C_STANDARD "${CMAKE_C_FLAGS} -Wall -Werror -lpdcurses")

set(SOURCE_FILES main.cpp ncurses.h)
add_executable(ncurses ${SOURCE_FILES})
</code></pre>

<p>My project is called ncurses I don't know if that'd matter.</p>

<p>I got the following main.cpp</p>

<pre><code>#include &lt;ncurses.h&gt;

int main() {
    initscr();
    printw("Hello");
    refresh();
    getch();
    endwin();
    return 0;
}
</code></pre>

<p>However, I get the following errors:</p>

<pre><code>/opt/clion/bin/cmake/bin/cmake --build /home/josh/ClionProjects/ncurses /cmake-build-debug --target all -- -j 4
make[2]: *** No rule to make target 'CMakeFiles/ncurses.dir/build'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ncurses.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
</code></pre>

<p>I don't get what the problem is. I tried <code>-lncurses</code> except of <code>lpdcurses</code> but that doesn't work either. It only gives an error when building but not in the IDEA itself.</p>