Skip to content

Commit

Permalink
Add Vcpkg support
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jan 10, 2024
1 parent 0f87b94 commit ff5a483
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cmake/third_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

string(FIND "${CMAKE_TOOLCHAIN_FILE}" "conan_toolchain.cmake" FOUND_CONAN_TOOLCHAIN)
if(FOUND_CONAN_TOOLCHAIN GREATER_EQUAL 0)
set(BUILD_TRIGGERED_BY_CONAN TRUE)
string(FIND "${CMAKE_TOOLCHAIN_FILE}" "conan_toolchain.cmake" _result)
if(_result GREATER_EQUAL 0)
set(FOUND_CONAN_TOOLCHAIN TRUE)
endif()
string(FIND "${CMAKE_TOOLCHAIN_FILE}" "vcpkg.cmake" _result)
if(_result GREATER_EQUAL 0)
set(FOUND_VCPKG_TOOLCHAIN TRUE)
endif()


if(DEFINED VCPKG_TOOLCHAIN)
message(NOTICE "Vcpkg toolchain detected, disabling automatic dependency management")
set(USE_CONAN FALSE)
elseif(BUILD_TRIGGERED_BY_CONAN)
if(FOUND_CONAN_TOOLCHAIN)
message(NOTICE "Conan toolchain already in use, disabling automatic dependency management")
set(USE_CONAN FALSE)
elseif(FOUND_VCPKG_TOOLCHAIN)
message(NOTICE "Vcpkg toolchain already in use, disabling automatic dependency management")
set(USE_CONAN FALSE)
else()
option(USE_CONAN "Use Conan to automatically manage dependencies" TRUE)
endif()
Expand Down
15 changes: 15 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "velodyne-decoder",
"description": "Decoder for raw Velodyne packet data",
"version-string": "3.0.0",
"license": "BSD-3-Clause",
"homepage": "https://github.com/valgur/velodyne_decoder",
"maintainers": [
"Martin Valgur <[email protected]>"
],
"builtin-baseline": "c9919121dde6f61c0436adda94624636e041226b",
"dependencies": [
"yaml-cpp",
"ms-gsl"
]
}

0 comments on commit ff5a483

Please sign in to comment.