<div dir="ltr"><div>I'd like to use a PCL algorithm inside R and they provide a CMakeLists.txt for configuration. I haven't found how to directly use the CMakeLists.txt in building R package, however when I run `make .` form src, I can generate a Makefile  that nearly works with `R CMD INSTALL --no-multiarch`.<br>
<br></div><div>It does compile correctly my .cpp, however I get <br>`Error in library.dynam(lib, package, package.lib) :  shared object ‘my_package.so’ not found`<br></div><div><br></div>Here's the CMakeFileLists.txt :<br>
```<br>cmake_minimum_required(VERSION 2.8 FATAL_ERROR)<br><br>find_package(PCL 1.6 REQUIRED)<br><br>set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")<br><br>include_directories(${PCL_INCLUDE_DIRS})<br>
link_directories(${PCL_LIBRARY_DIRS})<br>add_definitions(${PCL_DEFINITIONS})<br><br>add_executable (segmentation segmentation.cpp)<br>target_link_libraries (segmentation ${PCL_LIBRARIES})<br>```<br><div>I've seen that using a makefile wasn't the best practice [1] (I should move it to makevars). Since my CMakeFileLists is apparently simple (e.g. compared to RInside examples), I guess I could move it to makevars however I'm not familiar with cmake nor makevars, so I was wondering if there was documentation about translating from one to the other. However I'm absolutely not sure this is the real problem (using the CMakeLists.txt).<br>
</div><div><br></div><div>(I'm using R version 2.15.2 (2012-10-26) on  x86_64-pc-linux-gnu (64-bit), building from RStudio.)<br></div><div><br></div><div>Etienne<br><br>[1]: <a href="http://stackoverflow.com/questions/12976036/how-to-use-usedynlib-correctly-in-an-r-package-namespace-file">http://stackoverflow.com/questions/12976036/how-to-use-usedynlib-correctly-in-an-r-package-namespace-file</a><br>
</div><div><br><br></div></div>