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
|
|
|
|
# - If unsuccessful, generate error and prompt user to manually set R_COMMAND
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
|
|
|
macro_optional_find_package (R ON)
|
2015-10-13 08:25:49 +01:00
|
|
|
|
2017-11-09 12:14:41 +00:00
|
|
|
if (R_LIBRARIES AND R_INCLUDE_DIR)
|
2015-10-13 08:25:49 +01:00
|
|
|
|
|
|
|
set (REAL_SOURCES
|
|
|
|
real.c
|
|
|
|
)
|
|
|
|
|
2017-05-02 07:42:21 +01:00
|
|
|
set (REAL_PL
|
|
|
|
real.pl
|
|
|
|
)
|
|
|
|
|
2017-10-11 02:24:15 +01:00
|
|
|
add_to_group( REAL_PL pl_library)
|
2017-05-02 07:42:21 +01:00
|
|
|
|
2015-10-13 08:25:49 +01:00
|
|
|
include_directories (
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2017-10-17 00:13:09 +01:00
|
|
|
${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-09-06 01:09:46 +01:00
|
|
|
add_lib(real ${REAL_SOURCES})
|
2015-10-13 08:25:49 +01:00
|
|
|
|
2017-10-17 00:13:09 +01:00
|
|
|
target_link_libraries (real ${R_LIBRARIES} libYap)
|
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 )
|
|
|
|
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()
|