Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Support "compiling" source files exclusively to .pyc #1192

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Mar 20, 2024

  1. ENH: Support "compiling" source file exclusively to .pyc

    Introduce the option CTK_COMPILE_PYTHON_SCRIPT_SKIP_SCRIPT_COPY
    to support disabling the copy of `*.py` script into the build
    directory.
    
    Update CMake function `ctkFunctionAddCompilePythonScriptTargets` to
    accept the `SKIP_SCRIPT_COPY` option.
    
    Update CMake macro `ctkMacroCompilePythonScript` to call `ctkFunctionAddCompilePythonScriptTargets`
    passing SKIP_SCRIPT_COPY based on the value of CTK_COMPILE_PYTHON_SCRIPT_SKIP_SCRIPT_COPY
    
    Address warning when using CMake >= 3.13, setting CMP0077 to NEW.
    See https://cmake.org/cmake/help/latest/policy/CMP0077.html
    
    Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
    MujassimJamal and jcfr committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    cbf0111 View commit details
    Browse the repository at this point in the history
  2. ENH: Support "compiling" source file exclusively to .pyc

    Introduce the option CTK_COMPILE_PYTHON_SCRIPT_KEEP_ONLY_PYC
    to support remove `*.py` scripts once the corresponding `.pyc`
    file has been generated in the destination directory.
    
    Update `_ctk_add_compile_python_directories_target` to accept `keep_only_pyc` argument.
    
    Update CMake function `ctkFunctionAddCompilePythonScriptTargets` to
    accept the `KEEP_ONLY_PYC` option and call `_ctk_add_compile_python_directories_target`
    accordingly.
    
    Update CMake macro `ctkMacroCompilePythonScript` to call `ctkFunctionAddCompilePythonScriptTargets`
    passing KEEP_ONLY_PYC based on the value of `CTK_COMPILE_PYTHON_SCRIPT_KEEP_ONLY_PYC`.
    
    Address warning when using CMake >= 3.13, setting CMP0077 to NEW.
    See https://cmake.org/cmake/help/latest/policy/CMP0077.html
    
    Co-authored-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
    jcfr committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    103fc97 View commit details
    Browse the repository at this point in the history