[llvm-dev] Embedding llvm as a git submodule in Project

Timo Janssen via llvm-dev llvm-dev at lists.llvm.org
Sun Oct 9 14:03:52 PDT 2016


Hi,


I am sorry but I really am not good with cmake yet.

I made one mistake I used MODULE instead of CONFIG in find_package.

But even with CONFIG I doesn't work for me.


Here my CMakeLists.txt:


cmake_minimum_required(VERSION 3.5.1)
project(SimpleProject)

find_package(LLVM REQUIRED CONFIG PATHS 
"${CMAKE_CURRENT_SOURCE_DIR}/llvm/cmake$

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})

add_executable(simple-tool main.cpp)

llvm_map_components_to_libnames(llvm_libs support)

target_link_libraries(simple-tool ${llvm_libs})


Here part of the cmake output in terminal:

CMake Error at CMakeLists.txt:4 (find_package):
   Could not find a package configuration file provided by "LLVM" with 
any of
   the following names:

     LLVMConfig.cmake
     llvm-config.cmake

   Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
   "LLVM_DIR" to a directory containing one of the above files.  If "LLVM"
   provides a separate development package or SDK, be sure it has been
   installed.


-- Configuring incomplete, errors occurred!
See also "/home/timoo/Schreibtisch/build/CMakeFiles/CMakeOutput.log"


I added the PATHS to find_package becouse the command must find the files.

In the llvm/cmake/modules dircotry are:

LLVM-Config.cmake (instead of lower case) and

LLVMConfig.cmake.in (.in added at end)


So what must I do?


Am 09.10.2016 um 16:18 schrieb Timo Janssen:
> Hi all.
>
>
> I want to use llvm in my project and I want to make llvm a git 
> submodule in my project.
>
> http://llvm.org/docs/CMake.html#embedding-llvm-in-your-project
>
> At this in the documentation it claims to describe how to embed llvm 
> into a project. I tried it that way but it doesn't work, because there 
> isn't any findLLVM.cmake in the llvm/cmake/modules directory anymore 
> (i don't know if there was one in the past).
>
>
> Can someone tell me how to do it now.
>
>
> Timo Janssen
>



More information about the llvm-dev mailing list