diff --git a/cmake/Modules/VolkPython.cmake b/cmake/Modules/VolkPython.cmake index 0a839c84..629d6d79 100644 --- a/cmake/Modules/VolkPython.cmake +++ b/cmake/Modules/VolkPython.cmake @@ -140,7 +140,7 @@ file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR) # Usage: VOLK_UNIQUE_TARGET( ) ######################################################################## function(VOLK_UNIQUE_TARGET desc) - file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + file(RELATIVE_PATH reldir ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib unique = hashlib.sha256(b'${reldir}${ARGN}').hexdigest()[:5] @@ -259,3 +259,16 @@ function(VOLK_PYTHON_INSTALL) volk_unique_target("pygen" ${python_install_gen_targets}) endfunction(VOLK_PYTHON_INSTALL) + +######################################################################## +# Write the python helper script that generates byte code files +######################################################################## +file( + WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py + " +import sys, py_compile +files = sys.argv[1:] +srcs, gens = files[:len(files)//2], files[len(files)//2:] +for src, gen in zip(srcs, gens): + py_compile.compile(file=src, cfile=gen, doraise=True) +") diff --git a/python/volk_modtool/CMakeLists.txt b/python/volk_modtool/CMakeLists.txt index 92299aae..5f0f066c 100644 --- a/python/volk_modtool/CMakeLists.txt +++ b/python/volk_modtool/CMakeLists.txt @@ -6,19 +6,6 @@ # SPDX-License-Identifier: LGPL-3.0-or-later # -######################################################################## -# Write the python helper script that generates byte code files -######################################################################## -file( - WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py - " -import sys, py_compile -files = sys.argv[1:] -srcs, gens = files[:len(files)//2], files[len(files)//2:] -for src, gen in zip(srcs, gens): - py_compile.compile(file=src, cfile=gen, doraise=True) -") - ######################################################################## # Install python files and apps ########################################################################