CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Use CMake/QtCreator to edit OpenFOAM applications

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By hannes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 27, 2019, 18:30
Default Use CMake/QtCreator to edit OpenFOAM applications
  #1
Senior Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18
hannes is on a distinguished road
Dear OpenFOAM programmers,

I just wanted to extend some OpenFOAM applications and do this in an comfortable way using QtCreator.
Though there are some instructions how to create the required CMakeLists.txt, I wanted to automate the process a little bit. I created a script to generate a CMakeLists.txt from an existing wmake "Make"-directory.
Not very sophisticated yet, but perhaps useful for somebody:

https://github.com/hkroeger/wmake2cmake

Regards, Hannes
wyldckat and Rvadrabade like this.
__________________
silentdynamics GmbH - http://silentdynamics.de
open source CAE software solutions & support
hannes is offline   Reply With Quote

Old   July 30, 2019, 08:19
Default
  #2
Member
 
Andrew Coughtrie
Join Date: May 2011
Posts: 51
Rep Power: 15
Andrew.Coughtrie is on a distinguished road
Interesting but with qtcreator you can just use a custom build step and put wmake or an Allwmake script, this is what I use.

What would be more useful i think would be a way to generate the .includes file qtcreator uses for autocomplete and code highlighting.
Andrew.Coughtrie is offline   Reply With Quote

Old   July 30, 2019, 09:51
Default
  #3
Senior Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18
hannes is on a distinguished road
Hi Andrew,

using the autocompletion feature was exactly the motivation.

When the CMakeLists.txt is created, you can just open it with File > "Open File or Project" and autocompletion should work (at least it did for me) because all include paths are inserted into the CMake config file.

There is unfortunately a little drawback: if you edit the code snippets that are included in executables (like "createFields.H"), the symbols are not recognised.

Regards, HK
__________________
silentdynamics GmbH - http://silentdynamics.de
open source CAE software solutions & support
hannes is offline   Reply With Quote

Old   August 3, 2019, 13:42
Default
  #4
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
I don't know if this is relevant or not but, As you might have heard Qt is moving away from qmake in favor of CMake.

Source: This link
anon_q is offline   Reply With Quote

Old   August 3, 2019, 13:49
Default
  #5
Senior Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 124
Rep Power: 18
hannes is on a distinguished road
Hi Evren,

I did not know, thanks for the info.

It makes sense to me, as CMake is very versatile and powerful and it makes probably little sense to maintain one's own build system.

I think it would make sense as well for OpenFOAM to drop wmake and switch to CMake...
__________________
silentdynamics GmbH - http://silentdynamics.de
open source CAE software solutions & support
hannes is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 06:40
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 04:18
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 06:56
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25


All times are GMT -4. The time now is 13:21.