From: Anthony Geay Date: Thu, 30 Aug 2018 15:41:31 +0000 (+0200) Subject: Remove pyo and pyc gen due to wrong dep bug on pyc and pyo generation on cmake 3.12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=89bf412818c17e4fcd17e523cf7fe0a0f589ad5b;p=tools%2Fconfiguration.git Remove pyo and pyc gen due to wrong dep bug on pyc and pyo generation on cmake 3.12 --- diff --git a/cmake/SalomeMacros.cmake b/cmake/SalomeMacros.cmake index d91eb4c..8a85fe8 100644 --- a/cmake/SalomeMacros.cmake +++ b/cmake/SalomeMacros.cmake @@ -129,24 +129,24 @@ MACRO(SALOME_INSTALL_SCRIPTS file_list path) GET_FILENAME_COMPONENT(ext ${file} EXT) GET_FILENAME_COMPONENT(we_ext ${file} NAME_WE) - IF(ext STREQUAL .py) - # Generate and install the pyc and pyo - # [ABN] Important: we avoid references or usage of CMAKE_INSTALL_PREFIX which is not correctly set - # when using CPack. - SET(_pyc_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.cpython-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.pyc") - SET(_pyo_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.cpython-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.opt-1.pyc") - LIST(APPEND _all_pyc ${_pyc_file}) - LIST(APPEND _all_pyo ${_pyo_file}) - ADD_CUSTOM_COMMAND( - OUTPUT ${_pyc_file} ${_pyo_file} - COMMAND ${PYTHON_EXECUTABLE} -c "from py_compile import compile; compile('${_source_prefix}${file}', '${_pyc_file}', doraise=True, optimize=0); compile('${_source_prefix}${file}', '${_pyo_file}', doraise=True, optimize=1)" - DEPENDS ${PREFIX}${file} - VERBATIM - ) - # Install the .pyo and the .pyc - INSTALL(FILES ${_pyc_file} DESTINATION ${path}/__pycache__ PERMISSIONS ${PERMS}) - INSTALL(FILES ${_pyo_file} DESTINATION ${path}/__pycache__ PERMISSIONS ${PERMS}) - ENDIF(ext STREQUAL .py) + # IF(ext STREQUAL .py) + # # Generate and install the pyc and pyo + # # [ABN] Important: we avoid references or usage of CMAKE_INSTALL_PREFIX which is not correctly set + # # when using CPack. + # SET(_pyc_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.cpython-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.pyc") + # SET(_pyo_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.cpython-${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}.opt-1.pyc") + # LIST(APPEND _all_pyc ${_pyc_file}) + # LIST(APPEND _all_pyo ${_pyo_file}) + # ADD_CUSTOM_COMMAND( + # OUTPUT ${_pyc_file} ${_pyo_file} + # COMMAND ${PYTHON_EXECUTABLE} -c "from py_compile import compile; compile('${_source_prefix}${file}', '${_pyc_file}', doraise=True, optimize=0); compile('${_source_prefix}${file}', '${_pyo_file}', doraise=True, optimize=1)" + # DEPENDS "${PREFIX}${file}" + # VERBATIM + # ) + # # Install the .pyo and the .pyc + # INSTALL(FILES ${_pyc_file} DESTINATION ${path}/__pycache__ PERMISSIONS ${PERMS}) + # INSTALL(FILES ${_pyo_file} DESTINATION ${path}/__pycache__ PERMISSIONS ${PERMS}) + # ENDIF(ext STREQUAL .py) # get relative path (from CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR) STRING(REGEX REPLACE ${CMAKE_SOURCE_DIR} "" rel_dir ${CMAKE_CURRENT_SOURCE_DIR})