Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » ExternLibrary Stereotype(How to use an external library without specify an hard path?)
ExternLibrary Stereotype [message #1783909] Tue, 20 March 2018 10:01 Go to next message
Yoann Farré is currently offline Yoann FarréFriend
Messages: 49
Registered: November 2017
Member
Hello everyone,

I'm trying to generate C++ code from a model and I want to parametrize automatically my new CDT project. For that, I use the stereotype ExternLibrary (filling the fields "includePaths", "libPaths" and "libs" to specify the use of my own libraries) like in the documentation : https://wiki.eclipse.org/Papyrus/Codegen/Cpp_description#CDT_integration

It works fine but I have to enter hard paths (like "C:/libs"). I also use boost and in the field "libs", i just have to specify "boost_system" without indicating the path.

I would not like to indicate a hard path.

For example, I would use a plugin to store my libraries and just like boost, have to indicate only the name of the library. How could I do that?

Thank you for reading.

Yoann.



Re: ExternLibrary Stereotype [message #1784107 is a reply to message #1783909] Thu, 22 March 2018 15:41 Go to previous messageGo to next message
Ansgar Radermacher is currently online Ansgar RadermacherFriend
Messages: 159
Registered: March 2011
Location: Paris Saclay, France
Senior Member
Hi Yoann,

for #includes and libraries, you can just indicate the name of the include file/library, respectively. For instance, for the pthread library the "include" attribute contains "pthread.h" and the "libs" attribute contains just "pthread". If you need to indicate directories in which these files can be found, you need some sort of a file location. The code generator will just copy the strings, so everything that CDT supports for specifying directory locations is implicitly is supported.

A common use case might be to reference a file or library relative to the workspace. This can be done via the String "${workspace_loc:/<your project name>/...".

Hope that helps

Ansgar
Re: ExternLibrary Stereotype [message #1784164 is a reply to message #1784107] Fri, 23 March 2018 07:38 Go to previous message
Yoann Farré is currently offline Yoann FarréFriend
Messages: 49
Registered: November 2017
Member
Hi Ansgar,

Thank you for your reply and for the explanation. I finally use the option you give. At first, I hoped to use a path like "platform:/plugin/<myPluginName>/lib/..." but I noticed that this notation was not supported by CDT.

Yoann.
Previous Topic:How to represent a relationship in a model applying a profil
Next Topic:How to design n-ary relations in Papyrus
Goto Forum:
  


Current Time: Mon Sep 24 14:04:50 GMT 2018

Powered by FUDForum. Page generated in 0.02449 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top