<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">I must admit, it's been awhile since I
      cobbled together my solution; I know it's worked seamlessly on 2
      or 3 linux variants, but hasn't been tested beyond that.<br>
      <br>
      I do recall getting frustrated with making cmake interact with
      Makevars; <br>
      <br>
      On
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <a href="http://cran.r-project.org/doc/manuals/R-exts.html">http://cran.r-project.org/doc/manuals/R-exts.html</a>,
      a configure script seems to be described as an equally respectable
      alternative to Makevars -- it sounds as though Makevars is a
      facility created to make writing extension build processes easier,
      but for those who have requirements that can't be met by Makevars,
      a configure script is a completely acceptable route.  (A plain
      Makefile I can understand cautioning against, because make as a
      tool is too limited to cover a true range of portability
      concerns).<br>
      <br>
      I do know that CMake is more than capable of covering the bases
      handled by Makevars, and would assume that as long as the correct
      include and linker flags were solicited in CMakeLists.txt things
      would work correctly.<br>
      -rd<br>
      <br>
      <br>
      On 03/05/2013 03:56 PM, Dirk Eddelbuettel wrote:<br>
    </div>
    <blockquote cite="mid:20790.27145.268066.463175@max.nulle.part"
      type="cite">
      <pre wrap="">
On 5 March 2013 at 15:44, Richard Downe wrote:
| What I've been doing the past couple years, which has worked extremely 
| well, is to use a configure script (I've used perl because it allows me 
| to do a bunch of other build-time processing that's specific to my 
| package, but bash would work fine as well).

| All you need (for perl) is:

| #!/usr/bin/perl
| chdir "src/";
| system("cmake .");
| chdir "..";
| exit(0);

| The end result is that R CMD INSTALL [your package] finds an up to date 
| makefile in src, but otherwise runs conventionally, and your package 
| gets built and installed properly.

Etienne was (very correctly) alluding to the fact the _creating your own
src/Makefile is strongly discouraged_ as e.g. repeatedly stated by Simon and
others on r-devel or here.  R's ability produce 32 and 64 bit binaries on the
OSs that support it depends criticially on its ability to write its own
Makefile, based on its stubs and the user's Makevars.

Did you by chance mean Makevars here?  Otherwise the trick is fine but for
CRAN I would expect to be met with, ahem, criticism.

Dirk

</pre>
    </blockquote>
    <br>
  </body>
</html>