From f23d6bb1191fba88708a98b7ff0d15addeb22f1f Mon Sep 17 00:00:00 2001 From: Michel Schmid Date: Fri, 16 Feb 2024 19:23:23 +0100 Subject: [PATCH] tmp --- .github/workflows/build.yaml | 5 +++-- CMakeLists.txt | 7 +++++-- cmake/modules/FindOrBuildProtobuf.cmake | 2 +- vcpkg.json | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b4f29a9..8c7049d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -47,14 +47,14 @@ 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: @@ -62,3 +62,4 @@ jobs: # 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" diff --git a/CMakeLists.txt b/CMakeLists.txt index 282582a..758ddf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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_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/cmake/*") +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) @@ -87,7 +90,7 @@ if(BUILD_ODE) include(BuildODE) add_dependencies(${app} ode_external) else() - set(CMAKE_PREFIX_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) diff --git a/cmake/modules/FindOrBuildProtobuf.cmake b/cmake/modules/FindOrBuildProtobuf.cmake index 401f1e0..ffabc85 100644 --- a/cmake/modules/FindOrBuildProtobuf.cmake +++ b/cmake/modules/FindOrBuildProtobuf.cmake @@ -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_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() diff --git a/vcpkg.json b/vcpkg.json index 89c2f3c..2d65acc 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -2,7 +2,7 @@ "name": "grsim", "version-string": "0.0.1", "dependencies": [ - "qt5-base", + "qt5", "ode", "protobuf" ]