compor / llvm-ir-cmake-utils

LLVM IR CMake utils for bitcode file manipulation by opt and friends
GNU Lesser General Public License v2.1
68 stars 14 forks source link

CMake configuration error #19

Closed juanfgarcia closed 3 years ago

juanfgarcia commented 3 years ago

I'm getting this error when I try to cmake ..:

-- Configuring incomplete, errors occurred! See also "[...]/CMakeFiles/CMakeOutput.log".

Without the include(LLVMIRUitls) does not appear

compor commented 3 years ago

Hello there,

Thanks for reporting this.

However, I need some more detail:

Cheers, Chris

juanfgarcia commented 3 years ago

My version is 3.10.2

This error can be reproduced only with the include

project(CFECORE C)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(llvm-ir-cmake-utils)

In the CMakeOutput.log there doesn't seem to be any error log

CMakeOutput.log

compor commented 3 years ago

As the examples (under examples/) show you need to add the cmake dir of this module in the modules path (CMAKE_MODULE_PATH) of your project in order for the include() to locate it.

So, this means for you

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/llvm-ir-cmake-utils/cmake/")

Can you please try this and let me know?

I thought this was fairly obvious, but apparently not. I'll update the documentation.

juanfgarcia commented 3 years ago

I was trying with the LLVMIRUtils.cmake directly inside of my cmake directory. I cloned the full llvm-ir-cmake-utils in my cmake directory and tried this line and I got the same output.

juanfgarcia commented 3 years ago

I found the problem, it was missing the line:

cmake_minimum_required(VERSION 3.10)

Thank you so much for your help

compor commented 3 years ago

Oh well, we would have found it the minimal CMakeLists.txt was provided as I asked initially. Glad it's resolved.