[rkward-cvs] SF.net SVN: rkward:[2506] trunk/rkward/rkward/rbackend/FindR.cmake
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Thu May 28 10:26:07 UTC 2009
Revision: 2506
http://rkward.svn.sourceforge.net/rkward/?rev=2506&view=rev
Author: tfry
Date: 2009-05-28 10:26:07 +0000 (Thu, 28 May 2009)
Log Message:
-----------
FindR.cmake should finally work on windows, as well (and hopefully it is still correct...)
Modified Paths:
--------------
trunk/rkward/rkward/rbackend/FindR.cmake
Modified: trunk/rkward/rkward/rbackend/FindR.cmake
===================================================================
--- trunk/rkward/rkward/rbackend/FindR.cmake 2009-05-27 11:23:48 UTC (rev 2505)
+++ trunk/rkward/rkward/rbackend/FindR.cmake 2009-05-28 10:26:07 UTC (rev 2506)
@@ -110,11 +110,17 @@
ENDIF(NOT LIBR_BLAS)
# find R package library location
+IF(WIN32)
+ SET(PATH_SEP ";")
+ELSE(WIN32)
+ SET(PATH_SEP ":")
+ENDIF(WIN32)
MESSAGE(STATUS "Checking for R package library location to use")
IF(NOT R_LIBDIR)
- EXEC_PROGRAM(${R_EXECUTABLE}
- ARGS CMD sh -c 'echo $R_LIBS:$R_LIBS_SITE'
+ EXECUTE_PROCESS(
+ COMMAND echo "cat(paste(unique (c(.Library.site, .Library)), collapse='${PATH_SEP}'))"
+ COMMAND ${R_EXECUTABLE} "--slave" "--no-save"
OUTPUT_VARIABLE R_LIBDIR)
ELSE(NOT R_LIBDIR)
MESSAGE(STATUS "Location specified by user")
@@ -126,17 +132,17 @@
"${R_LIBDIR}")
# strip leading colon(s)
-STRING(REGEX REPLACE "^:+"
+STRING(REGEX REPLACE "^${PATH_SEP}+"
"" R_LIBDIR
"${R_LIBDIR}")
# strip trailing colon(s)
-STRING(REGEX REPLACE ":+$"
+STRING(REGEX REPLACE "${PATH_SEP}+$"
"" R_LIBDIR
"${R_LIBDIR}")
# find first path
-STRING(REGEX REPLACE ":"
+STRING(REGEX REPLACE "${PATH_SEP}"
" " R_LIBDIR
"${R_LIBDIR}")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list