2015-10-20 08:05:00 +01:00
|
|
|
|
2014-12-04 07:59:30 +00:00
|
|
|
#CHECK: PythonLibs
|
2014-12-14 12:05:43 +00:00
|
|
|
|
2016-08-18 08:12:40 +01:00
|
|
|
if (PYTHONLIBS_FOUND)
|
|
|
|
|
2016-08-22 06:08:59 +01:00
|
|
|
include(FindPythonModule)
|
|
|
|
|
2014-12-14 12:05:43 +00:00
|
|
|
set (PYTHON_SOURCES
|
2016-07-31 16:09:21 +01:00
|
|
|
python.c pl2py.c pybips.c py2pl.c pl2pl.c pypreds.c )
|
|
|
|
|
2016-08-23 01:18:33 +01:00
|
|
|
add_library (YAPPython SHARED ${PYTHON_SOURCES})
|
2016-08-18 08:12:40 +01:00
|
|
|
|
2016-07-31 16:09:21 +01:00
|
|
|
set (PYTHON_HEADERS
|
|
|
|
python.h)
|
2014-12-14 12:05:43 +00:00
|
|
|
|
2016-08-23 01:18:33 +01:00
|
|
|
target_link_libraries(YAPPython libYap ${PYTHON_LIBRARIES})
|
2016-04-12 16:22:53 +01:00
|
|
|
|
2016-07-31 16:09:21 +01:00
|
|
|
set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup.py")
|
|
|
|
|
|
|
|
add_custom_target ( YAPex ALL
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} setup.py build -f
|
|
|
|
DEPENDS yapex.py )
|
2014-12-14 12:05:43 +00:00
|
|
|
|
2016-08-23 01:18:33 +01:00
|
|
|
# set_target_properties (YAPPython PROPERTIES PREFIX "")
|
2014-12-14 12:05:43 +00:00
|
|
|
|
|
|
|
include_directories (${PYTHON_INCLUDE_DIRS})
|
2015-02-03 02:37:25 +00:00
|
|
|
|
2016-08-23 01:18:33 +01:00
|
|
|
install(TARGETS YAPPython
|
2014-12-14 12:05:43 +00:00
|
|
|
LIBRARY DESTINATION ${dlls}
|
2016-01-20 22:25:25 +00:00
|
|
|
ARCHIVE DESTINATION ${dlls}
|
|
|
|
)
|
2014-12-14 12:05:43 +00:00
|
|
|
|
|
|
|
install(FILES python.pl
|
|
|
|
DESTINATION ${libpl}
|
|
|
|
)
|
|
|
|
|
2016-08-23 01:18:33 +01:00
|
|
|
configure_file ("setup.py.cmake" "setup.py" )
|
|
|
|
|
2016-07-31 16:09:21 +01:00
|
|
|
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install -f
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
|
2015-02-03 02:37:25 +00:00
|
|
|
|
2016-08-22 04:01:38 +01:00
|
|
|
find_python_module( jupyter )
|
|
|
|
|
|
|
|
if (PY_JUPYTER)
|
|
|
|
|
2016-08-18 08:13:55 +01:00
|
|
|
add_subdirectory(yap_kernel)
|
|
|
|
|
2016-08-22 04:01:38 +01:00
|
|
|
endif()
|
|
|
|
|
2014-12-04 07:59:30 +00:00
|
|
|
endif (PYTHONLIBS_FOUND)
|