<div dir="ltr">Thanks.<div><br></div><div>Here's what I came up with:</div><div><br></div><div><div>Sys.setenv(R_TESTS = "")</div><div><br></div><div>wd = getwd()</div><div>wd = sub(".tests.testthat$", "", wd)</div><div>ipath1 = file.path(wd, "inst", "include")</div><div>ipath2 = file.path(wd, "include")</div><div>Sys.setenv(PKG_CXXFLAGS = paste(paste0("-I", ipath1), paste0("-I", ipath2)))</div></div><div><br></div><div>That works sometimes, but not always. It seems to pass R CMD check --as-cran (still need to run on devel release), so that's what I needed. But oddly it fails on apveyor and <a href="http://travis.ci">travis.ci</a>. As far as I can tell, you cannot have any confidence in the current working directory using testthat in different environments.</div><div><br></div><div>THK</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><a href="http://www.keittlab.org/" target="_blank">http://www.keittlab.org/</a></div></div></div>
<br><div class="gmail_quote">On Wed, Feb 1, 2017 at 1:13 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 1 February 2017 at 13:01, Tim Keitt wrote:<br>
| Is there a way to add an additional include path when calling sourceCpp? I am<br>
| trying to get it to find "inst/include" in my package because I am calling<br>
| sourceCpp during testing with testthat.<br>
<br>
Sys.setenv() on the variables make and everything it calls.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
______________________________<wbr>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-<wbr>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/rcpp-devel</a><br>
</font></span></blockquote></div><br></div>