Skip to content

Commit f9fd20e

Browse files
committed
Fix Python installation with CMake install target
1 parent f28f5ae commit f9fd20e

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

python/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@ if(UNIX OR APPLE)
2222
endif()
2323

2424
# ---[ Install
25-
file(GLOB files1 *.py requirements.txt)
26-
install(FILES ${files1} DESTINATION python)
27-
28-
file(GLOB files2 caffe/*.py)
29-
install(FILES ${files2} DESTINATION python/caffe)
25+
# scripts
26+
file(GLOB python_files *.py requirements.txt)
27+
install(FILES ${python_files} DESTINATION python)
28+
29+
# module
30+
install(DIRECTORY caffe
31+
DESTINATION python
32+
FILES_MATCHING
33+
PATTERN "*.py"
34+
PATTERN "ilsvrc_2012_mean.npy"
35+
PATTERN "test" EXCLUDE
36+
)
37+
38+
# _caffe.so
3039
install(TARGETS pycaffe DESTINATION python/caffe)
31-
install(DIRECTORY caffe/imagenet caffe/proto caffe/test DESTINATION python/caffe)
32-
33-
3440

0 commit comments

Comments
 (0)