use pkgconfig to detect orocos-rtt-corba-flavor

Hi,

in attachment a patch to detect the installation of an orocos-rtt-corba-flavor
using pkgconfig instead of the existence of some rtt-corba header:

Ruben

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> Hi,
>
> in attachment a patch to detect the installation of an
> orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
> rtt-corba header:

+ IF(OROCOS_CORBA_TARGET STREQUAL "${FLAVOR_TARGET}")
+ MESSAGE( "Detected CORBA build for ${OROCOS_TARGET}" )
+ PKGCONFIG("orocos-rtt-${FLAVOR_TARGET}" CORBA_ENABLED
OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
OROCOS_RTT_LIBS )
+ MESSAGE(" Includes in: ${OROCOS_RTT_INCLUDE_DIRS}")
+ MESSAGE(" Libraries in: ${OROCOS_RTT_LINK_DIRS}")
+ MESSAGE(" Libraries: ${OROCOS_RTT_LIBS}")
+ MESSAGE(" Defines: ${OROCOS_RTT_DEFINES}")
+
+ INCLUDE_DIRECTORIES( ${OROCOS_RTT_INCLUDE_DIRS} )
+ LINK_DIRECTORIES( ${OROCOS_RTT_LINK_DIRS} )
+ ADD_DEFINITIONS( ${OROCOS_RTT_DEFINES} )

Shouldn't that read
PKGCONFIG("orocos-rtt-corba-${FLAVOR_TARGET}" CORBA_ENABLED
OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
OROCOS_RTT_LIBS )

?
Peter

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday 08 May 2008 15:05:59 Peter Soetens wrote:
> On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> > Hi,
> >
> > in attachment a patch to detect the installation of an
> > orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
> > rtt-corba header:
>
> + IF(OROCOS_CORBA_TARGET STREQUAL "${FLAVOR_TARGET}")
> + MESSAGE( "Detected CORBA build for ${OROCOS_TARGET}" )
> + PKGCONFIG("orocos-rtt-${FLAVOR_TARGET}" CORBA_ENABLED
> OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
> OROCOS_RTT_LIBS )
> + MESSAGE(" Includes in: ${OROCOS_RTT_INCLUDE_DIRS}")
> + MESSAGE(" Libraries in: ${OROCOS_RTT_LINK_DIRS}")
> + MESSAGE(" Libraries: ${OROCOS_RTT_LIBS}")
> + MESSAGE(" Defines: ${OROCOS_RTT_DEFINES}")
> +
> + INCLUDE_DIRECTORIES( ${OROCOS_RTT_INCLUDE_DIRS} )
> + LINK_DIRECTORIES( ${OROCOS_RTT_LINK_DIRS} )
> + ADD_DEFINITIONS( ${OROCOS_RTT_DEFINES} )
>
> Shouldn't that read
> PKGCONFIG("orocos-rtt-corba-${FLAVOR_TARGET}" CORBA_ENABLED
> OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
> OROCOS_RTT_LIBS )

That would be unacceptable anyway. Only the 'corba' deployers may link with
corba libraries. All other components don't link with TAO in any way. So I
clearly don't understand how this patch can work...

Peter

Ruben Smits's picture

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday May 8 2008 15:21:25 Peter Soetens wrote:
> On Thursday 08 May 2008 15:05:59 Peter Soetens wrote:
> > On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> > > Hi,
> > >
> > > in attachment a patch to detect the installation of an
> > > orocos-rtt-corba-flavor using pkgconfig instead of the existence of
> > > some rtt-corba header:
> >
> > + IF(OROCOS_CORBA_TARGET STREQUAL "${FLAVOR_TARGET}")
> > + MESSAGE( "Detected CORBA build for ${OROCOS_TARGET}" )
> > + PKGCONFIG("orocos-rtt-${FLAVOR_TARGET}" CORBA_ENABLED
> > OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
> > OROCOS_RTT_LIBS )
> > + MESSAGE(" Includes in: ${OROCOS_RTT_INCLUDE_DIRS}")
> > + MESSAGE(" Libraries in: ${OROCOS_RTT_LINK_DIRS}")
> > + MESSAGE(" Libraries: ${OROCOS_RTT_LIBS}")
> > + MESSAGE(" Defines: ${OROCOS_RTT_DEFINES}")
> > +
> > + INCLUDE_DIRECTORIES( ${OROCOS_RTT_INCLUDE_DIRS} )
> > + LINK_DIRECTORIES( ${OROCOS_RTT_LINK_DIRS} )
> > + ADD_DEFINITIONS( ${OROCOS_RTT_DEFINES} )
> >
> > Shouldn't that read
> > PKGCONFIG("orocos-rtt-corba-${FLAVOR_TARGET}" CORBA_ENABLED
> > OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
> > OROCOS_RTT_LIBS )
>
> That would be unacceptable anyway. Only the 'corba' deployers may link with
> corba libraries. All other components don't link with TAO in any way. So I
> clearly don't understand how this patch can work...

