Latest Posts

Topic: IDE qtcreator do not compile

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-04-30, 18:47

I am trying to use qtcreator as the IDE for widelands. But either i get an error:

"Build directory and source directory must not be the same."

or

"CMakeLists.txt is missing" (or similar)

Does somebody know which are the correct settings in qtcreator? I set:

build directory: ~/Quellcode/widelands-repo/bridged_roads/build
build steps: cmake .. -DCMAKE_BUILD_TYPE=Debug

With this settings the first error occurs. If i ommit the doublepoints the second error occurs.

Here you could find an image of the settings dialog in qtcreator: click

It's surely just a little thing what is going wrong here....


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-05-01, 12:05

When using QT Creator, I open the main Cmakelists.txt with the standard settings. This will give me a new project with all the editing/navigation/refactoring functions.

I then use ./compile.sh from the command line to compile - I have never tried compiling/debugging with QT Creator directly. So, I can't help you there.

You will also need to configure the editing options to fit our code style.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-05-01, 14:23

Thanks for reply face-smile.png

I tested your idea of open the CMakeLists.txt. But this would bring very much build targets and each must be enabled by hand... not a good way. But i think i get it now... i write it down here so that it could be found by anyone:

  1. get the latest trunk (see BuildingWidelands ) and make a branch (see BzrPrimer )
  2. Open qtcreator
  3. Make "New Project"
  4. Choose "Import project" and "Import existing Project"
  5. Give a name and choose the location where the branch is stored
  6. The filelist is imho ok so click "next"
  7. Optionally conigure the bazaar settings and finish
  8. Wait until the configuring is done
  9. Choose projects from the left sidebar
  10. Make following settings:
    • Build directory: Path/to/Branch/build (the "build" directory has to be created)
    • Buildstep 1:
      1. Override /usr/bin/make:: cmake
      2. Make arguments: : /path/to/branch -DCMAKE_BUILD_TYPE=Debug (the path without /build)
      3. Tagets: unmark "all"
    • add a Build step
      1. Just activate "all" in "Targets"
  11. Build the project

You will also need to configure the editing options to fit our code style.

I will take care of it face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-05-01, 15:12

That sounds really complicated!

I just open the Cmakelist.txt, let it use the default options and that's it. No further settings needed - all the library includes are defined in the Cmakelist.txt already.

I don't make a new project and then import, I open it as an existing project.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-05-01, 16:34

Yes, thats maybe a bit complicated. But it sounds more complicated as it is.

If you want to debug your currently changed code, you must run the compile.sh script again, mustn't you? I just have to press a Shortcut.

Don't know which is the more convenient way... As qtcreator supports bazaar (imho also with branches), maybe its not the badest thing to investigate qtcreator a bit more face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-05-01, 18:22

If you wish to use the debugger, definitely not a bad idea to look into it.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-05-01, 19:49

Debugging is currently the only thing i want to do face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
NotYetTakenUserName
Avatar
Joined: 2019-10-15, 18:06
Posts: 16
Ranking
Pry about Widelands
Location: right here, most of the time
Posted at: 2019-10-18, 22:24

kaputtnik wrote:

a bunch of easy tasks

  1. Make following settings:
    • Build directory: Path/to/Branch/build (the "build" directory has to be created)
    • Buildstep 1:
      1. Override /usr/bin/make:: cmake
      2. Make arguments: : /path/to/branch -DCMAKE_BUILD_TYPE=Debug (the path without /build)
      3. Tagets: unmark "all"

Worked like charm until cmake complained about line 61:

CMake Error at CMakeLists.txt:65 (message): Build directory and source directory must not be the same.

Quick fix, since I couldn't (didn't want to) figure out the root cause. right under line 8

include("${CMAKE_SOURCE_DIR}/cmake/UseSystemInfo.cmake")

add

set( CMAKE_BINARY_DIR "${CMAKE_SOURCE_DIR}/wtf" )
message(${CMAKE_SOURCE_DIR})
message(${CMAKE_BINARY_DIR})

Now they are different. Which is fine. Probably not the final solution, though.

But then I got stuck again on:

 * add a Build step
      1. Just activate "all" in "Targets"
  1. Build the project

Qt Creator 3.0.1 Based on Qt 5.2.1 (GCC 4.8.2, 64 bit) has two options. 1. Custom process step 2. make

I went for custom and used /usr/bin/cmake as command.

Currently, Qt is busy building. Let's see what we get.

Any ideas on how to make me feel even more stupid? face-wink.png

Problem was: I messed up the build directory in qt-creator. I wanted to have it in complete elsewhere away from the sources. Turned out to be a bad idea.

Edited: 2019-10-19, 12:36

It's my opinion, plus I don't share it.

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-10-25, 11:25

While I use QTCreator for working on the code, I always use our command line script for compiling and gdb for debugging. If you can figure this out, we could add instructions to the wiki.


Busy indexing nil values

Top Quote
NotYetTakenUserName
Avatar
Joined: 2019-10-15, 18:06
Posts: 16
Ranking
Pry about Widelands
Location: right here, most of the time
Posted at: 2019-10-25, 18:33

Good point! Why not using the script in creator? Should work just as well.


It's my opinion, plus I don't share it.

Top Quote