Skip to content

Commit

Permalink
Handle building manually in a venv
Browse files Browse the repository at this point in the history
  • Loading branch information
bindreams committed May 1, 2024
1 parent 1aaf30b commit b30dcbd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/zint/scripts/cmake/find-packages-from-python.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
execute_process(
COMMAND ${Python3_EXECUTABLE} -m site --user-site
OUTPUT_VARIABLE Python3_USERSITELIB
COMMAND_ERROR_IS_FATAL ANY
RESULT_VARIABLE EXIT_CODE
)
string(STRIP "${Python3_USERSITELIB}" Python3_USERSITELIB)

if (EXIT_CODE GREATER_EQUAL 2)
message(FATAL_ERROR "Unknown error getting user site-packages.")
endif()

if (EXIT_CODE EQUAL 0)
string(STRIP "${Python3_USERSITELIB}" Python3_USERSITELIB)
list(APPEND CMAKE_PREFIX_PATH "${Python3_USERSITELIB}")
endif()

list(APPEND CMAKE_PREFIX_PATH "${Python3_SITELIB}")
message(STATUS "Appended ${Python3_SITELIB} and ${Python3_USERSITELIB} to the list of cmake prefixes")
list(APPEND CMAKE_PREFIX_PATH "${Python3_USERSITELIB}" "${Python3_SITELIB}")

0 comments on commit b30dcbd

Please sign in to comment.