can you please look at the new patch, and i do not see where i link all
components with the corba libraries.

Ruben

Ruben Smits's picture

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday May 8 2008 15:05:59 Peter Soetens wrote:
> On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> > Hi,
> >
> > in attachment a patch to detect the installation of an
> > orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
> > rtt-corba header:
>
> + IF(OROCOS_CORBA_TARGET STREQUAL "${FLAVOR_TARGET}")
> + MESSAGE( "Detected CORBA build for ${OROCOS_TARGET}" )
> + PKGCONFIG("orocos-rtt-${FLAVOR_TARGET}" CORBA_ENABLED
> OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
> OROCOS_RTT_LIBS )
> + MESSAGE(" Includes in: ${OROCOS_RTT_INCLUDE_DIRS}")
> + MESSAGE(" Libraries in: ${OROCOS_RTT_LINK_DIRS}")
> + MESSAGE(" Libraries: ${OROCOS_RTT_LIBS}")
> + MESSAGE(" Defines: ${OROCOS_RTT_DEFINES}")
> +
> + INCLUDE_DIRECTORIES( ${OROCOS_RTT_INCLUDE_DIRS} )
> + LINK_DIRECTORIES( ${OROCOS_RTT_LINK_DIRS} )
> + ADD_DEFINITIONS( ${OROCOS_RTT_DEFINES} )
>
> Shouldn't that read
> PKGCONFIG("orocos-rtt-corba-${FLAVOR_TARGET}" CORBA_ENABLED
> OROCOS_RTT_INCLUDE_DIRS OROCOS_RTT_DEFINES OROCOS_RTT_LINK_DIRS
> OROCOS_RTT_LIBS )

No since the orocos-rtt-corba-${orocos_target} are also in
${orocos_rtt_flavors}, it should be if only the orocos-rtt-${orocos_targets}
where in ${orocos_rtt_flavors}.

Ruben

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> Hi,
>
> in attachment a patch to detect the installation of an
> orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
> rtt-corba header:

It seems you've been using tabs instead of spaces. That should really be
avoided. The coding rules state this clearly. Are you using the emacs
indent-tabs-mode ?

I have this snippet in my .emacs file:

(defun my-c++-pars()
(setq tab-width 4)
(setq c-basic-offset 4)
(setq indent-tabs-mode nil))

(add-hook 'c++-mode-hook 'my-c++-pars)

(defun my-c-pars()
(setq tab-width 4)
(setq c-basic-offset 4)
(setq indent-tabs-mode nil))

(add-hook 'c-mode-hook 'my-c-pars)

Peter

Ruben Smits's picture

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday May 8 2008 14:34:55 Peter Soetens wrote:
> On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> > Hi,
> >
> > in attachment a patch to detect the installation of an
> > orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
> > rtt-corba header:
>
> It seems you've been using tabs instead of spaces. That should really be
> avoided. The coding rules state this clearly. Are you using the emacs
> indent-tabs-mode ?
>
> I have this snippet in my .emacs file:
>
> (defun my-c++-pars()
> (setq tab-width 4)
> (setq c-basic-offset 4)
> (setq indent-tabs-mode nil))
>
> (add-hook 'c++-mode-hook 'my-c++-pars)
>
> (defun my-c-pars()
> (setq tab-width 4)
> (setq c-basic-offset 4)
> (setq indent-tabs-mode nil))
>
> (add-hook 'c-mode-hook 'my-c-pars)

i have the exact same snippet, but apparently the (setq indent-tabs-mode nil)
is not used in emacs CMAKE-mode.

In attachement a new patch
Ruben

> Peter
>
> --
> Peter Soetens -- FMTC --

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

