lxqt / lxqt-config

Tools to configure LXQt and the underlying operating system
https://lxqt.github.io
GNU Lesser General Public License v2.1
81 stars 62 forks source link

Confusing cmake name - and now I am confused even more .... can not compile lxqt-config #810

Closed rubyFeedback closed 2 years ago

rubyFeedback commented 2 years ago

Hey guys.

I tend to compile from source via ruby scripts.

The URL tarball I am trying to use is this one here:

https://github.com/lxqt/lxqt-config/releases/download/1.0.0/lxqt-config-1.0.0.tar.xz

I extract it and start cmake.

Then I get this:

CMake Error at CMakeLists.txt:38 (find_package):
  By not providing "Findlxqt.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "lxqt", but
  CMake did not find one.

  Could not find a package configuration file provided by "lxqt" (requested
  version 1.0.0) with any of the following names:

    lxqtConfig.cmake
    lxqt-config.cmake

  Add the installation prefix of "lxqt" to CMAKE_PREFIX_PATH or set
  "lxqt_DIR" to a directory containing one of the above files.  If "lxqt"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Configuring incomplete, errors occurred!
See also "/Depot/jj/lxqt-config-1.0.0/CMakeFiles/CMakeOutput.log".

So ... the name of the tarball is:

lxqt-config-1.0.0.tar.xz

If we omit version and .tar.xz file "format" we get:

lxqt-config

Now look again at the error cmake shows me:

  Could not find a package configuration file provided by "lxqt" (requested
  version 1.0.0) with any of the following names:

    lxqtConfig.cmake
    lxqt-config.cmake

So ... I try to compile lxqt-config, right? Yet the cmake error tells me "yo dude, I can not find any config file provided by lxqt with the following name ... NAME OF THE PROGRAM YOU ARE TRYING TO COMPILE ..." aka in this case, lxqt-config.cmake. I don't understand this. If the program name is lxqt-config, why does it complain that it can not find lxqt-config.cmake? I mean which OTHER (!!!) package should provide THAT particular .cmake file? Why is that name then the very same as the program I am trying to compile right now? This is confusing to me. It's like saying:

"You try to compile program foobar, but we can not find foobar.cmake."

Confusion here on my part now ...

Perhaps this makes sense for you lxqt devs out there, but to me this is SUPER confusing. Why does it want to look for a .cmake file for the very package (!!!) it is trying to compile?

Perhaps it is trying to look for ANOTHER package. In this case, can it tell me on the commandline what it really wants to find instead? Right now this is a super-confusing situation. I may do something wrong in the build-up compile chain, that may also be the case - in fact, I can not get the whole lxqt stack to compile. Would be nice if someone could tell the exact NAMES of the packages. With such error messages as right now I just end up being totally confused. Perhaps the whole build/compile chain should be simplified a bit, or an automatic "one tarball to download and then compile" be offered. I don't mind building up my own compile chain (ruby handles this for me), but with such strange error messages I just get confused. I understand nobody likes GNU autoconfigure anymore, but the error messages via GNU autoconfigure often were more helpful than cmake in general. (Then again I am more of a meson fan these days, but I am not suggesting any change here.)

So the TL;DR is:

"Please make the NAME and error message for the compilation process easier to understand, in particular for when you try to compile lxqt-config and cmake complains that there is no lxqt-config.cmake file to be found."

palinek commented 2 years ago

Cmake is telling you exactly, what can not be found (https://github.com/lxqt/lxqt-config/blob/master/CMakeLists.txt#L38): CMake Error at CMakeLists.txt:38 (find_package): By not providing "Findlxqt.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "lxqt", but CMake did not find one.

The liblxqt is required to build lxqt-config.

If you want to build from source a cmake-driven project, please, get more familiar with cmake and its searching for modules. Submitting bugs upstream is not a good way to learn.

eli-schwartz commented 2 years ago

This is confusing to me. It's like saying:

"You try to compile program foobar, but we can not find foobar.cmake."

cmake is a confusing build system, because it uses its own internal "standard" for looking for dependencies, which is not knowledge portable to other build systems.

In this case, you are trying to build project foo-config.

The project depends, in turn, on project foo.

cmake is looking up find_package(foo), which dispatches to cmake's internal "standard" for finding packages, using the following rules. Given X, try to find:

Now, it turns out this one package happens to be named X-config, and depends on X, so for cmake to look up X it looks up X-config.cmake, and if cmake wanted to look up X-config, it would try to find a file named XConfig-config.cmake or X-config-config.cmake.

So, by strange coincidence the lxqt organization and the cmake project are disagreeing about the meaning of the word "config", leading to it being doubled in some cases, and having non-obvious meanings in other cases.

Basically, blame cmake, not this project.

eli-schwartz commented 2 years ago

(I do not know why cmake thinks by listing the internal implementation details of the dependency file, it will improve the lives of users. It should just say "could not find dependency lxqt, try installing it or adding it to CMAKE_PREFIX_PATH or yadda yadda yadda".)