Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [4diac-dev] Exported functionblock files and CMakeLists.txt

Hi,

I really like the idea of automating this phase. Maybe a middle point could be to have the contents of this CMakeLists.txt file as a CMake function in forte. Then in the IDE you could have the option to export the CMakeLists.txt file for a module (together with the Function Block exporter, or as a standalone, and warning of overwriting) and the user just needs to set the name of the Module (if not provided, maybe like you did, take it from the folder name). 

The exported CMakeLists.txt will call the function you created, basically adding all the .cpp and .h files. 

If the module needs extra CMake commands (adding libraries, setting variables, ...), the user will just edit the generated file once (leaving the call to your function). The next time that more function blocks are exported to the module, the CMakeLists.txt doesn't need to be exported anymore, and since your function includes all .cpp and .h files, nothing else needs to be done. 

One suggestion: I think it will be better to use forte_add_sourcefile_h, forte_add_sourcefile_c and forte_add_sourcefile_cpp instead of forte_add_sourcefile_hcpp, so the function will include all compilable files in the folder, and you can just drop files to the folder and they will be compiled. 

Regards,

Jose Cabral

-- 
fortiss · Landesforschungsinstitut des Freistaats Bayern
An-Institut Technische Universität München
Guerickestraße 25 
80805 München
Germany
Tel.: +49 (89) 3603522 529
Fax: +49 (89) 3603522 50 
E-Mail: cabral@xxxxxxxxxxx
https://www.fortiss.org/

Amtsgericht München: HRB: 176633
USt-IdNr.: DE263907002, Steuer-Nr.: 143/237/25900
Rechtsform: gemeinnützige GmbH
Sitz der Gesellschaft: München
Geschäftsführer: Dr. Harald Rueß, Thomas Vallon
Vorsitzender des Aufsichtsrats: Dr. Manfred Wolter

> -----Ursprüngliche Nachricht-----
> Von: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx> Im
> Auftrag von Jörg Walter
> Gesendet: Mittwoch, 17. Juni 2020 22:33
> An: 4diac-dev@xxxxxxxxxxx
> Betreff: Re: [4diac-dev] Exported functionblock files and CMakeLists.txt
> 
> On 17.06.20 20:11, Ernst Blecha wrote:
> > The attached file is almost a drop-in-and-forget CMakeList.txt. It
> > takes the directory name as a module name, and adds all .cpp and .h
> > files for compilation. There are still some rough edges (e.g. the
> > description field does not get updated when the file-list changes,
> > automatic regeneration of cmake-files might be problematic,...)
> >
> >
> > Now i wonder: Has anyone come up with a better solution? Is anybody
> > interested in such a solution? Does this break with someones setup?
> 
> There is a contribution in the pipeline at our end that can manage the entire
> build process. We use something very similar for this particular aspect of the
> build process.
> 
> In my experience, such a generic CMakeFile is not usable as-is, since many
> modules will have special build dependencies (libraries etc.). For that reason,
> I prefer a slightly simpler variant that does not autodetect the module name,
> simply for the reason that less code makes the CMakeLists file easier to
> customize.
> 
> Regards,
> --
> Dipl.-Inform. Jörg Walter
> Senior Researcher
> R&D Group Distributed Computation and Communication
> 
> OFFIS e.V. - Institut für Informatik
> FuE Bereich Produktion | R&D Division Manufacturing Escherweg 2, 26121
> Oldenburg - Germany
> Phone/Fax.: +49 441 9722-729 / -282
> E-Mail: joerg.walter@xxxxxxxx
> URL: http://www.offis.de
> 
> Registergericht: Amtsgericht Oldenburg VR 1956
> Vorstand: Prof. Dr. Sebastian Lehnhoff (Vorsitzender),
>      Prof. Dr. techn. Susanne Boll-Westermann, Prof. Dr.-Ing. Axel Hahn,
>      Prof. Dr.-Ing. Andreas Hein, Prof. Dr.-Ing. Wolfgang H. Nebel
> _______________________________________________
> 4diac-dev mailing list
> 4diac-dev@xxxxxxxxxxx
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/4diac-dev

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Back to the top