Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
The Python APBS lib build needed some rework to make it build librari…
Browse files Browse the repository at this point in the history
…es with the correct extensions.
  • Loading branch information
keith923 committed Dec 15, 2015
1 parent f751109 commit bbcb70b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apbs/tools/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "")

SWIG_ADD_MODULE(apbslib python apbslib.i)
SWIG_LINK_LIBRARIES(apbslib ${APBS_LIBS} ${APBS_INTERNAL_LIBS}
${PYTHON_LIBRARIES})

# Hack to get the correct shared library extensions. Why does Python suck so hard wrt to this?
if(APPLE)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
endif(APPLE)

# Another hack to get SWIG to use the the correct library extension!
SET_TARGET_PROPERTIES(${SWIG_MODULE_apbslib_REAL_NAME} PROPERTIES SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})

SWIG_LINK_LIBRARIES(apbslib ${APBS_LIBS} ${APBS_INTERNAL_LIBS} ${PYTHON_LIBRARIES})

add_custom_command(TARGET _apbslib POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_BINARY_DIR}/apbslib.py ${CMAKE_SOURCE_DIR}/../pdb2pqr/pdb2pka
COMMAND ${CMAKE_COMMAND} -E
copy ${LIBRARY_OUTPUT_PATH}/_apbslib.so ${CMAKE_SOURCE_DIR}/../pdb2pqr/pdb2pka
copy ${LIBRARY_OUTPUT_PATH}/_apbslib${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_SOURCE_DIR}/../pdb2pqr/pdb2pka
)

0 comments on commit bbcb70b

Please sign in to comment.