Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,15 @@ if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITE ${PYTHON_SITE})
endif()

# base site dir, use python installation for location specific includes
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c
"from distutils.sysconfig import get_python_lib as pl; print(pl(plat_specific=True))"
OUTPUT_VARIABLE PYTHON_SITEARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(WIN32)
string(REPLACE "\\" "/" PYTHON_SITEARCH ${PYTHON_SITEARCH})
endif()

add_subdirectory(slycot)

6 changes: 3 additions & 3 deletions slycot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ add_custom_command(
add_library(
${SLYCOT_MODULE} SHARED
SLYCOTmodule.c _wrappermodule.c _wrapper-f2pywrappers.f
"${PYTHON_SITE}/numpy/f2py/src/fortranobject.c"
"${PYTHON_SITEARCH}/numpy/f2py/src/fortranobject.c"
${FSOURCES})

set(CMAKE_SHARED_LIBRARY_PREFIX "")
Expand Down Expand Up @@ -161,8 +161,8 @@ endif()

target_include_directories(
${SLYCOT_MODULE} PUBLIC
${PYTHON_SITE}/numpy/core/include
${PYTHON_SITE}/numpy/f2py/src
${PYTHON_SITEARCH}/numpy/core/include
${PYTHON_SITEARCH}/numpy/f2py/src
${PYTHON_INCLUDE_DIRS}
)

Expand Down