OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace-rocks / opencog / cython / CMakeLists.txt

44 lines · txt ref:

INCLUDE_DIRECTORIES(
	${Python3_INCLUDE_DIRS}
	${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_CURRENT_BINARY_DIR}
)

SET(CYTHON_FLAGS "-3" "-f" "-Wextra")

# The python module name is taken from the pyx filename. Thus, the file
# storage_rocks.pyx means that module name will be
# 'opencog.storage_rocks'. This will have an autogenerated
# PyInit_storage_rocks() in it, again, based on the module name.
# The storage_rocks.pyx includes persist_rocks_types.pyx, which is
# auto-generated, and so must be built first.
CYTHON_ADD_MODULE_PYX(storage_rocks
	persist_rocks_atom_types
)

ADD_LIBRARY(storage_rocks_cython SHARED
	storage_rocks.cpp
)

ADD_DEPENDENCIES(storage_rocks_cython persist_rocks_atom_types)

TARGET_LINK_LIBRARIES(storage_rocks_cython
	${NO_AS_NEEDED}
	persist-rocks
	persist-monospace
	${AS_NEEDED}
	storage-types
	atomspace
	${Python3_LIBRARIES}
)

SET_TARGET_PROPERTIES(storage_rocks_cython PROPERTIES
	PREFIX ""
	OUTPUT_NAME storage_rocks)

### install the modules ###
INSTALL(TARGETS
	storage_rocks_cython
	DESTINATION "${PYTHON_DEST}")