-
Notifications
You must be signed in to change notification settings - Fork 19
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
build: Powershell script to install dependencies for MSVC #2021
Open
RobBuchananCompPhys
wants to merge
91
commits into
develop
Choose a base branch
from
build/msvc
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
bdfa7c1
powershell script to install dependencies
RobBuchananCompPhys 42d77b1
updated script
RobBuchananCompPhys cbbbfec
add flag to use existing system qt
RobBuchananCompPhys 56ca8fd
only install qt6 via python if not system qt
RobBuchananCompPhys 3c2494b
flag bool
RobBuchananCompPhys ad699ee
ftgl paths, fix antlr executable path
RobBuchananCompPhys 00a1078
use correct ftgl paths
RobBuchananCompPhys ab06f47
pretty format output json
RobBuchananCompPhys 3dddf28
pretty format output json 2
RobBuchananCompPhys 68ca640
don't bother with json formatting for now
RobBuchananCompPhys f15cee7
add java executable to path
RobBuchananCompPhys 320da75
ammend ftgl path
RobBuchananCompPhys bf03bf6
ammend ftgl paths
RobBuchananCompPhys 3fd2e80
check python compiler version
RobBuchananCompPhys fe24b6a
properly activate python environment
RobBuchananCompPhys 2b711eb
update freetype lib paths
RobBuchananCompPhys 1e19986
revert to previous freetype paths for ftgl build
RobBuchananCompPhys f4f0d02
console output
RobBuchananCompPhys 19848ab
more console output
RobBuchananCompPhys b9793d1
paths to conan packages
RobBuchananCompPhys 74ef87d
enclose object field in quotation marks
RobBuchananCompPhys f9d3fe3
try to build without supplying unused cmake variables
RobBuchananCompPhys 3ed2431
allow debug and release dependencies
RobBuchananCompPhys c3ea2fa
fix path variable error
RobBuchananCompPhys dcd4a4d
capture installation config as cmake variable
RobBuchananCompPhys 87aa007
install
RobBuchananCompPhys 512b043
correct dependency locations for building CLI version
RobBuchananCompPhys d96c810
fix no newline eof
RobBuchananCompPhys 41e4300
warning colors, warn if qt version incorrect
RobBuchananCompPhys ed5d5ce
install dissolve gui dependencies
RobBuchananCompPhys c96eaf6
modularise visual studio workflow
RobBuchananCompPhys cca7b94
install choco
RobBuchananCompPhys 709af8e
missing header file (was in issue in visual studio build)
RobBuchananCompPhys 7ee7cca
reformat includes
RobBuchananCompPhys 22f5371
reformat cmake
RobBuchananCompPhys 9de60b1
developer docs
RobBuchananCompPhys 867a928
remove unused python package
RobBuchananCompPhys 4c99480
proper qt bin location
RobBuchananCompPhys 70773a0
attempt to overcome Freetype not found by passing FREETYPE_LIBRARY as…
RobBuchananCompPhys 6b78c69
freetype lib path
RobBuchananCompPhys 71b57f2
sensible font..
RobBuchananCompPhys be607bc
enhance package management and paths
RobBuchananCompPhys dbbbba5
keep python compiler condition
RobBuchananCompPhys 0ffd1b9
get cmake, assert python 3.12
RobBuchananCompPhys 1120a98
ammend python 3.12 install string
RobBuchananCompPhys bf09110
more freetype (gui build)
RobBuchananCompPhys 9eb060d
fix typo in freetype path
RobBuchananCompPhys c077ced
github ci workflow
RobBuchananCompPhys 0b191b4
ammed github ci workflow
RobBuchananCompPhys 879bdf0
isolate powershell script output in ci
RobBuchananCompPhys 775a62a
ci visual studio build
RobBuchananCompPhys 0ed94b7
explicitly use cl in ci build
RobBuchananCompPhys 395022c
try with different compiler path
RobBuchananCompPhys 732d241
try with different compiler path 2
RobBuchananCompPhys b22a6ea
try with different compiler path 3 (env var)
RobBuchananCompPhys f695352
restore to previous, leave out qt installation temporarily for speed
RobBuchananCompPhys 0ed94b2
check if cli works in one line
RobBuchananCompPhys cd063be
check if cli works in one line 2
RobBuchananCompPhys 81b7d49
nope.
RobBuchananCompPhys f78a355
try with custom msvc-dev-cmd action
RobBuchananCompPhys 7f0cb4e
shell
RobBuchananCompPhys 6bda9e5
fix duplicate item
RobBuchananCompPhys ca8f467
check env vars
RobBuchananCompPhys cc1410d
add path to conan
RobBuchananCompPhys b12ffda
add path to conan 2
RobBuchananCompPhys bf39a14
add path to conan 3
RobBuchananCompPhys 15acf1f
cached conan
RobBuchananCompPhys b6cd58e
try with visual studio x64 command line environemnt
RobBuchananCompPhys 167085d
remove # chars
RobBuchananCompPhys f689e36
quotes
RobBuchananCompPhys b5b55ec
go back to using pwsh
RobBuchananCompPhys 5ecd64a
try with chocolatey refreshenv
RobBuchananCompPhys 7df8525
see directory contents
RobBuchananCompPhys ea33f2d
see path to conan, does cl work
RobBuchananCompPhys 39ff10f
can we find conan
RobBuchananCompPhys f056bb7
is there even a conan
RobBuchananCompPhys b622253
try with bash
RobBuchananCompPhys d28d6a4
build dissolve cli
RobBuchananCompPhys d488fa3
can we get path vars directly
RobBuchananCompPhys 427a68a
add some checks on script
RobBuchananCompPhys 39a55f4
add some checks on script 2
RobBuchananCompPhys 1f7a347
add some checks on script 3 and try and build gui
RobBuchananCompPhys c2925a9
fix typo
RobBuchananCompPhys 64b70d4
try and build gui dissolve in workflow
RobBuchananCompPhys ad2d085
submodule
RobBuchananCompPhys 619da33
update docs
RobBuchananCompPhys 5c63864
build fails on unit test - try release
RobBuchananCompPhys c4d65d5
manage dependency version by argument
RobBuchananCompPhys 95be49e
env vars
RobBuchananCompPhys 3e75dea
env vars 2
RobBuchananCompPhys dc79a33
env vars 3
RobBuchananCompPhys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test MSVC (Visual Studio 2022) Developer Build | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'develop.ps1' | ||
branches: | ||
- '*' | ||
|
||
push: | ||
paths: | ||
- 'develop.ps1' | ||
branches: | ||
- 'develop' | ||
- 'release/**' | ||
|
||
jobs: | ||
|
||
Develop: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Develop MSVC | ||
uses: "./.github/workflows/visual-studio" | ||
with: | ||
publishType: 'none' |
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,40 @@ | ||
name: Develop MSVC | ||
description: Set up Dissolve CLI and GUI Visual Studio dev environment. | ||
|
||
inputs: | ||
publishType: | ||
type: choice | ||
default: 'none' | ||
options: | ||
- none | ||
- continuous | ||
- release | ||
- legacy | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: 'Set up MSVC toolchain' | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: x64 | ||
|
||
- name: 'Install dependencies' | ||
shell: pwsh | ||
run: | | ||
Set-Location ${{ github.workspace }} | ||
$env:qtVersion = "${{ env.qtVersion }}" | ||
Write-Output "Qt version is: $env:qtVersion" | ||
$env:antlrVersion = "${{ env.antlrVersion }}" | ||
Write-Output "ANTLR version is: $env:antlrVersion" | ||
./develop.ps1 -release -qtVersion $env:qtVersion -antlrVersion $env:antlrVersion | ||
|
||
|
||
- name: 'Configure and build with CMake' | ||
shell: bash | ||
run: | | ||
git submodule update --init --recursive | ||
export PATH="${{ github.workspace }}\msvc-env\Scripts;${{ github.workspace }}\dependencies\qt\${{ env.qtVersion }}\msvc2019_64\bin;$PATH" | ||
cmake --preset GUI-Release-MSVC | ||
cmake --build build |
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
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,45 @@ | ||
# Find and install dependencies for a Visual Studio 2022 dev environment | ||
function(setup_msvc) | ||
set(SEARCH_IN "${CMAKE_BINARY_DIR}") | ||
set(INSTALLATION_DIR "${SEARCH_IN}") | ||
|
||
set(ALL_INSTALL_FILES "") | ||
|
||
set(CONAN_DEPS ${_conan_requires}) | ||
list(APPEND CONAN_DEPS ${EXTRA_CONAN_REQUIRES}) | ||
|
||
# Find exe, dll and lib paths from Conan packages | ||
foreach (DEPENDENCY IN LISTS CONAN_DEPS) | ||
string(FIND ${DEPENDENCY} "/" SUBSTRING_AT) | ||
string(SUBSTRING ${DEPENDENCY} 0 "${SUBSTRING_AT}" SUB_DIR) | ||
|
||
set(SEARCH_IN ${CMAKE_BINARY_DIR}/${SUB_DIR}) | ||
|
||
file(GLOB CONAN_BIN "${SEARCH_IN}/bin/*.exe" "${SEARCH_IN}/bin/*.dll") | ||
file(GLOB CONAN_LIB "${SEARCH_IN}/lib/*.lib") | ||
|
||
set(CONAN_FILES ${CONAN_BIN}) | ||
list(APPEND CONAN_FILES ${CONAN_LIB}) | ||
|
||
list(APPEND ALL_INSTALL_FILES ${CONAN_FILES}) | ||
endforeach() | ||
|
||
# Find GUI dependencies (FTGL and Freetype) | ||
if(GUI) | ||
set(INSTALLATION_DIR "${CMAKE_BINARY_DIR}/bin") | ||
set(GUI_DEPENDENCIES_DIR "${CMAKE_BINARY_DIR}/../dependencies") | ||
|
||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") | ||
list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/ftgl-install/bin/ftgld.dll") | ||
list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/freetype-install/bin/freetyped.dll") | ||
else() | ||
list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/ftgl-install/bin/ftgl.dll") | ||
list(APPEND ALL_INSTALL_FILES "${GUI_DEPENDENCIES_DIR}/freetype-install/bin/freetype.dll") | ||
endif() | ||
endif() | ||
|
||
# Install all dependencies | ||
foreach(DEPENDENCY IN LISTS ALL_INSTALL_FILES) | ||
file(COPY ${DEPENDENCY} DESTINATION "${INSTALLATION_DIR}") | ||
endforeach() | ||
endfunction() |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just been taking a look at your changelog PR, and I can see there is a bit of harmonisation to do on my part here - agree that making these parameters into script arguments is a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My temptation would be to make make using the system qt the default option and the having a flag to specify installing a specific Qt version with that version as a parameter. Then the correct Qt version can easily be passed in on the CI. It also feels like a better default in that, if I don't have Qt installed and forget the flag, I could run it again with the flag to install Qt, but the current setup makes it easy to accidentally install two versions of Qt and doesn't provide any method for rectifying that problem.