Getting the LLVM includes to be recognized

I am using the following cmake input :

c:\Users\Administrator\Documents\programming\cmake-hello-clang\build>"c:\Program

Files\CMake\bin\cmake.exe" -GNinja -DCMAKE_MODULE_PATH=“C:/Program Files (x86)/
LLVM/lib/cmake” -DLLVM_INCLUDE_DIRS=“C:/Program Files (x86)/LLVM/include” …

however when Ninja is run I get.

c:\Users\Administrator\Documents\programming\cmake-hello-clang\build>ninja
[1/2] Building CXX object CMakeFiles/myTool.dir/main.cpp.obj
FAILED: CMakeFiles/myTool.dir/main.cpp.obj
C:\PROGRA~2\LLVM\bin\CLANG_~1.EXE -DGTEST_HAS_RTTI=0 -I"C:/Program Files (x86)/
LLVM/include" -g -Xclang -gcodeview -O0 -D_DEBUG -D_DLL -D_MT -Xclang --dependen
t-lib=msvcrtd -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONS
TDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SE
CURE_NO_WARNINGS -DUNICODE -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_M
ACROS -D__STDC_LIMIT_MACROS -fno-exceptions -fno-rtti -std=gnu++14 -MD -MT CMak
eFiles/myTool.dir/main.cpp.obj -MF CMakeFiles\myTool.dir\main.cpp.obj.d -o CMake
Files/myTool.dir/main.cpp.obj -c …/main.cpp
…/main.cpp:27:10: fatal error: ‘llvm/Analysis/Verifier.h’ file not found
#include “llvm/Analysis/Verifier.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~

James

You seem to have added a target "myTool" to the LLVM sources. You must
tell CMake to add the required include path, etc. For instance, using

   target_link_libraries(myTool PUBLIC LLVMCore)

Not that alone will not be sufficient. I recommend Google'ing a
tutorial for what you are doing.

Btw, it is not recommended to work under the Administrator account.

Michael