Help needed building Krita from source

Hi all,

I’m trying to build the latest master from source on Ubuntu 20.04, following the instructions here. Unfortunately, I’m getting some CMake errors (no prior CMake experience I’m afraid) and my google-foo has failed me, so I was wondering if someone could help point me in the right direction. The output I get is:

CMake Error at data/CMakeLists.txt:28 (install):
  install FILES given no DESTINATION!


CMake Warning (dev) at CMakeLists.txt:12 (add_subdirectory):
  The source directory

    /home/username/workspace/krita/krita/pics/branding

  does not contain a CMakeLists.txt file.

  CMake does not support this case but it used to work accidentally and is
  being allowed for compatibility.

  Policy CMP0014 is not set: Input directories must have CMakeLists.txt.  Run
  "cmake --help-policy CMP0014" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:34 (ecm_add_app_icon):
  Unknown CMake command "ecm_add_app_icon".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.16)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!
See also "/home/username/workspace/krita/build/CMakeFiles/CMakeOutput.log".

According to what I found, ecm_add_app_icon is provided by extra-cmake-modules which I installed, but still get the error. Also I’m not quite sure what to make of " install FILES given no DESTINATION!". If anyone could help it’d be greatly appreciated :slight_smile:

Edit: Just for some more information, the code was cloned under /home/username/workspace/krita (the actual username was replaced for security reasons), and the command that generated this output was:
cmake …/krita/ -DCMAKE_INSTALL_PREFIX=$HOME/workspace/krita/install -DCMAKE_BUILD_TYPE=Debug -DKRITA_DEVS=ON
which I run from within the build folder (and krita/install was created manually as per the instructions before).

I had an ecm related error in building too and fixed that by installing extra-cmake-modules (on arch anyway), so that part sounds right.

Asides that I’m a bit unsure what to suggest from what you posted (note that I do not have much Krita building experience either though ;)) - intuitively I’d say it might be helpful to post some more info, especially: how did you lay out your folders, and which commands exactly did you run in which of them, and in which order, etc.

Also my general cmake experience (also with other projects) is that sometimes what helps is simply rm -rf build/, then recreating the build folder, and then running cmake again. (especially applies when building worked at some point and then stopped to work at some point)

When you created the config with cmake, did you set your directories right?

It looks like you accidentally just copied the example path from the manual and /home/username/ does not exist on your system. Instead of the literal username the path should have your username. On my system my home folder is /home/takiro because that’s the name of my Linux log-in.

Good point about the additional information. I edited my original post to include them.
Unfortunately I had already tried removing the build folder before retrying (as I’ve had similar experiences with other projects as well), but unfortunately I got no luck.

That was modified on purpose I’m afraid, I should have mentioned. I replaced my actual username with just “username” before posting the log for security reasons. I guess it was a bit overkill in the grand scheme of things. Regardless, the path itself is correct :slight_smile:

thanks for the additional details! looks alright asides that there are three dots in cmake .../krita/(...) (?) but I suppose that might be a typo during posting it here. does the mentioned CMakeOutput.log contain any thing that looks useful to you, or just the same stuff from the console log?

The three dots display like that on the forum, not sure why. Seems like an auto-correct type of thing on?
The log doesn’t seem to have anything related to the error, and grepping it doesn’t show any mention of error in general.
I could upload it somewhere if someone thinks it’s going to be useful. It’s probably too large to post the contents in a message.

not sure if cmake has a problem with paths ending with a slash like ../krita/ in your example. It’s not in the manual. Usually this shouldn’t be a problem though but some programs are picky not sure if cmake is one of them.

Regarding the contents of CMakeOutput.log i wouldn’t know any specific thing to look for myself, brought it up more to maybe open up another avenue to tackle this … right now I’m out of ideas unfortunately, maybe someone from the Krita team has further ideas.

To me it looks as if the latest version of cmake, which I haven’t used yet, has gotten even pickier again, and that’s causing these problems. We’ll have to look into it.

ETA: I just checked with the latest cmake and didn’t get any errors. There were a few deprecation warnings, but no errors.