Skip to content

Instantly share code, notes, and snippets.

@tdsmith
Created March 24, 2015 06:16
Show Gist options
  • Save tdsmith/484553cd2d0c19a4baa7 to your computer and use it in GitHub Desktop.
Save tdsmith/484553cd2d0c19a4baa7 to your computer and use it in GitHub Desktop.
diff --git a/modules/python/CMakeLists.txt b/modules/python/CMakeLists.txt
index 3c0f2fd..354c786 100644
--- a/modules/python/CMakeLists.txt
+++ b/modules/python/CMakeLists.txt
@@ -64,7 +64,11 @@ add_library(${the_module} SHARED src2/cv2.cpp ${CMAKE_CURRENT_BINARY_DIR}/genera
if(PYTHON_DEBUG_LIBRARIES AND NOT PYTHON_LIBRARIES MATCHES "optimized.*debug")
target_link_libraries(${the_module} debug ${PYTHON_DEBUG_LIBRARIES} optimized ${PYTHON_LIBRARIES})
else()
- target_link_libraries(${the_module} ${PYTHON_LIBRARIES})
+ if(APPLE)
+ set_target_properties(${the_module} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+ else()
+ target_link_libraries(${the_module} ${PYTHON_LIBRARIES})
+ endif()
endif()
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment