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
|
|
|
|
2019-04-02 10:27:37 +01:00
|
|
|
set(YAP4R_SOURCES
|
|
|
|
yap4r/man/yap4r-package.Rd
|
|
|
|
yap4r/R/zzz.R
|
|
|
|
yap4r/NAMESPACE
|
|
|
|
yap4r/DESCRIPTION
|
|
|
|
yap4r/src/yap4r.cpp
|
|
|
|
yap4r/src/RcppExports.cpp
|
|
|
|
)
|
|
|
|
|
2018-07-15 13:43:29 +01:00
|
|
|
set(REAL_SOURCES real.c)
|
|
|
|
|
2018-07-11 19:26:02 +01:00
|
|
|
# LIBR_FOUND
|
|
|
|
# LIBR_HOME
|
2018-07-15 13:43:29 +01:00
|
|
|
# LIBLIBR_INCLUDE_DIRSS
|
2018-07-11 19:26:02 +01:00
|
|
|
# LIBR_DOC_DIR
|
|
|
|
# LIBR_LIBRARIES
|
2018-05-22 12:23:52 +01:00
|
|
|
|
2018-07-15 13:43:29 +01:00
|
|
|
if (LIBR_LIBRARIES AND LIBR_INCLUDE_DIRS)
|
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/")
|
2019-04-01 09:27:55 +01:00
|
|
|
|
|
|
|
|
2019-04-02 10:27:37 +01:00
|
|
|
foreach(f ${YAP4R_SOURCES})
|
2019-04-01 09:27:55 +01:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${f}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${f} ${CMAKE_CURRENT_BINARY_DIR}/${f}
|
2019-04-02 10:27:37 +01:00
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${f}
|
2019-04-01 09:27:55 +01:00
|
|
|
)
|
|
|
|
list(APPEND OUTS ${CMAKE_CURRENT_BINARY_DIR}/${f} )
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(YAP4R
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
DEPENDS ${OUTS}
|
|
|
|
)
|
2019-04-02 10:27:37 +01:00
|
|
|
|
2019-01-09 09:32:09 +00:00
|
|
|
add_library(real ${REAL_SOURCES})
|
2018-07-15 13:43:29 +01:00
|
|
|
target_link_libraries (real ${LIBR_LIBRARIES} libYap)
|
2015-10-13 08:25:49 +01:00
|
|
|
include_directories (
|
2018-07-15 13:43:29 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}/include
|
2019-04-02 10:27:37 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
2018-07-15 13:43:29 +01:00
|
|
|
${LIBR_INCLUDE_DIRS}
|
2015-10-13 08:25:49 +01:00
|
|
|
)
|
|
|
|
|
2017-12-13 16:56:10 +00:00
|
|
|
list (APPEND CMAKE_REQUIRED_INCLUDES
|
2018-07-15 13:43:29 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${CMAKE_SOURCE_DIR}/include
|
|
|
|
${LIBR_INCLUDE_DIRS}
|
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-07-15 13:43:29 +01:00
|
|
|
check_include_files( "R.h,;Rembeddred.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" )
|
2019-04-01 09:27:55 +01:00
|
|
|
configure_file ("yap4r/src/Makevars.in" "yap4r/src/Makevars" )
|
|
|
|
|
|
|
|
|
2019-04-02 10:27:37 +01:00
|
|
|
add_dependencies(real YAP4R)
|
|
|
|
|
2015-10-13 08:25:49 +01:00
|
|
|
install(TARGETS real
|
2018-11-16 14:02:56 +00:00
|
|
|
RUNTIME DESTINATION ${YAP_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR}
|
2015-10-13 08:25:49 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES real.pl
|
2018-11-16 14:02:56 +00:00
|
|
|
DESTINATION ${YAP_INSTALL_DATADIR}
|
2015-10-13 08:25:49 +01:00
|
|
|
)
|
|
|
|
|
2017-10-17 00:13:09 +01:00
|
|
|
endif()
|