The following is still work in progress, but I think I am on the right track. I started with the following (standard) directory structure, in which I want to include a git c++ project:
+---src
+---main
+---c++
+---java
Because I do not want to change the directory structure of the original make project, I needed to define the custom source directory and a custom include directory. This is the resulting directory structure after a pull (I left out irrelevant file structures):
+---src
+---main
+---c++
+---data
+--- ...
+---examples
+--- ...
+---scripts
+--- ...
+---src
+---hunalign
+--- ... (source files)
+---include
+--- ... (header files)
+---utils
+--- ... (helper classes)
+---tools
+--- ...
With the following configuration I got the project compiled.
<build>
<plugins>
<plugin>
<artifactId>maven-nar-plugin</artifactId>
<version>2.1-SNAPSHOT</version>
<extensions>true</extensions>
<configuration>
<libraries>
<library>
<type>executable</type>
<run>true</run>
</library>
</libraries>
<!-- Here is the config for the custom source dir and includes -->
<cpp>
<sourceDirectory>
${basedir}/src/main/c++/src/hunalign
</sourceDirectory>
<includes>
<include>${basedir}/src/main/c++/src/include/*.h</include>
</includes>
</cpp>
<libraries>
<library>
<type>executable</type>
<run>true</run>
</library>
</libraries>
</configuration>
</plugin>
</plugins>
</build>
EDIT: to make javah run properly, I had to symlink it, as maven kept looking in the wrong place for it:
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/bin/javah /Library/Java/JavaVirtualMachines/jdk1.7.0_13.jdk/Contents/Home/jre/bin/javah