Я пытаюсь собрать расширение Python с помощью cmake.Это список cmake:
cmake_minimum_required(VERSION 2.8)
PROJECT(drtile)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Vigra REQUIRED)
find_package(Boost COMPONENTS python REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Numpy REQUIRED)
include_directories(
${VIGRA_INCLUDE_DIR}
${PYTHON_NUMPY_INCLUDE_DIR}
${Boost_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
${PYTHON_INCLUDE_PATH}
)
add_library(drtile SHARED drtile.cpp)
message("xxx ${Boost_PYTHON_LIBRARY} ${VIGRA_NUMPY_CORE_LIBRARY}${VIGRA_NUMPY_IMPEX_LIBRARY}")
target_link_libraries(drtile ${Boost_PYTHON_LIBRARY} ${VIGRA_NUMPY_CORE_LIBRARY} ${PYTHON_LIBRARY})
IF(WIN32)
SET_TARGET_PROPERTIES(drtile PROPERTIES OUTPUT_NAME "drtile" PREFIX "" SUFFIX ".pyd")
ELSE()
SET_TARGET_PROPERTIES(drtile PROPERTIES OUTPUT_NAME "drtile" PREFIX "" SUFFIX ".so")
ENDIF()
Библиотека скомпилирована и связана правильно, но когда я смотрю на понравившуюся библиотеку с помощью otool, я получаю:
otool -L drtile.so
drtile.so:
/Users/lfiaschi/phd/workspace/lazyflow/lazyflow/drtile/drtile.so (compatibility version 0.0.0, current version 0.0.0)
libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0)
vigranumpycore.so (compatibility version 0.0.0, current version 0.0.0)
/Users/lfiaschi/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
Как я могу получить CMake длясвязать drtile.so с полным путем к vigranumpycore.so и libboost_python.dylib?Спасибо!