use pkgconfig to detect orocos-rtt-corba-flavor

On Thursday 08 May 2008 14:56:58 Ruben Smits wrote:
> On Thursday May 8 2008 14:34:55 Peter Soetens wrote:
> > On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
> > > Hi,
> > >
> > > in attachment a patch to detect the installation of an
> > > orocos-rtt-corba-flavor using pkgconfig instead of the existence of
> > > some rtt-corba header:
> >
> > It seems you've been using tabs instead of spaces. That should really be
> > avoided. The coding rules state this clearly. Are you using the emacs
> > indent-tabs-mode ?
> >
> > I have this snippet in my .emacs file:
> >
> > (defun my-c++-pars()
> > (setq tab-width 4)
> > (setq c-basic-offset 4)
> > (setq indent-tabs-mode nil))
> >
> > (add-hook 'c++-mode-hook 'my-c++-pars)
> >
> > (defun my-c-pars()
> > (setq tab-width 4)
> > (setq c-basic-offset 4)
> > (setq indent-tabs-mode nil))
> >
> > (add-hook 'c-mode-hook 'my-c-pars)
>
> i have the exact same snippet, but apparently the (setq indent-tabs-mode
> nil) is not used in emacs CMAKE-mode.

You're right. It seems the original CMakefiles are also full of tabs. So
nevermind my jammering.

>
> In attachement a new patch

Ok. Looks much better. This is what I wanted to see. You'll only have to adapt
the link directives in the bin/ dir then. Do you commit it ?

Thanks for cleaning this up,
Peter

use pkgconfig to detect orocos-rtt-corba-flavor

On Thu, 8 May 2008, Ruben Smits wrote:
> On Thursday May 8 2008 14:34:55 Peter Soetens wrote:
>> On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
>>> Hi,
>>>
>>> in attachment a patch to detect the installation of an
>>> orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
>>> rtt-corba header:
>>
>> It seems you've been using tabs instead of spaces. That should really be
>> avoided. The coding rules state this clearly. Are you using the emacs
>> indent-tabs-mode ?
>>
>> I have this snippet in my .emacs file:
>>
>> (defun my-c++-pars()
>> (setq tab-width 4)
>> (setq c-basic-offset 4)
>> (setq indent-tabs-mode nil))
>>
>> (add-hook 'c++-mode-hook 'my-c++-pars)
>>
>> (defun my-c-pars()
>> (setq tab-width 4)
>> (setq c-basic-offset 4)
>> (setq indent-tabs-mode nil))
>>
>> (add-hook 'c-mode-hook 'my-c-pars)
>
> i have the exact same snippet, but apparently the (setq indent-tabs-mode nil)
> is not used in emacs CMAKE-mode.

(defun my-cmake-pars()
(setq indent-tabs-mode nil))
(add-hook 'cmake-mode-hook 'my-cmake-pars)

use pkgconfig to detect orocos-rtt-corba-flavor

On Thu, 8 May 2008, Peter Soetens wrote:
> On Thursday 08 May 2008 14:12:24 Ruben Smits wrote:
>> Hi,
>>
>> in attachment a patch to detect the installation of an
>> orocos-rtt-corba-flavor using pkgconfig instead of the existence of some
>> rtt-corba header:
>
> It seems you've been using tabs instead of spaces. That should really be
> avoided. The coding rules state this clearly. Are you using the emacs
> indent-tabs-mode ?
>
> I have this snippet in my .emacs file:
>
> (defun my-c++-pars()
> (setq tab-width 4)
> (setq c-basic-offset 4)
> (setq indent-tabs-mode nil))
>
> (add-hook 'c++-mode-hook 'my-c++-pars)
>
> (defun my-c-pars()
> (setq tab-width 4)
> (setq c-basic-offset 4)
> (setq indent-tabs-mode nil))
>
> (add-hook 'c-mode-hook 'my-c-pars)

Some of us *do* write *non*-orocos code too :-), so here is my solution (c++ only)

(defun orocos-mode()
"C++ mode with adjusted defaults for use with orocos."
(interactive)
(c++-mode)
(setq tab-width 4)
(setq c-basic-offset 4)
(setq indent-tabs-mode nil))
(add-hook 'orocos-mode-common-hook
'(lambda ()
(abbrev-mode 1)
(auto-fill-mode 1)
(hide-ifdef-mode 1))
)