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
Vitor Santos Costa d7e21c80df fix swi call leak
improve yapi
reformat
2017-06-19 19:02:36 +01:00

53 lines
1.3 KiB
CMake

#CHECK: PythonLibs, changed to work in WIN32
set (PYTHON_SOURCES python.c pl2py.c pybips.c py2pl.c pl2pl.c pypreds.c)
set (PYTHON_HEADERS py4yap.h)
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include )
add_library (YAPPython SHARED pyload.c ${PYTHON_HEADERS} )
if (WIN32)
add_library (Py4YAP OBJECT ${PYTHON_SOURCES} ${PYTHON_HEADERS})
else()
add_library (Py4YAP SHARED ${PYTHON_SOURCES} ${PYTHON_HEADERS})
# arithmetic hassle.
set_property(TARGET Py4YAP PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(Py4YAP libYap ${PYTHON_LIBRARIES})
target_link_libraries(YAPPython Py4YAP)
MY_install(TARGETS Py4YAP
LIBRARY DESTINATION ${libdir}
RUNTIME DESTINATION ${dlls}
ARCHIVE DESTINATION ${libdir} )
endif()
# arithmetic hassle.
set_property(TARGET YAPPython PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(YAPPython libYap ${PYTHON_LIBRARIES})
set_property( SOURCE ${PYTHON_SOURCES} APPEND PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 _GNU_SOURCE=1)
set (PYTHON_PL python.pl)
install(FILES python.pl DESTINATION ${libpl} )
add_to_group( pl_library PYTHON_PL )
set_target_properties (YAPPython PROPERTIES PREFIX "")
install(TARGETS YAPPython
LIBRARY DESTINATION ${dlls}
RUNTIME DESTINATION ${dlls}
ARCHIVE DESTINATION ${dlls} )