CloudCompare’s python plugin installation stuck with cmake

  cmake, dll, python, visual-studio

I am quite new to coding. so this could be a stupid mistake from my side but pls do help me.

while trying to installing the python plugin,by generating a .dll file and I got stuck at the 5th step (Generate the cmake config) on the documentation (https://github.com/tmontaigu/CloudCompare-PythonPlugin/blob/master/docs/building.rst).

I am using windows 10, CloudCompare v2.12 alpha 64 bit.

my cmake error’s screenshot is here
CMake Error

my CMakeLists.txt is here

cmake_minimum_required(VERSION 3.21)
include(cmake/helpers.cmake)
include(cmake/CompilerWarnings.cmake)

option(PLUGIN_PYTHON "Install Python Plugin" OFF)

if(PLUGIN_PYTHON)
  project(PythonPlugin)

  addplugin(NAME ${PROJECT_NAME})

  # set_project_warnings(${PROJECT_NAME})

  option(PLUGIN_PYTHON_USE_EMBEDDED_MODULES
         "Should the Python wrapper libs be embedded in the plugin" ON
  )
  mark_as_advanced(PLUGIN_PYTHON_USE_EMBEDDED_MODULES)

  if(WIN32)
    option(PLUGIN_PYTHON_COPY_ENV
           "Should the content of the current python venv be copied on install"
           ON
    )
    mark_as_advanced(PLUGIN_PYTHON_COPY_ENV)

    if(NOT PYTHON_EXECUTABLE)
      if(DEFINED ENV{CONDA_PREFIX})
        list(INSERT CMAKE_PREFIX_PATH 0
             "$ENV{CONDA_PREFIX}/Library/share/cmake"
        )
        set(PYTHON_EXECUTABLE "$ENV{CONDA_PREFIX}/python.exe")
      elseif(DEFINED ENV{VIRTUAL_ENV})
        set(PYTHON_EXECUTABLE "$ENV{VENV_PREFIX}/Scripts/python.exe")
      endif()
    endif()
  endif()

  if(PYTHON_EXECUTABLE)
    execute_process(
      COMMAND "${PYTHON_EXECUTABLE}" "-m" "pybind11" "--cmake"
      RESULT_VARIABLE _PYTHON_SUCCESS
      OUTPUT_VARIABLE PYBIND11_CMAKE_MODULES_PATH
    )

    if(_PYTHON_SUCCESS MATCHES 0)
      string(REGEX REPLACE "n" "" PYBIND11_CMAKE_MODULES_PATH
                           ${PYBIND11_CMAKE_MODULES_PATH}
      )
      list(INSERT CMAKE_PREFIX_PATH 0 "${PYBIND11_CMAKE_MODULES_PATH}")
    endif()
  endif()

  find_package(pybind11 CONFIG REQUIRED)

  add_subdirectory(wrapper)
  add_subdirectory(src)

  if(PLUGIN_PYTHON_USE_EMBEDDED_MODULES)
    target_compile_definitions(PythonPlugin PRIVATE -DUSE_EMBEDDED_MODULES)

    embed_cccorelib_in(${PROJECT_NAME})
    embed_pycc_in(${PROJECT_NAME})
  endif()

  target_link_libraries(PythonPlugin pybind11::embed)
  set_target_properties(PythonPlugin PROPERTIES CXX_VISIBILITY_PRESET hidden)

  if(WIN32)
    manage_windows_install()
  elseif(UNIX AND NOT APPLE)
    if(NOT PLUGIN_PYTHON_USE_EMBEDDED_MODULES)
      installsharedlibrary(TARGET cccorelib)
      installsharedlibrary(TARGET pycc)
    endif()
  endif()
endif()

after the generation of pyccvenv virtual environment, my python.exe is placed at C:WindowsSystem32pyccvenvScriptspython.exe

if these informations are sufficient please do help me.
and I would also like to know if it is possible to install the plugin with the .dll file that’s been already generated by someone else, if yes please do share the python plugin’s .dll file so that my installation will be at ease

Source: Python Questions

LEAVE A COMMENT