paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
3.06k stars 823 forks source link

How do you install this? #123

Closed crener closed 6 years ago

crener commented 7 years ago

I know this is probably a stupid question to those who know what they are doing....

How do I actually install and use this library. I've downloaded it and ran CMAKE but it gives me an error about not knowing where Qt is. When I give it the directory it still complains about a missing cmake file. Is there an example of this file or should it already be in one of the sub directories.

Should the Qt Directory be the root of Qt or the root of the specific version that I want to use (inside the Qt dir)?

Sorry for the dumb issue but we all start somewhere... :)

russelltg commented 7 years ago

Point cmake to a path similar to C:/Qt/5.9/msvc2015_64

Depending on your compiler.

On Wed, Oct 18, 2017, 6:00 AM Martin Kruger notifications@github.com wrote:

I know this is probably a stupid question to those who know what they are doing....

How do I actually install and use this library. I've downloaded it and ran CMAKE but it gives me an error about not knowing where Qt is. When I give it the directory it still complains about a missing cmake file. Is there an example of this file or should it already be in one of the sub directories.

Should the Qt Directory be the root of Qt or the root of the specific version that I want to use (inside the Qt dir)?

Sorry for the dumb issue but we all start somewhere... :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paceholder/nodeeditor/issues/123, or mute the thread https://github.com/notifications/unsubscribe-auth/AGxqOt66Z22Z3cHfcxr00yOUCTdql__Cks5steh4gaJpZM4P9mS9 .

paceholder commented 7 years ago

Which OS are you using?

On linux I usually do this:

export CMAKE_PREFIX_PATH=/your/qt/installation/path/qt/5.9.1:$CMAKE_PREFIX_PATH
git clone _address_of_this_git_repository_
cd nodeeditor
mkdir build && cd build
cmake .. && make

The first line changes the environment variable that points CMake where to look for the libraries.

paceholder commented 7 years ago

Did it work for you ?

crener commented 7 years ago

Sorry not had a chance to experiment with it. I think that russelltg is on the right lines, I'll update this when I get a chance to try it again (probably saturday)

paceholder commented 7 years ago

No hurry, just wanted to make sure that it works for you.

crener commented 7 years ago

No I still can't get it to install. As far as I know I have all the settings right but I am useless when it comes to CMAKE...

image

paceholder commented 7 years ago
  1. The variable CMAKE_INSTALL_PREFIX should point to the Qt's installation directory. All the rest Qt5xxx_DIR things are then not necessary.

  2. Alternatively, you could define all necessary Qt5xxx_DIR variables.

image

In my case they point to qt/installation/path/cmake/Qt5

crener commented 7 years ago

Ok, so i got it building the path for me ended up being D:/Qt/5.8/msvc2015_64/lib/cmake/Qt5.

With the sln I get 3594 warnings (using Visual Studio 2015 Enterprise), is that expected? By default I also got 6 build errors to do with LNK1112 (It is trying to build x86 instead of x64) which I fixed with this, after that I got 7 errors for MSB8020 which has todo with CMAKE setting the wrong build target for visual studio. That's basically where I am now. Visual studio can't build the project because it thinks it needs to use a different compiler, I've gone through the settings and looked but can't find anything wrong. Platform Toolset is set to v140 which is correct and other settings are correct as well.

Update

I ran the build process again and now I'm getting the original LNK1112 error again. Well, I guess this library doesn't like me :(

paceholder commented 7 years ago

The project is being build with MSVC, here is the continuous integration config: https://github.com/paceholder/nodeeditor/blob/master/.appveyor.yml To make it work I needed to spend time on wrong target settings as well.

I can't give any decent hints as I use Linux + command line tools. it seems that CMake and Visual Studio is a crappy combination.

Update

I ran the build process again and now I'm getting the original LNK1112 error again. Well, I guess this library doesn't like me :(

Visual Studio is a bunch of crap

paceholder commented 7 years ago

I wanted to check int on a virtual machine but can't even uninstall the old version of VS. It hangs

image

crener commented 7 years ago

Visual Studio is a bunch of crap

Yeah, for C++ it's a bit iffy. I would probably switch to CLian but it's not quite there yet.

it seems that CMake and Visual Studio is a crappy combination.

CMAKE and Windows is a bad combination (in my experience), it would be better if you could just use apt-get for all the libraries like you can on Linux. :(

can't even uninstall the old version of VS

If you need to make any changes to VS it takes ages. Installing the newest versions of VS takes at least 40 min, usually 2-3 hours with a few packages selected...

paceholder commented 7 years ago

Take a look at QtCreator, I used it a couple of years ago. Since then it got just better. It eats CMakeLists.txt as a project file.

crener commented 7 years ago

I had a look at it when I first installed Qt (a few months ago), It looked quite limited as far as debugging and multi project solutions go. There as a VS plugin for the Qt gui creation tool so i've been using that with VS for actual coding.

jcelerier commented 7 years ago

@crener

It looked quite limited as far as debugging and multi project solutions go.

care to say what seems to be missing for you ? in my experience QtCreator >>> VS

russelltg commented 7 years ago

The question was how can I get this to compile under Visual Studio, let's keep that topic because it is permanent and nodeeditor can compile under VS (I've done it plenty of times).

To me, it seems Qt5_Dir should be set to D:/Qt/5.8/msvc2015_32 (can't remember if its that or msvc2015) if you're using the 32 bit generators for visual studio, which it seeems like you are. If you only have 64-bit Qt installed, then you'll have to use the 64 bit generators for CMake. Delete your current build directory (or CMakeCache.txt) and then re-run cmake and when you select the generator, select Visual Studio 14 2015 Win64. Then pass the D:/Qt/5.8/msvc2015_64 directory as Qt5_Dir.

That works for me, tell me if you have any issues :).

phzs commented 6 years ago

Hi, I am trying to build this on debian linux (9.2/stretch). After apt-get install qtbase5-dev I did like you proposed:

mkdir build && cd build
export CMAKE_PREFIX_PATH=/usr/include/x86_64-linux-gnu/qt5
cmake .. && make

I get the following error:

CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:63 (file): file attempted to create a directory: /home/user/workspace/nodeeditor/resources into a source directory. Call Stack (most recent call first): /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:211 (qt5_make_output_file) /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:282 (_QT5_PARSE_QRC_FILE) CMakeLists.txt:49 (qt5_add_resources)

-- Configuring incomplete, errors occurred! See also "/home/user/workspace/nodeeditor/CMakeFiles/CMakeOutput.log".

Do I need more than qtbase5-dev? Do I point it to the right directory?

paceholder commented 6 years ago

Hi @phzs,

I guess when you install it on Debian with apt-get the Qt libs end up in standard linux library paths, i.e. /usr/lib. Thus, there is no need to define CMAKE_PREFIX_PATH. CMake should check the standard paths without extra instructions.

I googled the same issue as in your listing but did not find any decent solution.

Which versions of Qt and CMake are you using?

Thanks

Dmitry

phzs commented 6 years ago

Hi @paceholder,

thanks for the quick reply :) You are right, it compiled cleanly after unsetting the variable (and deleting CMakeCache.txt). Many thanks!