diff options
author | Trung Tran <trung.tran@ettus.com> | 2018-07-13 12:52:47 +0000 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-07-13 11:45:41 -0700 |
commit | 04987da5150d4043d8a424dd897eeae0b7110ee5 (patch) | |
tree | 45ebab89d88e192974e9f77025fb78da637e2369 | |
parent | 1f0a8561f0ccda4dee47dd364d30bef4ac966721 (diff) | |
download | uhd-04987da5150d4043d8a424dd897eeae0b7110ee5.tar.gz uhd-04987da5150d4043d8a424dd897eeae0b7110ee5.tar.bz2 uhd-04987da5150d4043d8a424dd897eeae0b7110ee5.zip |
cmake: add support to make python api installer on windows
-rw-r--r-- | host/cmake/Modules/UHDPackage.cmake | 6 | ||||
-rw-r--r-- | host/python/CMakeLists.txt | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/host/cmake/Modules/UHDPackage.cmake b/host/cmake/Modules/UHDPackage.cmake index 8bd31910f..1ba981398 100644 --- a/host/cmake/Modules/UHDPackage.cmake +++ b/host/cmake/Modules/UHDPackage.cmake @@ -120,6 +120,7 @@ SET(CPACK_SOURCE_IGNORE_FILES "\\\\.git*;\\\\.swp$") # Setup CPack Components ######################################################################## SET(CPACK_COMPONENT_LIBRARIES_GROUP "Development") +SET(CPACK_COMPONENT_PYTHONAPI_GROUP "Development") SET(CPACK_COMPONENT_HEADERS_GROUP "Development") SET(CPACK_COMPONENT_UTILITIES_GROUP "Runtime") SET(CPACK_COMPONENT_EXAMPLES_GROUP "Runtime") @@ -128,6 +129,7 @@ SET(CPACK_COMPONENT_DOXYGEN_GROUP "Documentation") SET(CPACK_COMPONENT_README_GROUP "Documentation") SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries") +SET(CPACK_COMPONENT_PYTHONAPI_DISPLAY_NAME "UHD Python API") SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ Headers") SET(CPACK_COMPONENT_UTILITIES_DISPLAY_NAME "Utilities") SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples") @@ -137,6 +139,7 @@ SET(CPACK_COMPONENT_README_DISPLAY_NAME "Readme") SET(CPACK_COMPONENT_IMAGES_DISPLAY_NAME "Images") SET(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Dynamic link library") +SET(CPACK_COMPONENT_PYTHONAPI_DESCRIPTION "UHD Python API") SET(CPACK_COMPONENT_HEADERS_DESCRIPTION "C++ development headers") SET(CPACK_COMPONENT_UTILITIES_DESCRIPTION "Utility executables and python scripts") SET(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Example executables") @@ -151,8 +154,7 @@ SET(CPACK_COMPONENT_UTILITIES_DEPENDS libraries) SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries) SET(CPACK_COMPONENT_TESTS_DEPENDS libraries) -SET(CPACK_COMPONENTS_ALL libraries headers utilities examples manual doxygen readme images) - +SET(CPACK_COMPONENTS_ALL libraries pythonapi headers utilities examples manual doxygen readme images) ######################################################################## # Setup CPack Debian ######################################################################## diff --git a/host/python/CMakeLists.txt b/host/python/CMakeLists.txt index a650529fa..92c4daadc 100644 --- a/host/python/CMakeLists.txt +++ b/host/python/CMakeLists.txt @@ -56,11 +56,7 @@ ADD_CUSTOM_TARGET(pyuhd_library ALL DEPENDS ${TIMESTAMP_FILE} pyuhd) IF(HAVE_PYTHON_VIRTUALENV) INSTALL(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} -q install --force)") ELSE() - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c - "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix=''))" - OUTPUT_VARIABLE UHD_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE - ) + SET(UHD_PYTHON_DIR "lib/site-packages") MESSAGE(STATUS "Utilizing the python install directory: ${CMAKE_INSTALL_PREFIX}/${UHD_PYTHON_DIR}") - INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/uhd DESTINATION ${CMAKE_INSTALL_PREFIX}/${UHD_PYTHON_DIR}) + INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/uhd DESTINATION ${UHD_PYTHON_DIR} COMPONENT pythonapi) ENDIF() - |