remove dependency on Python distutils
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35a7ae3..9a4ecdd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,12 +40,6 @@
endif()
find_package(Python REQUIRED COMPONENTS Interpreter)
-execute_process(
- COMMAND ${Python_EXECUTABLE} -c
- "from distutils import sysconfig; print(sysconfig.get_python_lib(prefix=''))"
- OUTPUT_VARIABLE PYTHON_INSTDIR
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
if(nanopb_BUILD_GENERATOR)
set(generator_protos nanopb)
@@ -62,13 +56,13 @@
install(
FILES ${PROJECT_BINARY_DIR}/${generator_proto_py_file}
${generator_proto_file}
- DESTINATION ${PYTHON_INSTDIR}/proto/
+ DESTINATION ${Python_SITELIB}/proto/
)
endforeach()
endif()
install(FILES generator/proto/_utils.py
- DESTINATION ${PYTHON_INSTDIR}/proto/)
+ DESTINATION ${Python_SITELIB}/proto/)
if(WIN32)
install(
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index bb4018f..e40f18b 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -18,7 +18,7 @@
try:
# Add some dummy imports to keep packaging tools happy.
- import google, distutils.util # bbfreeze seems to need these
+ import google # bbfreeze seems to need these
import pkg_resources # pyinstaller / protobuf 2.5 seem to need these
import proto.nanopb_pb2 as nanopb_pb2 # pyinstaller seems to need this
import pkg_resources.py2_warn