From c1058bdb21ed2059e32959b6f4dc84938f1c263c Mon Sep 17 00:00:00 2001 From: Christoph Alt <christoph.alt@fau.de> Date: Fri, 21 Feb 2025 12:00:50 +0100 Subject: [PATCH] also calling cmake make-find-module on custom python venvs --- standalone/CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/standalone/CMakeLists.txt b/standalone/CMakeLists.txt index 8b380f7..8963be3 100644 --- a/standalone/CMakeLists.txt +++ b/standalone/CMakeLists.txt @@ -54,20 +54,20 @@ if (CODEGEN_PRIVATE_VENV) message( WARNING "Could not find ${CODEGEN_VENV_REQUIREMENTS}" ) endif() - # get the find pystencils-sfg file - execute_process( - COMMAND ${PystencilsSfg_PYTHON_INTERPRETER} -m pystencilssfg cmake make-find-module - WORKING_DIRECTORY ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR} - ) - # renaming it - file(RENAME ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/FindPystencilsSfg.cmake ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/pystencilssfg-config.cmake) - - # Find it - find_package( PystencilsSfg REQUIRED ) - set( _sfg_private_venv_done TRUE CACHE BOOL "" ) mark_as_advanced(_sfg_private_venv_done) endif() set(_sfg_cache_python_init ${_venv_python_exe}) set(PystencilsSfg_PYTHON_INTERPRETER ${_sfg_cache_python_init} CACHE PATH "Path to the Python executable used to run pystencils-sfg") endif() + +# get the find pystencils-sfg file +execute_process( + COMMAND ${PystencilsSfg_PYTHON_INTERPRETER} -m pystencilssfg cmake make-find-module + WORKING_DIRECTORY ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR} +) +# renaming it +file(RENAME ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/FindPystencilsSfg.cmake ${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/pystencilssfg-config.cmake) + +# Find it +find_package( PystencilsSfg REQUIRED ) -- GitLab