-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ability to create Windows python venv with cmake
- Loading branch information
1 parent
f9f3c48
commit 5eac56a
Showing
5 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
six==1.16.0 | ||
html5lib==1.1 | ||
regex==2024.5.15 | ||
css-parser==1.0.10 | ||
cssselect==1.2.0 | ||
urllib3==2.2.2 | ||
certifi==2024.6.2 | ||
dulwich==0.22.1 | ||
chardet==5.2.0 | ||
pillow==10.3.0 | ||
lxml==5.2.2 | ||
shiboken6@https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/shiboken6-6.7.3-6.7.3-cp311-cp311-win_amd64.whl | ||
PySide6@https://github.com/dougmassay/win-qtwebkit-5.212/releases/download/v5.212-1/PySide6-6.7.3-6.7.3-cp311-cp311-win_amd64.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
if(NOT DEFINED QTVER) | ||
message(FATAL_ERROR "-DQTVER must be used if downloading custom Qt6") | ||
endif() | ||
|
||
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/Qt${QTVER}") | ||
message(STATUS "Downloading Custom Qt6 from developer's github...") | ||
set(QTURL "${WINQTURL}/Qt${QTVER}ci_x64_VS2022.7z") | ||
file(DOWNLOAD "${QTURL}" "${CMAKE_CURRENT_BINARY_DIR}/qt6.7z") | ||
file(ARCHIVE_EXTRACT INPUT "${CMAKE_CURRENT_BINARY_DIR}/qt6.7z" ) | ||
else() | ||
message(STATUS "Custom Qt6 has already been downloaded to ${CMAKE_CURRENT_BINARY_DIR}. Will try to use it.") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/sigilpy") | ||
find_package(Python3 3.9 COMPONENTS Interpreter) | ||
set(REQUIREMENTS "${PROJECT_SOURCE_DIR}/src/Resource_Files/python_pkg/winreqs.txt") | ||
# Create venv with system python | ||
message(STATUS "Creating virtual python environment in ${CMAKE_CURRENT_BINARY_DIR}/sigilpy") | ||
execute_process(COMMAND "${Python3_EXECUTABLE}" -m venv "${CMAKE_CURRENT_BINARY_DIR}/sigilpy") | ||
# Pip install -r requirements.txt into venv | ||
message(STATUS "Downloading/installing required python modules into venv using pip requirements file: ${REQUIREMENTS}") | ||
execute_process(COMMAND "${CMAKE_CURRENT_BINARY_DIR}/sigilpy/Scripts/python.exe" -m pip install -r "${REQUIREMENTS}") | ||
# Unset system python so venv python can be found | ||
unset(Python3_EXECUTABLE) | ||
else() | ||
# Try to reuse venv if already present | ||
message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/sigilpy already exists. Will try to use it.") | ||
set (Python3_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/sigilpy/Scripts/python.exe") | ||
endif() |