fluid icon indicating copy to clipboard operation
fluid copied to clipboard

#305 Be able to find and compile the fluid demo with QtCreator

Open Slesa opened this issue 4 years ago • 23 comments

Pull Request check-list

Please make sure to review and check all of these items:

  • [ ] Does the code keep building with this change?
  • [ ] Do the unit tests pass with this change?
  • [ ] Is the commit message formatted according to CONTRIBUTING.MD?
  • [ ] If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included?
  • [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Affected core subsystem(s)

Please provide affected core subsystem(s).

Description of change

Please provide a description of the change here. Add a screenshot or a screencast if necessary.

Slesa avatar Apr 10 '20 22:04 Slesa

Why did you rename the folder. You can already build the demo by default.

plfiorini avatar Apr 11 '20 07:04 plfiorini

Well, if I would have been able to build the demo, I wouldn't have created a complete new project.

Second reason: it was the question where the demo app is, you have to search it in src. Whereas the examples are in the root - why have two different concepts?

Slesa avatar Apr 11 '20 10:04 Slesa

Well, if I would have been able to build the demo, I wouldn't have created a complete new project.

That is not good engineering, first you should understand the problem.

Second reason: it was the question where the demo app is, you have to search it in src. Whereas the examples are in the root - why have two different concepts?

It's not an example it's a standalone application that is installable.

plfiorini avatar Apr 11 '20 10:04 plfiorini

And the demo is literally built by default.

plfiorini avatar Apr 11 '20 10:04 plfiorini

The problem is, that I check out a completely unknown fresh new project, try to compile it, and it does not work. I did neither change nor remove something. So what do you guess I should do? Go on, try another project?

Slesa avatar Apr 11 '20 10:04 Slesa

The problem is, that I check out a completely unknown fresh new project, try to compile it, and it does not work. I did neither change nor remove something. So what do you guess I should do? Go on, try another project?

Open an issue with the error and ask for help maybe.

plfiorini avatar Apr 11 '20 10:04 plfiorini

And the demo is literally built by default.

I know that make install of fluid copies the plugin into the Qt folder. I have no idea where this demo should be.

Slesa avatar Apr 11 '20 10:04 Slesa

The problem is, that I check out a completely unknown fresh new project, try to compile it, and it does not work. I did neither change nor remove something. So what do you guess I should do? Go on, try another project?

Open an issue with the error and ask for help maybe.

Like this one? https://github.com/lirios/fluid/issues/305

Slesa avatar Apr 11 '20 10:04 Slesa

And the demo is literally built by default.

I know that make install of fluid copies the plugin into the Qt folder. I have no idea where this demo should be.

<prefix>/bin as other programs are installed on Linux

plfiorini avatar Apr 11 '20 10:04 plfiorini

The problem is, that I check out a completely unknown fresh new project, try to compile it, and it does not work. I did neither change nor remove something. So what do you guess I should do? Go on, try another project?

Open an issue with the error and ask for help maybe.

Like this one? #305

Doesn't say much just that you can't build it but you don't say what is your problem. README.md documents how to build Fluid and the demo gets built automatically by default.

plfiorini avatar Apr 11 '20 10:04 plfiorini

And the demo is literally built by default.

I know that make install of fluid copies the plugin into the Qt folder. I have no idea where this demo should be.

<prefix>/bin as other programs are installed on Linux

Why would I want to have a demo in $QTDIR/bin? But... Qt/5.14.2/gcc_64/bin/ does not have the demo, Qt/5.14.2/gcc_64/qml has no bin, Qt/5.14.2/gcc_64/qml/fluid has no demo... where else could it be? which fluid-demo -> fluid-demo not found

Slesa avatar Apr 11 '20 10:04 Slesa

The problem is, that I check out a completely unknown fresh new project, try to compile it, and it does not work. I did neither change nor remove something. So what do you guess I should do? Go on, try another project?

Open an issue with the error and ask for help maybe.

Like this one? #305

Doesn't say much just that you can't build it but you don't say what is your problem. README.md documents how to build Fluid and the demo gets built automatically by default.

This is true, sorry for that

CMake Error at CMakeLists.txt:19 (include): include could not find load file:

LiriSetup

Slesa avatar Apr 11 '20 10:04 Slesa

And the demo is literally built by default.

I know that make install of fluid copies the plugin into the Qt folder. I have no idea where this demo should be.

<prefix>/bin as other programs are installed on Linux

Why would I want to have a demo in $QTDIR/bin?

You don't, it's installed in $CMAKE_PREFIX/bin

But... Qt/5.14.2/gcc_64/bin/ does not have the demo, Qt/5.14.2/gcc_64/qml has no bin, Qt/5.14.2/gcc_64/qml/fluid has no demo... where else could it be? which fluid-demo -> fluid-demo not found

plfiorini avatar Apr 11 '20 10:04 plfiorini

Make sure submodules are fetched:

git submodule update --init

Then following the instructions at https://github.com/lirios/fluid#build we see that the -DFLUID_USE_SYSTEM_LCS:BOOL=OFF option needs to be passed to cmake in order to use LCS from the git submodule.

plfiorini avatar Apr 11 '20 10:04 plfiorini

What works: qmake && make What not works: cmake

CMake Error at cmake/shared/modules/LiriAddExecutable.cmake:50 (add_executable):
  add_executable called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/shared/modules/LiriAddTest.cmake:59 (liri_add_executable)
  tests/auto/controls/CMakeLists.txt:1 (liri_add_test)


CMake Error at cmake/shared/modules/LiriAddExecutable.cmake:50 (add_executable):
  add_executable called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/shared/modules/LiriAddTest.cmake:59 (liri_add_executable)
  tests/auto/core/CMakeLists.txt:1 (liri_add_test)

Slesa avatar Apr 11 '20 10:04 Slesa

What works: qmake && make What not works: cmake

CMake Error at cmake/shared/modules/LiriAddExecutable.cmake:50 (add_executable):
  add_executable called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/shared/modules/LiriAddTest.cmake:59 (liri_add_executable)
  tests/auto/controls/CMakeLists.txt:1 (liri_add_test)


CMake Error at cmake/shared/modules/LiriAddExecutable.cmake:50 (add_executable):
  add_executable called with incorrect number of arguments
Call Stack (most recent call first):
  cmake/shared/modules/LiriAddTest.cmake:59 (liri_add_executable)
  tests/auto/core/CMakeLists.txt:1 (liri_add_test)

I have added more information on the build process: https://github.com/lirios/fluid/commit/24a57c6832164e40e364d2ef5d29d01066624cbc

Just to pinpoint the issue, what version of CMake and (if it applies) QtCreator are you using? Cmake 3.10 is required.

plfiorini avatar Apr 11 '20 11:04 plfiorini

Just to pinpoint the issue, what version of CMake and (if it applies) QtCreator are you using? Cmake 3.10 is required.

It is cmake 3.10.2 on Ubuntu 18.04. Qt & Creator is the latest download with 5.14.2. I called it

cmake -DCMAKE_INSTALL_PREFIX=~/work/liri ..

in subfolder build

Slesa avatar Apr 11 '20 11:04 Slesa

Still the same error, now with

cmake -DCMAKE_INSTALL_PREFIX=~/work/liri -DFLUID_USE_SYSTEM_LCS:BOOL=OFF ..

🤷‍♂️

Slesa avatar Apr 11 '20 11:04 Slesa

Can't reproduce on my system neither I can reproduce it in the CI. Have to make an Ubuntu 18.04 VM to test this out.

plfiorini avatar Apr 16 '20 17:04 plfiorini

It is cmake 3.10.2 on Ubuntu 18.04. Qt & Creator is the latest download with 5.14.2. I called it

Ubuntu 18.04 has Qt 5.9, how did you get 5.14.2?

plfiorini avatar Apr 16 '20 18:04 plfiorini

As I wrote earlier, I've downloaded it from Qt.io. I had this problem on (I think) an actual Fedora 31, so the two things coming together are maybe a Qt 5.14.2 with a CMake > 3.10 (as there was no warning about that). I can even check if it runs on Manjaro. On the other hand: what could cause this 'incorrect number of arguments'? Should I go all those steps again, beginning from the correct git checkout, checking all versions of all involved programs? Would that help?

Slesa avatar Apr 16 '20 18:04 Slesa

@Slesa With commit fee08d610f8b1447de1c3f3fe65f1dbdf7bfa823, the cmake/shared/ submodule was updated and that fixed your issue. This means you are using an old fluid repository version.

Make sure it's up to date:

git pull
git submodule update

Check the status with:

git rev-parse HEAD
git submodule status

plfiorini avatar Apr 17 '20 06:04 plfiorini

Ok, step by step:

git clone https://github.com/lirios/fluid.git fluidup && cd fluidup
git submodule update --init
git log | grep fee08
   commit fee08d610f8b1447de1c3f3fe65f1dbdf7bfa823
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=~/work/liri -DFLUID_USE_SYSTEM_LCS:BOOL=OFF ..

CMake Error at src/demo/CMakeLists.txt:72 (set_target_properties):
  set_target_properties Can not find target to add properties to: FluidDemo


CMake Error at cmake/shared/modules/LiriAddExecutable.cmake:50 (add_executable):
  add_executable called with incorrect number of argument

What is wrong with me? :)

git rev-parse HEAD                                         ✘ 1 
24a57c6832164e40e364d2ef5d29d01066624cbc
git submodule status
 4fdf2cb6edd23aaa467cfdbc758ee8ed15cbfc81 ../cmake/shared (v1.1.0)
 ebee5a8798ab0a063b56cf7c73be2a28ec353a2e ../qbs/shared (v1.4.0)
cmake --version
cmake version 3.10.2
echo $QTDIR
~/work/Qt/5.14.2/gcc_64

Slesa avatar Apr 18 '20 10:04 Slesa