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

56 lines
1.5 KiB
CMake
Raw Normal View History

2015-10-20 08:05:00 +01:00
#CHECK: PythonLibs, changed to work in WIN32
2014-12-14 12:05:43 +00:00
2018-03-02 21:18:24 +00:00
set (PYTHON_SOURCES python.c pl2py.c pybips.c py2pl.c pl2pl.c pypreds.c pyio.c)
set (PYTHON_HEADERS py4yap.h)
2017-05-08 18:51:29 +01:00
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
2016-12-10 07:01:10 +00:00
2018-07-06 16:51:19 +01:00
include_directories( BEFORE ${PYTHON_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}
2018-07-21 01:56:48 +01:00
${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/os ${CMAKE_SOURCE_DIR}/H ${CMAKE_SOURCE_DIR}/OPTYap )
2017-09-06 01:09:46 +01:00
#talk to python.pl
2019-01-09 09:32:09 +00:00
add_library(YAPPython pyload.c ${PYTHON_HEADERS} )
2017-06-13 13:34:17 +01:00
2017-06-12 18:00:47 +01:00
if (WIN32)
2017-06-15 22:40:55 +01:00
add_library (Py4YAP OBJECT ${PYTHON_SOURCES} ${PYTHON_HEADERS})
else()
2017-11-08 09:29:01 +00:00
add_library(Py4YAP SHARED ${PYTHON_SOURCES} ${PYTHON_HEADERS})
2017-06-15 22:40:55 +01:00
2017-11-08 09:29:01 +00:00
set_target_properties(
2017-10-11 02:24:15 +01:00
Py4YAP
PROPERTIES VERSION ${YAP_FULL_VERSION}
SOVERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}
)
2017-06-15 22:40:55 +01:00
2017-09-06 01:09:46 +01:00
# arithmetic hassle.
2017-11-11 22:48:09 +00:00
target_link_libraries(Py4YAP libYap ${PYTHON_LIBRARIES})
2017-09-06 01:09:46 +01:00
2017-11-08 09:29:01 +00:00
install(TARGETS Py4YAP
2018-11-22 13:48:21 +00:00
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
2017-11-08 09:29:01 +00:00
)
2017-09-06 01:09:46 +01:00
endif()
2016-07-31 16:09:21 +01:00
2017-11-11 22:48:09 +00:00
target_link_libraries(YAPPython Py4YAP libYap)
2017-06-15 22:40:55 +01:00
2017-06-08 22:16:52 +01:00
# arithmetic hassle.
set_property(TARGET YAPPython PROPERTY CXX_STANDARD_REQUIRED ON)
2017-05-14 11:36:09 +01:00
2017-06-16 11:53:46 +01:00
set_property( SOURCE ${PYTHON_SOURCES} APPEND PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 _GNU_SOURCE=1)
2016-04-12 16:22:53 +01:00
2017-05-08 18:51:29 +01:00
set (PYTHON_PL python.pl)
2016-07-31 16:09:21 +01:00
2018-11-16 14:02:56 +00:00
install(FILES python.pl DESTINATION ${YAP_INSTALL_DATADIR} )
2014-12-14 12:05:43 +00:00
2017-06-16 11:53:46 +01:00
set_target_properties (YAPPython PROPERTIES PREFIX "")
2017-02-22 21:28:05 +00:00
2017-05-02 07:38:23 +01:00
install(TARGETS YAPPython
2018-11-16 14:02:56 +00:00
LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR}
RUNTIME DESTINATION ${YAP_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR} )