This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/python/CMakeLists.txt

50 lines
997 B
CMake
Raw Normal View History

2015-10-20 08:05:00 +01:00
#CHECK: PythonLibs
2014-12-14 12:05:43 +00:00
2016-08-18 08:12:40 +01:00
if (PYTHONLIBS_FOUND)
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-18 08:12:40 +01:00
add_library (libpython SHARED ${PYTHON_SOURCES})
2016-07-31 16:09:21 +01:00
set (PYTHON_HEADERS
python.h)
2014-12-14 12:05:43 +00:00
2016-08-22 04:01:38 +01:00
configure_file ("setup.py.cmake" "setup.py" )
2016-07-31 16:09:21 +01:00
2015-06-19 01:22:12 +01:00
target_link_libraries(libpython 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
2015-06-19 01:22:12 +01:00
set_target_properties (libpython PROPERTIES PREFIX "")
2014-12-14 12:05:43 +00:00
include_directories (${PYTHON_INCLUDE_DIRS})
2015-02-03 02:37:25 +00:00
2015-06-19 01:22:12 +01:00
install(TARGETS libpython
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-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()
endif (PYTHONLIBS_FOUND)