Quantcast

YARPConfig.cmake blues

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

YARPConfig.cmake blues

Miguel Sarabia del Castillo
Hello!

We've been trying to compile a simple program against YARP but
encountered a few CMake errors...

Using the latest version of yarp (we've just pulled) and we do the
following:

     [...]
     find_package(YARP REQUIRED)
     [...]
     include_directories(${YARP_INCLUDE_DIRS})
     add_executable( test ${SRCS})
     target_link_libraries( test ${YARP_LIBRARIES})

which yields several linking errors ("cannot find -lYARP::YARP_OS" and
such). If we ask cmake to print the contents of YARP_LIBRARIES with:

     message(STATUS ${YARP_LIBRARIES})

we obtain:
     --
YARP::YARP_OSYARP::YARP_sigYARP::YARP_mathYARP::YARP_devYARP::YARP_nameYARP::YARP_init

I've never seen that sort of namespacing in cmake before, but in any
case /usr/local/lib/libYARP::YARP_OS.* does not exist on our system.

We've gone to /usr/local/lib/YARP/YARPConfig.cmake and found this line:

     if(NOT YARP_FOUND)
         # Give the details of YARP libraries, include path etc.
         set(YARP_LIBRARIES
"YARP::YARP_OS;YARP::YARP_sig;YARP::YARP_math;YARP::YARP_dev;YARP::YARP_name;YARP::YARP_init")
         set(YARP_INCLUDE_DIRS "/usr/local/include")
         set(YARP_LINK_DIRS "") # only needed with certain plugins
         set(YARP_DEFINES "-D_REENTRANT") # only needed if you use ACE
directly
set(YARP_BINDINGS "/usr/local/share/yarp/bindings")
         [...]


Could this be a bug in the generation of YARPConfig.cmake?? Or is there
anything wrong with the calls above in our CMakeLists.txt?

Thanks!
Miguel S.

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: YARPConfig.cmake blues

paulfitz
Administrator
Hi Miguel,

You can see some background on the relevant change in YARP here:
   https://github.com/robotology/yarp/pull/153

Your code looks correct, and the value of YARP_LIBRARIES looks correct,
and the fragment of YARPConfig.cmake looks correct.  The only odd thing
is that CMake doesn't seem to recognize the targets.  Trying your setup
locally is working for me.  Daniele knows more about this stuff, any
ideas Daniele?  Miguel, could you open an issue on this and report what
version of CMake you are using?
   https://github.com/robotology/yarp/issues/new

Thanks,
Paul

On 04/11/2014 06:58 PM, Miguel Sarabia del Castillo wrote:

> Hello!
>
> We've been trying to compile a simple program against YARP but
> encountered a few CMake errors...
>
> Using the latest version of yarp (we've just pulled) and we do the
> following:
>
>       [...]
>       find_package(YARP REQUIRED)
>       [...]
>       include_directories(${YARP_INCLUDE_DIRS})
>       add_executable( test ${SRCS})
>       target_link_libraries( test ${YARP_LIBRARIES})
>
> which yields several linking errors ("cannot find -lYARP::YARP_OS" and
> such). If we ask cmake to print the contents of YARP_LIBRARIES with:
>
>       message(STATUS ${YARP_LIBRARIES})
>
> we obtain:
>       --
> YARP::YARP_OSYARP::YARP_sigYARP::YARP_mathYARP::YARP_devYARP::YARP_nameYARP::YARP_init
>
> I've never seen that sort of namespacing in cmake before, but in any
> case /usr/local/lib/libYARP::YARP_OS.* does not exist on our system.
>
> We've gone to /usr/local/lib/YARP/YARPConfig.cmake and found this line:
>
>       if(NOT YARP_FOUND)
>           # Give the details of YARP libraries, include path etc.
>           set(YARP_LIBRARIES
> "YARP::YARP_OS;YARP::YARP_sig;YARP::YARP_math;YARP::YARP_dev;YARP::YARP_name;YARP::YARP_init")
>           set(YARP_INCLUDE_DIRS "/usr/local/include")
>           set(YARP_LINK_DIRS "") # only needed with certain plugins
>           set(YARP_DEFINES "-D_REENTRANT") # only needed if you use ACE
> directly
> set(YARP_BINDINGS "/usr/local/share/yarp/bindings")
>           [...]
>
>
> Could this be a bug in the generation of YARPConfig.cmake?? Or is there
> anything wrong with the calls above in our CMakeLists.txt?
>
> Thanks!
> Miguel S.
>
> ------------------------------------------------------------------------------
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
> _______________________________________________
> Robotcub-hackers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers


------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: YARPConfig.cmake blues

Daniele E. Domenichelli
‎Hello Miguel,

I've seen this a couple of times already... You are probably installing YARP without uninstalling it. Please check if you have some folder <install prefix>/lib/YARP-<version> and delete all of them, they are leftover from previous make install and sometimes cmake can find the wrong one. Leave just the unversioned folder, and try again‎.

Let me know if this fixes your issue.

We recently changed it in ‎YARP to use the unversioned folder, but you have to fix it manually on your system. Anyway, as a general suggestion, when you build and install software, you should always run make uninstall before installing it over the first installation.

Cheers,
 Daniele

  Original Message
From: Paul Fitzpatrick
Sent: venerdì 11 aprile 2014 19:56
To: Miguel Sarabia del Castillo
Cc: [hidden email]; [hidden email]; Daniele Domenichelli
Subject: Re: [rc-hackers] YARPConfig.cmake blues


Hi Miguel,

You can see some background on the relevant change in YARP here:
   https://github.com/robotology/yarp/pull/153

Your code looks correct, and the value of YARP_LIBRARIES looks correct,
and the fragment of YARPConfig.cmake looks correct.  The only odd thing
is that CMake doesn't seem to recognize the targets.  Trying your setup
locally is working for me.  Daniele knows more about this stuff, any
ideas Daniele?  Miguel, could you open an issue on this and report what
version of CMake you are using?
   https://github.com/robotology/yarp/issues/new

Thanks,
Paul

On 04/11/2014 06:58 PM, Miguel Sarabia del Castillo wrote:

> Hello!
>
> We've been trying to compile a simple program against YARP but
> encountered a few CMake errors...
>
> Using the latest version of yarp (we've just pulled) and we do the
> following:
>
>       [...]
>       find_package(YARP REQUIRED)
>       [...]
>       include_directories(${YARP_INCLUDE_DIRS})
>       add_executable( test ${SRCS})
>       target_link_libraries( test ${YARP_LIBRARIES})
>
> which yields several linking errors ("cannot find -lYARP::YARP_OS" and
> such). If we ask cmake to print the contents of YARP_LIBRARIES with:
>
>       message(STATUS ${YARP_LIBRARIES})
>
> we obtain:
>       --
> YARP::YARP_OSYARP::YARP_sigYARP::YARP_mathYARP::YARP_devYARP::YARP_nameYARP::YARP_init
>
> I've never seen that sort of namespacing in cmake before, but in any
> case /usr/local/lib/libYARP::YARP_OS.* does not exist on our system.
>
> We've gone to /usr/local/lib/YARP/YARPConfig.cmake and found this line:
>
>       if(NOT YARP_FOUND)
>           # Give the details of YARP libraries, include path etc.
>           set(YARP_LIBRARIES
> "YARP::YARP_OS;YARP::YARP_sig;YARP::YARP_math;YARP::YARP_dev;YARP::YARP_name;YARP::YARP_init")
>           set(YARP_INCLUDE_DIRS "/usr/local/include")
>           set(YARP_LINK_DIRS "") # only needed with certain plugins
>           set(YARP_DEFINES "-D_REENTRANT") # only needed if you use ACE
> directly
> set(YARP_BINDINGS "/usr/local/share/yarp/bindings")
>           [...]
>
>
> Could this be a bug in the generation of YARPConfig.cmake?? Or is there
> anything wrong with the calls above in our CMakeLists.txt?
>
> Thanks!
> Miguel S.
>
> ------------------------------------------------------------------------------
> Put Bad Developers to Shame
> Dominate Development with Jenkins Continuous Integration
> Continuously Automate Build, Test & Deployment
> Start a new project now. Try Jenkins in the cloud.
> http://p.sf.net/sfu/13600_Cloudbees
> _______________________________________________
> Robotcub-hackers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/robotcub-hackers

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Loading...