Commit e4895cee authored by Stefan Gerlach's avatar Stefan Gerlach
Browse files

Improve finding R and disable rserver on Windows (not supported yet)

parent 82de207e
Pipeline #62959 passed with stage
in 24 minutes and 49 seconds
......@@ -23,6 +23,14 @@ IF(R_EXECUTABLE)
MESSAGE(STATUS "Could NOT determine R_HOME (probably you misspecified the location of R)")
ENDIF(NOT R_HOME)
IF(WIN32)
# remove R.bat header from R_HOME
STRING(REGEX REPLACE ".*\n" "" R_HOME "${R_HOME}")
# search for correct exe in R_HOME (R.bat is not working)
unset(R_EXECUTABLE CACHE)
FIND_PROGRAM(R_EXECUTABLE R HINTS ${R_HOME}/bin ${R_HOME}/bin/x64)
ENDIF()
# find R include dir
IF(NOT R_INCLUDE_DIR)
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).
......@@ -45,11 +53,6 @@ IF(R_EXECUTABLE)
# check for existence of libR.so/R.dll
IF(WIN32)
# remove R.bat header from R_HOME
STRING(REGEX REPLACE ".*\n" "" R_HOME "${R_HOME}")
# search for correct exe in R_HOME (R.bat is not working)
unset(R_EXECUTABLE CACHE)
FIND_PROGRAM(R_EXECUTABLE R HINTS ${R_HOME}/bin ${R_HOME}/bin/x64)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
ENDIF()
......
......@@ -28,17 +28,15 @@ if(Analitza5_FOUND)
add_subdirectory(kalgebra)
endif(Analitza5_FOUND)
if(NOT WIN32)
set_package_properties(R PROPERTIES DESCRIPTION "A free software environment for statistical computing and graphics."
URL "https://www.r-project.org/"
TYPE OPTIONAL
PURPOSE "Backend to use R with Cantor.")
find_package(R)
if(R_FOUND)
add_subdirectory(R)
endif(R_FOUND)
endif()
set_package_properties(R PROPERTIES DESCRIPTION "A free software environment for statistical computing and graphics."
URL "https://www.r-project.org/"
TYPE OPTIONAL
PURPOSE "Backend to use R with Cantor.")
find_package(R)
if(R_FOUND)
add_subdirectory(R)
endif(R_FOUND)
set_package_properties(Qalculate PROPERTIES DESCRIPTION "A multi-purpose desktop calculator with support for customizable functions, units and arbitrary precision."
URL "https://qalculate.github.io/"
......
include_directories(${R_INCLUDEDIR})
LINK_DIRECTORIES(${R_SHAREDLIBDIR})
if(WIN32)
  • Shouldn't this be if (NOT WIN32)? Otherwise it's not built at all for non-Windows platforms.

Please register or sign in to reply
# rserver is using RInterface.h which is Unix only
# see https://colinfay.me/writing-r-extensions/linking-guis-and-other-front-ends-to-r.html
add_subdirectory(rserver)
endif()
set( RBackend_SRCS
rbackend.cpp
......
......@@ -11,7 +11,9 @@
#include <QStringList>
#include <stdio.h>
#ifndef _WIN32
#include <Rinterface.h>
#endif
RServer* server;
Expression* currentExpression;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment