Make: Makefile: No such file or directory when using Ninja

Hello

Due to the Qt build warning:

The officially supported CMake generator for building Qt is Ninja. You are using: 'Unix Makefiles' instead. Thus, you might encounter issues. Use at your own risk.

I’m trying to build QtBase 6.1.2 with Ninja. For this my first idea was to update and install Ninja, however there is a conflict during the symlinking with PIP:Ninja.

So I decide to use and add PIP:Ninja in the BuildDependencies of QtBase and in the Recipe I added

environment=(
CMAKE_GENERATOR=Ninja
)

but unfortunately the compilation fails with:

-- Build files have been written to: /Data/Compile/Sources/qtbase-v6.1.2/_build
make: Makefile: No such file or directory
make: *** No rule to make target 'Makefile'.  Stop.
Compile: QtBase 6.1.2 - Build process failed.

I tried Compile with --debug option but it doesn’t help. Did I missed something, where is my mistake ?

Thx

EDIT:
Well, I also tried two others ideas. The first by adding -GNinja in the cmake_options=() but I have the same issue the second by adding a line with cmake=“cmake -G Ninja” but I doesn’t apply, I haven’t looked in the sources yet, I suspect that cmake="" doesn’t exist.

Well, I have something.

I read the sources files especially BuildType_cmake and BuildType_makefile and with the use of

do_build() {
   cmake --build .
}

with


environment=(
   CMAKE_GENERATOR=Ninja
)

I can now use Ninja for the build.

BUT, I want to be honest I do not have your level and knowledge, I understand some part of the code but I have some trouble understanding some links between the different functions.

I don’t understand this part from the BuildType_makefile script file.

${buildmerged:+"${buildmerged[@]}"}

and from where the buildmerged comes from, so maybe I missed something important in my do_build() function.

EDIT:
Well, it’s a nice thing this Log_Normal, I can output the value of a variable, so from what I understand the value of ${buildmerged:+"${buildmerged[@]}"} is -j2 LIBTOOL=/usr/bin/libtool.

For the -j2 I can add CMAKE_BUILD_PARALLEL_LEVEL=$(/usr/bin/getconf _NPROCESSORS_ONLN) in the environment part and about the LIBTOOL maybe it’s not necessary in my case.

Building… :slight_smile:

Well, the build succeeded but obviously the installation process failed, I thought about it at the last moment :laughing:

Well, finally my recipe looks like that:

cmake_variables=(
   CMAKE_GENERATOR=Ninja
   CMAKE_BUILD_PARALLEL_LEVEL=$(/usr/bin/getconf _NPROCESSORS_ONLN)
)

cmake_options=(
   ...
)

do_build() {
   cmake --build .
}

do_install() {
   SandboxInstall $verbose \
   ${unmanagedlist:+--unmanaged-files "${unmanagedlist}"} ${sandboxopts:+"${sandboxopts[@]}"} --make cmake --install .
}

Could you please confirm that’s ok or not or something I could missed or need to modify ? The build time on my little machine is long and I want something clean before starting the build of the others Qt6 softwares.

Thx

So, my do_install() doesn’t works as expected, I’m trying to do it manually like that:

First I have to manually:

mkdir -p /Programs/QtBase/6.1.2 and mkdir -p /Programs/QtBase/Settings

next I run

SandboxInstall -v -c "cmake --install ." QtBase 6.1.2

but after that, now I get this error:

CMake Error at cmake_install.cmake:60 (file):
file INSTALL cannot find
“/Data/Compile/Sources/qtbase-v6.1.2/cmake/QtBuildInternals/QtStandaloneTestTemplateProject”:
No such file or directory.

which is strange because the file folder exist:

ls /Data/Compile/Sources/qtbase-v6.1.2/cmake/QtBuildInternals/QtStandaloneTestTemplateProject/

CMakeLists.txt Main.cmake

Well, installation is working with:

do_install() {
SandboxInstall $verbose \
   ${unmanagedlist:+--unmanaged-files "${unmanagedlist}"} {sandboxopts:+"${sandboxopts[@]}"} -c "cmake --install ." "$appname" "$versionnumber"
}

All your comments are welcome
CU Later

Thx

Whoa. I guess you’ve been just exposed to the worst-case scenario. This is a nightmarish build process, it seems.

Have you tried to use this simple definition for do_install() ?

do_install() {
    cmake --install .
}