title: How do I configure the way a project is built in CLion?
body: <p>The problem is as follows.</p>
  
  <p>I have installed <code>libarmadillo</code> on my Ubuntu distributive via <code>apt</code> utility having <code>liblapack</code> and <code>libblas</code> previously installed. And I'm trying to use it in my CLion project. What my intentions result in is that I'm receiving some build errors. One of them was solved by adding <code>#define ARMA_DONT_USE_WRAPPER</code>. </p>
  
  <p>I have found the way to build my project in this topic -
   <a href="https://stackoverflow.com/questions/8978742/armadillo-blas-lapack-linking-error#">Armadillo + BLAS + LAPACK: Linking error?</a>. Though, I can build it only with terminal. I assume that the issue with CLion is CMake configuration. </p>
  
  <p>What is the way for me to alter CMake script so that I refine its built behavior and make it compile my project?</p>
  
  <p>In simple words, how do I make it compile my program with <code>g++ main.cpp -o lab2 -O1 -llapack -lblas</code>.</p>
  
  <p>Code sample:</p>
  
  <pre><code>#define ARMA_DONT_USE_WRAPPER
  #define ARMA_USE_BLAS
  #define ARMA_USE_LAPACK
  #include &lt;armadillo&gt;
  #include &lt;iostream&gt;
  using namespace arma;
  using namespace std;
  
  int main() {
  mat A(4, 5);
  A.load("matrix.txt");
  mat B = resize(A, 4, 4);
  cout &lt;&lt; norm(A, 2);
  cout &lt;&lt; B;
  return 0;
  }
  </code></pre>
  
  <p>The errors I'm issued:</p>
  
  <pre><code>CMakeFiles/lab2.dir/main.cpp.o: In function `double 
  arma::blas::asum&lt;double&gt;(unsigned long long, double const*)':
  /usr/include/armadillo_bits/wrapper_blas.hpp:241: undefined reference 
  to `dasum_'
  CMakeFiles/lab2.dir/main.cpp.o: In function `double 
  arma::blas::nrm2&lt;double&gt;(unsigned long long, double const*)':
  /usr/include/armadillo_bits/wrapper_blas.hpp:273: undefined reference 
  to `dnrm2_'
  collect2: error: ld returned 1 exit status
  CMakeFiles/lab2.dir/build.make:94: recipe for target 'lab2' failed
  make[3]: *** [lab2] Error 1
  CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lab2.dir/all' 
  failed
  make[2]: *** [CMakeFiles/lab2.dir/all] Error 2
  CMakeFiles/Makefile2:79: recipe for target 'CMakeFiles/lab2.dir/rule' 
  failed
  make[1]: *** [CMakeFiles/lab2.dir/rule] Error 2
  Makefile:118: recipe for target 'lab2' failed
  make: *** [lab2] Error 2
  </code></pre>
  
  <p>CMakeLists.txt:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.9)
  project(lab2)
  
  set(CMAKE_CXX_STANDARD 11)
  
  add_executable(lab2 main.cpp)
  </code></pre>