[rkward-cvs] SF.net SVN: rkward-code:[4683] branches/development_branches/ rkward_graphpics_device/rkward/rbackend

tfry at users.sf.net tfry at users.sf.net
Wed Apr 10 18:01:12 UTC 2013


Revision: 4683
          http://sourceforge.net/p/rkward/code/4683
Author:   tfry
Date:     2013-04-10 18:01:10 +0000 (Wed, 10 Apr 2013)
Log Message:
-----------
Fix version check, and add configure-time dependendency on R >= 2.12.0

Modified Paths:
--------------
    branches/development_branches/rkward_graphpics_device/rkward/rbackend/FindR.cmake
    branches/development_branches/rkward_graphpics_device/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp

Modified: branches/development_branches/rkward_graphpics_device/rkward/rbackend/FindR.cmake
===================================================================
--- branches/development_branches/rkward_graphpics_device/rkward/rbackend/FindR.cmake	2013-04-10 12:00:54 UTC (rev 4682)
+++ branches/development_branches/rkward_graphpics_device/rkward/rbackend/FindR.cmake	2013-04-10 18:01:10 UTC (rev 4683)
@@ -18,6 +18,20 @@
 	OUTPUT_VARIABLE R_ARCH)
 MESSAGE (STATUS "R architecture is ${R_ARCH}")
 
+# check R version. Currently min R 2.12.0.
+SET (R_MIN_VERSION "2.12.0")
+MESSAGE (STATUS "Checking R version")
+EXECUTE_PROCESS(
+	COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "cat (paste(R.version$major, R.version$minor, sep='.'))"
+	OUTPUT_VARIABLE R_VERSION)
+MESSAGE (STATUS "R version is ${R_VERSION}")
+EXECUTE_PROCESS(
+	COMMAND ${R_EXECUTABLE} "--slave" "--no-save" "-e" "min_ver <- '${R_MIN_VERSION}'; if (compareVersion ('${R_VERSION}', min_ver) < 0) cat ('At least R version', min_ver, 'is required')"
+	OUTPUT_VARIABLE R_VERSION_STATUS)
+IF (R_VERSION_STATUS)
+	MESSAGE (FATAL_ERROR ${R_VERSION_STATUS})
+ENDIF (R_VERSION_STATUS)
+
 # find R_HOME
 
 MESSAGE(STATUS "Looking for R_HOME")

Modified: branches/development_branches/rkward_graphpics_device/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp
===================================================================
--- branches/development_branches/rkward_graphpics_device/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp	2013-04-10 12:00:54 UTC (rev 4682)
+++ branches/development_branches/rkward_graphpics_device/rkward/rbackend/rkwarddevice/rkgraphicsdevice_setup.cpp	2013-04-10 18:01:10 UTC (rev 4683)
@@ -35,6 +35,7 @@
 
 extern "C" {
 #include <R_ext/GraphicsEngine.h>
+#include <Rversion.h>
 }
 
 // rcolor typedef added in R 3.0.0





More information about the rkward-tracker mailing list