cmake's execute_process() does not return value for output variable in Qt Creator

Viewed 34

I am trying to use RInside and Rcpp in a Qt app. For this, an example including a make file is available in the RInside package here.

However, none of the execute_process() calls in the make file return a value for the output variable when compiling with QT Creator 6.3.1. If I cmake my project directly from the terminal, then all values are returned properly for the output variables.

In Qt Creator the RESULTS_VARIABLE returned by execute_process() says the following: No such file or directory. So I started to suspect that there is some permission issue where Qt Creator is unable to call R RHOME, which usually should return /Library/Frameworks/R.framework/Resources on macOS.

Anyone an idea why I am not getting a value for the output variable of execute_process() when using QT Creator?

EDIT: When I start Qt Creator from the Terminal using ~/Qt/Qt\ Creator.app/Contents/MacOS/Qt\ Creator everything works as intended. It looks more and more like a permission problem.

My minimal make file for my project rinside-clean looks like this:

cmake_minimum_required(VERSION 3.5)

project(rinside-clean LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(rinside-clean main.cpp)

install(TARGETS rinside-clean
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

# just a debug function that prints variable values
function(PRINT_VAR VARNAME)
  message(STATUS "PRINT ${VARNAME}: ${${VARNAME}}")
endfunction()

# the call that does not return an output variable
execute_process(COMMAND R RHOME
  OUTPUT_VARIABLE R_HOME)

PRINT_VAR(R_HOME)

Output I am seeing is:

-- PRINT R_HOME: 
0 Answers
Related