[cmake/build] Fix pyCaffe installation #5670

Open
wants to merge 3 commits into
from
View
@@ -8,6 +8,11 @@ file(GLOB_RECURSE python_srcs ${PROJECT_SOURCE_DIR}/python/*.cpp)
add_library(pycaffe SHARED ${python_srcs})
caffe_default_properties(pycaffe)
set_target_properties(pycaffe PROPERTIES PREFIX "" OUTPUT_NAME "_caffe")
+if(MSVC)
+ set_target_properties(pycaffe PROPERTIES SUFFIX ".pyd")
+elseif(APPLE)
+ set_target_properties(pycaffe PROPERTIES SUFFIX ".so")
+endif()
target_include_directories(pycaffe PUBLIC ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR})
target_link_libraries(pycaffe PUBLIC ${Caffe_LINK} ${PYTHON_LIBRARIES})