title: CMAKE Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS)
body: <p>I am trying to run cmake in our school project, the CMakeList.txt looks as follows:</p>
  <pre><code>cmake_minimum_required(VERSION 3.0)
  project(nagata)
  FIND_PACKAGE( OpenMP )
  if(OPENMP_FOUND)
  message(&quot;OPENMP FOUND&quot;)
  set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}&quot;)
  set(CMAKE_CXX_FLAGS &quot;${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}&quot;)
  set(CMAKE_EXE_LINKER_FLAGS &quot;${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}&quot;)
  endif()
  
  set(CMAKE_C_COMPILER clang-omp CACHE STRING &quot;C compiler&quot; FORCE)
  set(CMAKE_CXX_COMPILER clang-omp++ CACHE STRING &quot;C++ compiler&quot; FORCE)
  
  FIND_PACKAGE( pybind11 REQUIRED )
  
  FIND_PACKAGE(PythonInterp 3)
  FIND_PACKAGE(PythonLibs   3)
  
  IF( PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND AND PYBIND11_FOUND )
    INCLUDE_DIRECTORIES(
      ${PYTHON_INCLUDE_DIRS}
      ${PYBIND11_INCLUDE_DIRS}
    )
    ENDIF()
  INCLUDE_DIRECTORIES(&quot;/usr/include/python3.7m&quot;)
  
  add_library(pynagata SHARED pythonlib.cpp)
   # The library must not have any prefix and should be located in
    # a subfolder that includes the package name. The setup will be
    # more complicated otherwise.
    SET_TARGET_PROPERTIES( pynagata
      PROPERTIES
        PREFIX &quot;&quot;
        LIBRARY_OUTPUT_DIRECTORY &quot;${CMAKE_CURRENT_BINARY_DIR}/pynagata&quot;
    )
  
  add_executable(nagata main.cpp)
  install(TARGETS nagata RUNTIME DESTINATION bin)
  </code></pre>
  <p>When I run <code>cmake ..</code> in my <code>build</code> directory I get this output which looks almost OK:</p>
  <pre><code>-- The C compiler identification is Clang 11.0.0
  -- The CXX compiler identification is Clang 11.0.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/local/opt/llvm/bin/clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/local/opt/llvm/bin/clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found OpenMP_C: -fopenmp=libomp (found version &quot;5.0&quot;) 
  -- Found OpenMP_CXX: -fopenmp=libomp (found version &quot;5.0&quot;) 
  -- Found OpenMP: TRUE (found version &quot;5.0&quot;)  
  OPENMP FOUND
  -- Found PythonInterp: /usr/local/bin/python3.8 (found version &quot;3.8.6&quot;) 
  -- Found PythonLibs: /usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib
  -- Performing Test HAS_CPP14_FLAG
  -- Performing Test HAS_CPP14_FLAG - Success
  -- Found PythonInterp: /usr/local/bin/python3.8 (found suitable version &quot;3.8.6&quot;, minimum required is &quot;3&quot;) 
  -- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at least version &quot;3&quot;)
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/.../build
  </code></pre>
  <p>Except the line <code>-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (Required is at least version &quot;3&quot;)</code> which seems odd to me as few lines before it literally finds it:<code>-- Found PythonLibs: /usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib</code>. I tried to set an env variable <code>PYTHON_INCLUDE_DIRS=&quot;/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/libpython3.8.dylib&quot;</code> which is the exact same path as from the line above. Still, I get this <em>error</em>.</p>
  <p>How can I make it find the <code>PythonLibs</code>? I really don't understand why the env variable doesn't work. I will also be happy to provide more info - I just don't know what.</p>
  <p>I am using:</p>
  <ul>
  <li>CLT: 12.0.0.0.1.1599194153</li>
  <li>Xcode: 12.0.1</li>
  <li>macOS Catalina ver. 10.15.7</li>
  <li>Clang: 12.0 build 1200</li>
  </ul>
  <p>PS: When I try to run <code>make</code> afterwards I get <code>fatal error: 'string' file not found #include &lt;string&gt;</code> which is maybe somehow connected to this issue...</p>