[rkward-cvs] SF.net SVN: rkward:[2545] trunk/rkward/rkward/rbackend/FindR.cmake

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Jun 24 12:27:55 UTC 2009


Revision: 2545
          http://rkward.svn.sourceforge.net/rkward/?rev=2545&view=rev
Author:   tfry
Date:     2009-06-24 12:27:55 +0000 (Wed, 24 Jun 2009)

Log Message:
-----------
Workaround for the problem detecting R_INCLUDE_DIR, reported by Meik Michalke

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/FindR.cmake

Modified: trunk/rkward/rkward/rbackend/FindR.cmake
===================================================================
--- trunk/rkward/rkward/rbackend/FindR.cmake	2009-06-24 12:16:44 UTC (rev 2544)
+++ trunk/rkward/rkward/rbackend/FindR.cmake	2009-06-24 12:27:55 UTC (rev 2545)
@@ -32,9 +32,15 @@
 
 MESSAGE(STATUS "Looking for R include files")
 IF(NOT R_INCLUDEDIR)
-	EXECUTE_PROCESS(
-		COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
-		OUTPUT_VARIABLE R_INCLUDEDIR)
+	IF(WIN32)	# This version of the test will not work with R < 2.9.0, but the other version (in the else part) will not work on windows (and on windows the paths are generally standard, anyway).
+		EXECUTE_PROCESS(
+			COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
+			OUTPUT_VARIABLE R_INCLUDEDIR)
+	ELSE(WIN32)
+		EXECUTE_PROCESS(
+			COMMAND ${R_EXECUTABLE} CMD sh -c "echo -n $R_INCLUDE_DIR"
+			OUTPUT_VARIABLE R_INCLUDEDIR)
+	ENDIF(WIN32)
 ELSE(NOT R_INCLUDEDIR)
 	MESSAGE(STATUS "Location specified by user")
 ENDIF(NOT R_INCLUDEDIR)


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