Skip to content

CMake - When executing cmake --build build on the command line the project does not build #1724

@Sailanarmo

Description

@Sailanarmo

Godot version

4.3, 4.4

godot-cpp version

4.3, 4.4

System information

Rocky Linux 9.5, Ubuntu 24.04.2

Issue description

When attempting to build godot-cpp from the command line using traditional CMake methods the Makefile will not execute a default project when cmake --build . or make is executed. It reports that there are files that are to be generated but executing make does nothing. It was only until I opened up the Makefile that CMake generated that I was able to find the target names that can be built:

  • godot-cpp.generate_bindings
  • godot-cpp.template_debug
  • godot-cpp.template_release
  • godot-cpp.editor

I have no idea which of these are supposed to be built or if they all need to be built in order to create the necessary tools and libraries. CMake is supposed to act as a use and forget about it. A seasoned CMake user as myself expects the following:

 cmake -B build -S . -DCMAKE_INSTALL_PREFIX=<My custom installation prefix> -DCMAKE_BUILD_TYPE=Release cmake --build build --target install --parallel 10 

However, it is expected that user does:

 cmake -B build -S . cmake --build build --target godot-cpp.generate_bindings --parallel 10 cmake --build build --target godot-cpp.template_debug --parallel 10 cmake --build build --target godot-cpp.template_release --parallel 10 cmake --build build --target godot-cpp.editor --parallel 10 

This is not straight forward and if this is the intended behavior then it should be available in the README.md or in the Official Build Documents. Ideally, it would be nice to have an install version as well for portability. It's nice to be able to point to a customized install of a package using something like the following:

 find_package(godot-cpp 4.4 EXACT REQUIRED HINTS /my/install/location)

Steps to reproduce

Clone the repo down:

 git clone -b godot-4.4-stable https://github.com/godotengine/godot-cpp.git --recursive 

Change Directories into godot-cpp and execute:

 cmake -B build -S . cmake --build build 

Nothing builds.

Minimal reproduction project

Just need CMake, a compatible compiler with C++17, and a command line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeenhancementThis is an enhancement on the current functionalitytopic:buildsystemRelated to the buildsystem or CI setup

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions