Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Schmid committed Feb 19, 2024
1 parent 8f845a9 commit 9d5e834
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,19 @@ jobs:
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
vcpkgDirectory: c:/vcpkg # folder must reside in c:\ otherwise qt wont install due to long path errors
# vcpkgDirectory: c:/vcpkg # folder must reside in c:\ otherwise qt wont install due to long path errors

- name: Run CMake and run vcpkg to build packages
uses: lukka/run-cmake@v10
with:
# this preset is needed to actually install the vcpkg dependencies
configurePreset: "ninja-multi-vcpkg"
configPresetAdditionalArgs: "[-DVCPKG_TARGET_TRIPLET=x64-windows]"
configurePresetAdditionalArgs: "['-DVCPKG_TARGET_TRIPLET=x64-windows']"
buildPreset: "ninja-multi-vcpkg"
buildPresetAdditionalArgs: "['--config Release']"
env:
# [OPTIONAL] Define the vcpkg's triplet you want to enforce, otherwise the default one
# for the hosting system will be automatically choosen (x64 is the default on all
# platforms, e.g. `x64-osx`).
VCPKG_DEFAULT_TRIPLET: "x64-windows"
# VCPKG_ROOT: "c:/vcpkg"
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ if(APPLE AND EXISTS /usr/local/opt/qt)
# it is not in the default /usr/local prefix.
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt")
endif()
set(CMAKE_PREFIX_PATH "<vcpkg path>/vcpkg_installed/x64-windows/share/qt5")
# set(vcpkg_children "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
file(GLOB vcpkg_children "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/*")
message(FATAL_ERROR ${vcpkg_children})
set(CMAKE_PREFIX_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/qt5")
find_package(Qt5 COMPONENTS Core Widgets OpenGL Network REQUIRED)
list(APPEND libs Qt5::Core Qt5::Widgets Qt5::OpenGL Qt5::Network)

Expand All @@ -87,7 +90,7 @@ if(BUILD_ODE)
include(BuildODE)
add_dependencies(${app} ode_external)
else()
set(CMAKE_PREFIX_PATH "<vcpkg path>/vcpkg_installed/x64-windows/share/ode")
set(CMAKE_PREFIX_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/ode")
if(WIN32)
find_package(ODE CONFIG)
set(ODE_LIB_NAME ODE::ODE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/FindOrBuildProtobuf.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# sanitize environment before find_package, because otherwise it also looks in the directory created for the ExternalProject
include(EnvHelper)
sanitize_env()
set(CMAKE_PREFIX_PATH "<vcpkg path>/vcpkg_installed/x64-windows/share/protobuf")
set(CMAKE_PREFIX_PATH "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/protobuf")
find_package(Protobuf 3.3.0)
restore_env()

Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "grsim",
"version-string": "0.0.1",
"dependencies": [
"qt5-base",
"qt5",
"ode",
"protobuf"
]
Expand Down

0 comments on commit 9d5e834

Please sign in to comment.