title: How to print variables in CMake?
body: <p>I want to use cmake to build my project, my CMakeLists.txt is very simple:</p>
  <pre><code>cmake_minimum_required(VERSION 3.20)
  
   project(YuvParallelProcess)
  
   message(&quot;$(PROJECT_SOURCE_DIR)&quot;)
  
   include_directories($(PROJECT_SOURCE_DIR)/inc)
   link_directories($(PROJECT_SOURCE_DIR)/lib/libyuv)
  
   add_executable(YuvParallelProcess  $(PROJECT_SOURCE_DIR)/src/main.cpp)
  
   target_link_libraries(YuvParallelProcess  libyuv.a)
  </code></pre>
  <p>my project files are organized as follows:</p>
  <pre><code> YuvParallelProcess
                        build
                        data
                        inc
                        lib
                        src
                        CMakeLists.txt
  </code></pre>
  <p>when I run <code>cmake ..</code> in <code>build</code> directory, the shell prints:</p>
  <pre><code>$(PROJECT_SOURCE_DIR)
  -- Configuring done
  CMake Error at CMakeLists.txt:10 (add_executable):
    Cannot find source file:
  
      $(PROJECT_SOURCE_DIR)/src/main.cpp
  
  
  CMake Error at CMakeLists.txt:10 (add_executable):
    No SOURCES given to target: YuvParallelProcess
  </code></pre>
  <p>I don't know why the shell just prints <code>$(PROJECT_SOURCE_DIR)</code> other than the value of <code>PROJECT_SOURCE_DIR</code>
  How can I print the value of <code>PROJECT_SOURCE_DIR</code>
  By the way, I can't figure out why cmake failed to compile my project</p>