Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Port Request] Allied Vision Vimba #43187

Open
Thieum opened this issue Jan 9, 2025 · 0 comments
Open

[New Port Request] Allied Vision Vimba #43187

Thieum opened this issue Jan 9, 2025 · 0 comments
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving.

Comments

@Thieum
Copy link
Contributor

Thieum commented Jan 9, 2025

Library name

Allied Vision Vimba

Library description

SDK for Allied Vision Camera

Source repository URL

https://www.alliedvision.com/en/products/vimba-sdk/#c1497

Project homepage (if different from the source repository)

https://www.alliedvision.com/en/products/vimba-sdk

Anything else that is useful to know when adding (such as optional features the library may have that should be included)

This would be a binary distribution as there is no source available for Vimba SDK (6.0, not VimbaX) as far as I know.

The package would have to install the sdk first, then use it as a source for the required component of the package.

I tried a first windows-only version, but there is still work to do with various parts of the package and support for linux:

function(copy_from_program_files)
    if(${TRIPLET_SYSTEM_ARCH} STREQUAL "x64")
        set(VIMBA_ARCH "Win64")
    else()
        set(VIMBA_ARCH "Win32")
    endif()


    set(LIBVIMBAFILEPATH "$ENV{ProgramW6432}/Allied Vision/Vimba_6.0/VimbaCPP/Lib/${VIMBA_ARCH}/VimbaCPP.lib")
    set(DLLVIMBAFILEPATH "$ENV{ProgramW6432}/Allied Vision/Vimba_6.0/VimbaCPP/Bin/${VIMBA_ARCH}")
    set(HEADERSPATH "$ENV{ProgramW6432}/Allied Vision/Vimba_6.0/VimbaCPP/Include")
    set(HEADERSCPATH "$ENV{ProgramW6432}/Allied Vision/Vimba_6.0/VimbaC/Include")
    set(COPYRIGHT "See https://www.alliedvision.com/en/products/vimba-sdk/ for the Vimba SDK license.")

    if (NOT EXISTS "${LIBVIMBAFILEPATH}")
        file(TO_NATIVE_PATH "${LIBVIMBAFILEPATH}" DISPLAY)
        message(FATAL_ERROR "Cannot find Vimba SDK installation. File does not exist: ${DISPLAY}")
    endif()

    #install(DIRECTORY "${HEADERSPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/include/Vimba")
    file(INSTALL "${HEADERSPATH}/AncillaryData.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/BasicLockable.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Camera.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Camera.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/EnumEntry.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/EnumEntry.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Feature.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Feature.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/FeatureContainer.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/FeatureContainer.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/FileLogger.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Frame.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/ICameraFactory.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/ICameraListObserver.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/IFeatureObserver.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/IFrameObserver.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/IInterfaceListObserver.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Interface.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Interface.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/IRegisterDevice.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/LoggerDefines.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/Mutex.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/SharedPointer.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/SharedPointerDefines.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/SharedPointer_impl.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/UserLoggerDefines.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/UserSharedPointerDefines.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/VimbaCPP.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/VimbaCPPCommon.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/VimbaSystem.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")
    file(INSTALL "${HEADERSPATH}/VimbaSystem.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaCPP/Include")

    file(INSTALL "${HEADERSCPATH}/VimbaC.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaC/Include")
    file(INSTALL "${HEADERSCPATH}/VmbCommonTypes.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/VimbaC/Include")

    file(INSTALL "${LIBVIMBAFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
    file(INSTALL "${LIBVIMBAFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")

    #install(DIRECTORY "${DLLVIMBAFILEPATH}" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
    file(INSTALL "${DLLVIMBAFILEPATH}/VimbaC.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
    file(INSTALL "${DLLVIMBAFILEPATH}/VimbaCPP.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")

    file(INSTALL "${DLLVIMBAFILEPATH}/VimbaC.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
    file(INSTALL "${DLLVIMBAFILEPATH}/VimbaCPPd.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")

    file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}")
    file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${COPYRIGHT}")
endfunction()

function(copy_from_opt_folder)
    # TODO
endfunction()

if(VCPKG_TARGET_IS_WINDOWS)
    copy_from_program_files()
    configure_file("${CMAKE_CURRENT_LIST_DIR}/vimba.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/vimba.pc" @ONLY)
    if(NOT VCPKG_BUILD_TYPE)
        file(COPY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/vimba.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
    endif()

    vcpkg_fixup_pkgconfig()
elseif(VCPKG_TARGET_IS_LINUX)
    copy_from_opt_folder()
    vcpkg_fixup_pkgconfig()
else()
    set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
endif()

#file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

Vimba C examples refers to Vmb packages in their CMake, so there could some existing files too (but it could be vimbaX only too):

https://github.com/alliedvision/VmbC_Examples/blob/dev/ActionCommands/CMakeLists.txt

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/vmb_cmake_prefix_paths.cmake")
    # read hardcoded package location information, if the example is still located in the original install location
    include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/vmb_cmake_prefix_paths.cmake)
endif()

find_package(Vmb REQUIRED COMPONENTS C NAMES Vmb VmbC VmbCPP VmbImageTransform)

@Thieum Thieum added category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving. labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:good-first-issue This issue would be a good issue to get one's feet wet in solving.
Projects
None yet
Development

No branches or pull requests

1 participant