Skip to content

Commit

Permalink
Use VCPKG_OVERLAY_PORTS and VCPKG_OVERLAY_TRIPLETS as cmake variables…
Browse files Browse the repository at this point in the history
… instead of env variables
  • Loading branch information
lilleyse committed Sep 10, 2024
1 parent 7ecb171 commit edf29c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ endif()

message(STATUS "VCPKG_TRIPLET ${VCPKG_TRIPLET}")

if (NOT VCPKG_OVERLAY_PORTS)
if (DEFINED ENV{VCPKG_OVERLAY_PORTS})
set(VCPKG_OVERLAY_PORTS "$ENV{VCPKG_OVERLAY_PORTS}")
endif()
endif()

message(STATUS "VCPKG_OVERLAY_PORTS ${VCPKG_OVERLAY_PORTS}")

if (NOT VCPKG_OVERLAY_TRIPLETS)
if (DEFINED ENV{VCPKG_OVERLAY_TRIPLETS})
set(VCPKG_OVERLAY_TRIPLETS "$ENV{VCPKG_OVERLAY_TRIPLETS}")
endif()
endif()

message(STATUS "VCPKG_OVERLAY_TRIPLETS ${VCPKG_OVERLAY_TRIPLETS}")

# These packages are used in the public headers of Cesium libraries, so we need to distribute the headers and binaries
# with the installation
# Note that fmt is a public dependency of the vcpkg version of spdlog
Expand Down
14 changes: 12 additions & 2 deletions cmake/ezvcpkg/ezvcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,21 @@ endmacro()


macro(EZVCPKG_BUILD)
set(INSTALL_COMMAND ${EZVCPKG_EXE} --vcpkg-root ${EZVCPKG_DIR} install --triplet ${VCPKG_TRIPLET})

if (DEFINED VCPKG_OVERLAY_PORTS)
set(INSTALL_COMMAND ${INSTALL_COMMAND} --overlay-ports "${VCPKG_OVERLAY_PORTS}")
endif()

if (DEFINED VCPKG_OVERLAY_TRIPLETS)
set(INSTALL_COMMAND ${INSTALL_COMMAND} --overlay-triplets "${VCPKG_OVERLAY_TRIPLETS}")
endif()

if (EZVCPKG_SERIALIZE)
foreach(_PACKAGE ${EZVCPKG_PACKAGES})
message(STATUS "EZVCPKG Building/Verifying package ${_PACKAGE} using triplet ${VCPKG_TRIPLET}")
execute_process(
COMMAND ${EZVCPKG_EXE} --vcpkg-root ${EZVCPKG_DIR} install --triplet ${VCPKG_TRIPLET} ${_PACKAGE}
COMMAND ${INSTALL_COMMAND} ${_PACKAGE}
WORKING_DIRECTORY ${EZVCPKG_DIR}
RESULTS_VARIABLE EZVCPKG_RESULT
OUTPUT_VARIABLE EZVCPKG_OUTPUT
Expand All @@ -187,7 +197,7 @@ macro(EZVCPKG_BUILD)
else()
message(STATUS "EZVCPKG Building/Verifying packages ${EZVCPKG_PACKAGES} using triplet ${VCPKG_TRIPLET}")
execute_process(
COMMAND ${EZVCPKG_EXE} --vcpkg-root ${EZVCPKG_DIR} install --triplet ${VCPKG_TRIPLET} ${EZVCPKG_PACKAGES}
COMMAND ${EZVCPKG_EXE} ${INSTALL_COMMAND} ${EZVCPKG_PACKAGES}
WORKING_DIRECTORY ${EZVCPKG_DIR}
RESULTS_VARIABLE EZVCPKG_RESULT
OUTPUT_VARIABLE EZVCPKG_OUTPUT
Expand Down

0 comments on commit edf29c3

Please sign in to comment.