2015-10-13 08:25:49 +01:00
|
|
|
|
2016-08-20 03:40:01 +01:00
|
|
|
# PROJECT ( YAP_REAL C )
|
2015-10-13 08:25:49 +01:00
|
|
|
|
2017-02-20 15:28:46 +00:00
|
|
|
|
|
|
|
#
|
2017-10-17 00:13:09 +01:00
|
|
|
# - This module locates an installed R distribution.
|
|
|
|
#
|
|
|
|
# Defines the following:
|
|
|
|
# R_COMMAND - Path to R command
|
|
|
|
# R_HOME - Path to 'R home', as reported by R
|
|
|
|
# R_INCLUDE_DIR - Path to R include directory
|
|
|
|
# R_LIBRARY_BASE - Path to R library
|
|
|
|
# R_LIBRARY_BLAS - Path to Rblas / blas library
|
|
|
|
# R_LIBRARY_LAPACK - Path to Rlapack / lapack library
|
|
|
|
# R_LIBRARY_READLINE - Path to readline library
|
|
|
|
# R_LIBRARIES - Array of: R_LIBRARY_BASE, R_LIBRARY_BLAS, R_LIBRARY_LAPACK, R_LIBRARY_BASE [, R_LIBRARY_READLINE]
|
|
|
|
#
|
|
|
|
# VTK_R_HOME - (deprecated, use R_HOME instead) Path to 'R home', as reported by R
|
|
|
|
#
|
|
|
|
# Variable search order:
|
|
|
|
# 1. Attempt to locate and set R_COMMAND
|
2018-05-22 12:23:52 +01:00
|
|
|
# If unsuccessful, generate error and prompt user to manually set R_COMMAND
|
2017-10-17 00:13:09 +01:00
|
|
|
# 2. Use R_COMMAND to set R_HOME
|
|
|
|
# 3. Locate other libraries in the priority:
|
|
|
|
# 1. Within a user-built instance of R at R_HOME
|
|
|
|
# 2. Within an installed instance of R
|
|
|
|
# 3. Within external system libraries
|
|
|
|
#
|
2018-05-22 12:23:52 +01:00
|
|
|
|
|
|
|
if (R_LIBRARIES AND R_INCLUDE_DIR)
|
2018-05-20 18:40:56 +01:00
|
|
|
set_package_properties(R PROPERTIES
|
|
|
|
DESCRIPTION "The R Project for Statistical Computing."
|
2018-05-22 12:23:52 +01:00
|
|
|
|
|
|
|
URL "https://www.r-project.org/")
|
|
|
|
add_lib(real ${REAL_SOURCES})
|
|
|
|
target_link_libraries (real ${R_LIBRARIES} libYap)
|
2015-10-13 08:25:49 +01:00
|
|
|
include_directories (
|
2018-05-22 12:23:52 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${R_INCLUDE_DIR}
|
2015-10-13 08:25:49 +01:00
|
|
|
)
|
|
|
|
|
2017-12-13 16:56:10 +00:00
|
|
|
list (APPEND CMAKE_REQUIRED_INCLUDES
|
2015-10-13 08:25:49 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2017-12-13 16:56:10 +00:00
|
|
|
${R_INCLUDE_DIR}
|
2015-10-13 08:25:49 +01:00
|
|
|
)
|
|
|
|
|
2017-05-02 07:42:21 +01:00
|
|
|
check_include_files( "stdio.h;R.h" HAVE_R_H )
|
2018-05-22 12:23:52 +01:00
|
|
|
check_include_files( "R.h,;Rembedded.h" HAVE_R_EMBEDDED_H )
|
2015-10-13 08:25:49 +01:00
|
|
|
check_include_files( "Rembedded.h;Rinterface.h" HAVE_R_INTERFACE_H )
|
|
|
|
|
|
|
|
configure_file ("rconfig.h.cmake" "rconfig.h" )
|
|
|
|
|
|
|
|
install(TARGETS real
|
2017-12-05 15:14:57 +00:00
|
|
|
RUNTIME DESTINATION ${YAP_INSTALL_DLLDIR}
|
|
|
|
ARCHIVE DESTINATION ${YAP_INSTALL_DLLDIR}
|
|
|
|
LIBRARY DESTINATION ${YAP_INSTALL_DLLDIR}
|
2015-10-13 08:25:49 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES real.pl
|
|
|
|
DESTINATION ${libpl}
|
|
|
|
)
|
|
|
|
|
2017-10-17 00:13:09 +01:00
|
|
|
endif()
|