Commit 40901b5f authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Detect Python version for output files naming.

parent 234bea32
......@@ -78,22 +78,22 @@ if(WIN32)
#set(ENV{VS90COMNTOOLS} "$ENV{VS110COMNTOOLS}")
# Generate the installer
set(EXE_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/dist/linphone-${LINPHONE_VERSION}.win32-py2.7.exe")
set(EXE_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/dist/linphone-${LINPHONE_VERSION}.win32-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.exe")
add_custom_command(OUTPUT ${EXE_FILENAME}
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/linphone.c"
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/setup.py" "bdist_wininst"
)
add_custom_target(pylinphone_exe ALL DEPENDS ${EXE_FILENAME})
install(FILES ${EXE_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.win32-py2.7.exe")
install(FILES ${EXE_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.win32-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.exe")
# Generate the msi
set(MSI_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/dist/linphone-${LINPHONE_VERSION}.win32-py2.7.msi")
set(MSI_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/dist/linphone-${LINPHONE_VERSION}.win32-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.msi")
add_custom_command(OUTPUT ${MSI_FILENAME}
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/linphone.c"
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/setup.py" "bdist_msi"
)
add_custom_target(pylinphone_msi ALL DEPENDS ${MSI_FILENAME})
install(FILES ${MSI_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.win32-py2.7.msi")
install(FILES ${MSI_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.win32-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.msi")
# Generate the zip
set(ZIP_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/dist/linphone-${LINPHONE_VERSION}.win32.zip")
......@@ -102,5 +102,5 @@ add_custom_command(OUTPUT ${ZIP_FILENAME}
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/setup.py" "bdist" "--format=zip"
)
add_custom_target(pylinphone_zip ALL DEPENDS ${ZIP_FILENAME})
install(FILES ${ZIP_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.win32-py2.7.zip")
install(FILES ${ZIP_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.win32-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.zip")
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment