How do I just do `vcpkg install packages && cmake -DCMAKE_TOOLCHAIN_FILE=%vcpkg%\scripts\buildsystems\vcpkg.cmake"`?
Maybe I'm overcomplicating things, but I want to do:
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
git clone --depth=1 https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
.\vcpkg\vcpkg install libarchive
- name: build
run: |
md cmake-build-debug
cd cmake-build-debug
cmake .. -DCMAKE_TOOLCHAIN_FILE="..\vcpkg\scripts\buildsystems\vcpkg.cmake"
cmake --build .
shell: cmd
- name: test
run: ctest .
working-directory: cmake-build-debug
Except I want to cache everything vcpkg related. Happy to pin https://github.com/Microsoft/vcpkg to a specific commit hash.
How do I do this with run-cmake, without introducing vcpkg as a submodule?
(also preferably without a vcpkg.json)
Thanks,
PS: I tried one the examples with submodule ❌'d on https://github.com/marketplace/actions/run-vcpkg#samples… but it still required a submodule
@SamuelMarks if i get this right, this is the question: "how can I implement a pure workflow without using run-vcpkg (with or without run-cmake) and without having vcpkg as a submodule?"
I think the generic answer is to leverage actions/checkout.
A concrete example is in the pure workflow at lukka/CppCMakeVcpkgTemplate: note that this workflow is using vcpkg as a submodule, hence all you have to do in addition to that is to ensure the sources are on disk before they are going to be used (which is already nicely done in the workflow you shown in the question).
@lukka Yeah I'm trying to put it together https://github.com/offscale/libacquire/blob/1cc1da3/.github/workflows/github-actions.yml#L47-L99 (previous commit I tried using checkout)
Happy to use run-vcpkg, but I don't want vcpkg as a submodule. Also would prefer not to have a vcpkg.json.
@SamuelMarks closing stale issues. Feel free to continue discussion if needed.
@lukka My question remains, how do I replace my vcpkg cache hack with your run-cmake without adding a submodule?
(for bonus points: manifest mode caching)
@SamuelMarks you can use run-vcpkg with an explicit value for vcpkgDirectory input that points to the file system location where you want vcpkg to be checked out. If it is not a submodule, it will be automatically checked out in that location.
You also need to specify the Git commit id in vcpkgGitCommitId, which would not be needed if vcpkg was a submodule.
Guess other details are missing that depends on your requirements, but to give an idea:
- if vcpkg is going to be launched by CMake (e.g. by
run-cmakeor by plain invocation tocmake -DVCPKGTOOLCHAIN), everything should be working fine, but you need to double check the right locations are automatically cached. - if vcpkg is run by
run-vcpkgitself (i.e. runVcpkgInstall input istrue), then something else (not sure what) must be done that needs to be figure out.
Glad to help further if you have a workflow to reason on.
Closing this issue as stale since long time, let me know if you need any support @SamuelMarks, thanks!