[cfe-dev] LibTooling CMake Error

Mohammad Adil madil90 at gmail.com
Fri Oct 19 05:22:16 PDT 2012


I've checked out the extra tools repository at the correct place and I have
built clang again, with the CLANG_BUILD_EXAMPLES variable set to true in
cmake. I am still getting the same error. What can possibly be wrong? Can
you please provide all the steps required to make this command work.
     The two cmake files you mentioned are both related to libclang. I am
using Libtooling. How do I adapt them to build the FrontEndAction example
given in the docs.

On Fri, Oct 19, 2012 at 4:12 PM, Philip Craig <philipjcraig at gmail.com>wrote:

> On Fri, Oct 19, 2012 at 8:52 PM, madil90 <madil90 at gmail.com> wrote:
> > Hi,
> >    I am trying to setup LibTooling for clang. I have gone through the
> > procedure given at </a>
> > <http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html> . I can
> > succesfully run clang-check for any source file. I am now trying to
> compile
> > the example at  </a> <http://clang.llvm.org/docs/RAVFrontendAction.html>
> .
> > When using cmake, I get the following error:
> >
> > Unknown CMake command : add_clang_executable
> >
> >   When using cmake to build clang, I used
> -DEXPORT_CMAKE_COMPILE_COMMANDS=ON
> > variable as suggested. Then why isn't this command working?
>
> add_clang_executable is defined in the clang cmake files, so to use it
> you need to build the example as part of clang. If you want to follow
> this route, then a convenient place in the tree to put it is in the
> extra tools repository. Have a look at
> http://clang.llvm.org/docs/ClangTools.html
>
> Alternatively, to build standalone, you can try copying the cmake
> configuration from
> https://github.com/philipc/clang-ast/blob/master/CMakeLists.standalone
> and
> https://github.com/philipc/clang-ast/blob/master/cmake/modules/FindLibClang.cmake
>



-- 
Mohammad Adil
LUMS SSE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121019/3185bb6e/attachment.html>


More information about the cfe-dev mailing list