Commit ea877136 authored by Purves, Murray's avatar Purves, Murray
Browse files

Python bindings CMake configuration

parent 585f9663
Pipeline #28295 failed with stages
in 54 seconds
......@@ -9,20 +9,18 @@ IF(PYTHON3_FOUND)
ENDIF()
INCLUDE_DIRECTORIES(${PYTHON3_INCLUDE_DIRS})
# Set up the Python setup script
SET(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/radixmathpy/setup.py.in")
SET(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/radixmathpy/setup.py")
CONFIGURE_FILE(${SETUP_PY_IN} ${SETUP_PY})
SET(INTERPOLATE_SOURCE
radixmathpy/interpolatemodule.cc
SET(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/radixmathpy/build_output")
ADD_CUSTOM_COMMAND(
OUTPUT ${OUTPUT}
COMMAND ${PYTHON3_EXECUTABLE} ${SETUP_PY} build
DEPENDS ""
)
SET(HEADERS
python_utils.hh
)
#
# Add library
TRIBITS_ADD_LIBRARY(radix_interpolate
SOURCES ${INTERPOLATE_SOURCE}
NOINSTALLHEADERS ${HEADERS}
)
install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)")
TRIBITS_SUBPACKAGE_POSTPROCESS()
......@@ -4,7 +4,7 @@ import sys
libraries = []
library_dirs = []
static_lib_dir = "/Users/ohp/project/build/radix/radixmath"
static_lib_dir = "${CMAKE_CURRENT_BINARY_DIR}/../radixmath"
static_libraries = ["radixmath"]
extra_objects = []
......@@ -19,7 +19,7 @@ else:
interpolate_module = Extension(
'interpolate',
sources=['interpolatemodule.cc'],
sources=['${CMAKE_CURRENT_SOURCE_DIR}/interpolatemodule.cc'],
language='C++',
libraries=libraries,
library_dirs=library_dirs,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment