Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python/cmake] use Python3_add_library() #104

Merged
merged 1 commit into from
Sep 4, 2024
Merged
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
11 changes: 2 additions & 9 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@ file(GLOB_RECURSE PY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
add_header_group(PY_HEADERS)

function(MAKE_BINDINGS)
add_library(${PYLIB_NAME} SHARED ${PY_SOURCES} ${PY_HEADERS})
python3_add_library(${PYLIB_NAME} MODULE WITH_SOABI ${PY_SOURCES} ${PY_HEADERS})
add_library(proxsuite::nlp::python ALIAS ${PYLIB_NAME})
add_library(${PROJECT_NAME}::${PYLIB_NAME} ALIAS ${PYLIB_NAME})

set_target_properties(
${PYLIB_NAME}
PROPERTIES LIBRARY_OUTPUT_DIRECTORY "proxsuite_nlp"
RUNTIME_OUTPUT_DIRECTORY "proxsuite_nlp"
PREFIX ""
SUFFIX ${PYTHON_EXT_SUFFIX}
VERSION ${PROJECT_VERSION}
)
set_target_properties(${PYLIB_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "proxsuite_nlp")
if(UNIX)
get_relative_rpath(${${PYLIB_NAME}_INSTALL_DIR} PYLIB_INSTALL_RPATH)
set_target_properties(${PYLIB_NAME} PROPERTIES INSTALL_RPATH "${PYLIB_INSTALL_RPATH}")
Expand Down
Loading