0
$\begingroup$

Rosanswers logo

I am trying to compile a ROS node using OpenFOAM C++ libraries. OpenFOAM uses Wmake while ROS uses Cmake. How can I modify my CMakeLists.txt file so that the Cmake can:

  1. Find the OpenFOAM .H files recursively installed in /opt/openfoam211/src
  2. Find the pre-compiled OpenFOAM libraries (.so) also in /opt/openfoam211/platforms/linuxGccDPOpt/lib

I tried making a small Cmake script to recursively add all directories containing .H files using include_directories(). It finds all the .H files but I get the following error:

c++: error trying to exec 'usr/lib/gcc/i686-linux-gnu/4.6/cc1plus': execv: Argument list too long

I'm guessing I'm getting all the .H files making an enormous argument list.

I used target_link_libraries() for linking the libraries but I have no idea if it works since it never reaches that stage.

I'm using ROS fuerte on an Ubuntu 12.04 VM on Mac OS X Lion.

Thanks in advance!!!


Originally posted by Gonçalo Cabrita on ROS Answers with karma: 591 on 2012-06-14

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I'd suggest that you look at using OpenFoam after installing it. To use it from within CMake you need to either have a CMake FindPackage file for it or a pkg-config file for it.

When it's installed, hopefully the includes are put into less distributed locations, so it's easier to write the above macros.


Originally posted by tfoote with karma: 58457 on 2013-01-04

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.