Commit 946608c7 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Fix naming of Python packages when cross compiling.

parent 78eee420
......@@ -26,11 +26,7 @@ project(PYLINPHONE C CXX) # Dummy project
if(APPLE)
set(PLATFORM_ARCH_NAME "${CMAKE_OSX_ARCHITECTURES}")
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(PLATFORM_ARCH_NAME "x86_64")
else()
set(PLATFORM_ARCH_NAME "i386")
endif()
set(PLATFORM_ARCH_NAME "${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()
set(Python_ADDITIONAL_VERSIONS 2.7)
......@@ -215,13 +211,21 @@ endif()
if(UNIX)
if(APPLE)
set(PLATFORM_OS "macosx-${CMAKE_OSX_DEPLOYMENT_TARGET}")
if(CMAKE_CROSSCOMPILING)
string(TOLOWER "${CMAKE_SYSTEM_NAME}" PLATFORM_OS)
set(PLATFORM_TAG "${PLATFORM_OS}-${CMAKE_SYSTEM_PROCESSOR}")
set(UNDERSCORE_PLATFORM_TAG "any")
else()
set(PLATFORM_OS "linux")
if(APPLE)
set(PLATFORM_OS "macosx-${CMAKE_OSX_DEPLOYMENT_TARGET}")
else()
set(PLATFORM_OS "linux")
endif()
string(REPLACE "-" "_" UNDERSCORE_PLATFORM_OS ${PLATFORM_OS})
string(REPLACE "." "_" UNDERSCORE_PLATFORM_OS ${UNDERSCORE_PLATFORM_OS})
set(PLATFORM_TAG "${PLATFORM_OS}-${PLATFORM_ARCH_NAME}")
set(UNDERSCORE_PLATFORM_TAG "${UNDERSCORE_PLATFORM_OS}_${PLATFORM_ARCH_NAME}")
endif()
string(REPLACE "-" "_" UNDERSCORE_PLATFORM_OS ${PLATFORM_OS})
string(REPLACE "." "_" UNDERSCORE_PLATFORM_OS ${UNDERSCORE_PLATFORM_OS})
# Generate the zip
set(ZIP_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/build_zip/linphone/dist/linphone-${LINPHONE_GIT_REVISION}.${PLATFORM_OS}-${PLATFORM_ARCH_NAME}.zip")
......@@ -231,7 +235,7 @@ add_custom_command(OUTPUT "${ZIP_FILENAME}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build_zip/linphone"
)
add_custom_target(pylinphone_zip ALL DEPENDS "${ZIP_FILENAME}")
install(FILES ${ZIP_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.${PLATFORM_OS}-${PLATFORM_ARCH_NAME}-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.zip")
install(FILES ${ZIP_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_GIT_REVISION}.${PLATFORM_TAG}-py${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.zip")
# Generate the wheel package
string(REPLACE "-" "_" LINPHONE_UNDERSCORE_GIT_REVISION ${LINPHONE_GIT_REVISION})
......@@ -242,6 +246,6 @@ add_custom_command(OUTPUT "${WHEEL_FILENAME}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build_wheel/linphone"
)
add_custom_target(pylinphone_wheel ALL DEPENDS "${WHEEL_FILENAME}")
install(FILES ${WHEEL_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_UNDERSCORE_GIT_REVISION}-cp27-none-${UNDERSCORE_PLATFORM_OS}_${PLATFORM_ARCH_NAME}.whl")
install(FILES ${WHEEL_FILENAME} DESTINATION "." RENAME "linphone-${LINPHONE_UNDERSCORE_GIT_REVISION}-cp27-none-${UNDERSCORE_PLATFORM_TAG}.whl")
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