Skip to content

CMake Error: The source directory does not appear to container CMakeLists.txt #516

Closed
@danhab99

Description

@danhab99

I'm following the instructions to build this tool manually as described in the README.md but the second step isn't working.

This happens just fine

The process done on Linux is roughly:

git clone --single-branch --branch llvmorg-17.0.4 https://github.com/llvm/llvm-project
cd llvm-project
mkdir -p artifacts/bin
cd artifacts/bin
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=clang ../../llvm
make install

This yeilds an error

Afterwards, you can then build libClangSharp where the process followed is roughly:

git clone https://github.com/dotnet/clangsharp
cd clangsharp
mkdir -p artifacts/bin/native
cd artifacts/bin/native
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install
make install

The error happens at the cmake command.

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install -DPATH_TO_LLVM=../../../../llvm-project/artifacts/install 
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMake Error: The source directory "/home/dan/Documents/install/build-clangsharp/clangsharp/artifacts/bin/native" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

I'm sure I copy pasted the commands in from the README correctly. Is there something in the documentation I should have noticed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions