Commit 7d06c6a5 authored by Tim D. Smith's avatar Tim D. Smith

Don't explicitly link to Python on OS X

See http://blog.tim-smith.us/2015/09/python-extension-modules-os-x/.
parent 5f6979af
......@@ -166,7 +166,13 @@ if(XDMF_WRAP_PYTHON)
set_source_files_properties(${python_name}.i PROPERTIES CPLUSPLUS ON)
set(swig_extra_generated_files "")
swig_add_module(${python_name}Python python ${python_name}.i)
swig_link_libraries(${python_name}Python ${python_name} ${PYTHON_LIBRARIES})
if (NOT APPLE)
swig_link_libraries(${python_name}Python ${python_name} ${PYTHON_LIBRARIES})
else ()
swig_link_libraries(${python_name}Python ${python_name})
endif ()
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
${CMAKE_CURRENT_BINARY_DIR}/${python_name}.pyc
......@@ -188,6 +194,12 @@ if(XDMF_WRAP_PYTHON)
endif()
endif()
if(APPLE)
set_target_properties(${SWIG_MODULE_${python_name}Python_REAL_NAME}
PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup")
endif()
set_target_properties(${SWIG_MODULE_${python_name}Python_REAL_NAME}
PROPERTIES
OUTPUT_NAME "_${python_name}")
......
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