File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ if(SWIG_FOUND)
61
61
if (PYTHONLIBS_FOUND )
62
62
include_directories (${PYTHON_INCLUDE_PATH} )
63
63
64
+ if (NOT DEFINED PYTHONLIBS_VERSION_STRING ) # Since CMake 2.8.8
65
+ # Get Python version from include path
66
+ string (LENGTH ${PYTHON_INCLUDE_DIRS} PYTHON_INCLUDE_DIRS_LENGTH )
67
+ math (EXPR PYTHON_INCLUDE_DIRS_LENGTH "${PYTHON_INCLUDE_DIRS_LENGTH} - 3" )
68
+ string (SUBSTRING ${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS_LENGTH} 3 PYTHONLIBS_VERSION_STRING )
69
+ endif ()
70
+
64
71
# Swig flags
65
72
set (CMAKE_SWIG_FLAGS -c++ -fcompact )
66
73
@@ -75,7 +82,7 @@ if(SWIG_FOUND)
75
82
install (
76
83
FILES ${AVTRANSCODER_PYTHON_BINDING_FILE}
77
84
RENAME "avtranscoder.py"
78
- DESTINATION "lib/python2.7 /site-packages/avtranscoder/"
85
+ DESTINATION "lib/python ${PYTHONLIBS_VERSION_STRING} /site-packages/avtranscoder/"
79
86
)
80
87
else ()
81
88
message ("PYTHON not found, will not build python binding." )
You can’t perform that action at this time.
0 commit comments