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

210 add linux support #211

Merged
merged 8 commits into from
Aug 30, 2024
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ This is an Acquire Driver that exposes Hamamatsu cameras via the [DCAM-SDK][].

- **Hamamatsu CP15440-20UP** Orca Fusion BT


## Experimental Linux Support

Early in 2024, Hammamatsu released the [DCAM-API Lite for Linux](https://www.hamamatsu.com/us/en/product/cameras/software/driver-software/dcam-api-lite-for-linux.html). This contains only the dynamic libraries needed at runtime. To build this module, one must still download the SDK (above) for the headers... but the (windows) libraries will be ignored.

[DCAM-SDK]: https://dcam-api.com/sdk-download/
25 changes: 16 additions & 9 deletions cmake/hdcam.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Locates the Hamamatus DCAM-SDK
# Locates the Hamamatsu DCAM-SDK
#
# In general, if you install the SDK somewhere on your system environment's
# PATH, cmake will be able to find it.
Expand All @@ -7,20 +7,27 @@
# folders should be on the system path.
find_path(DCAMSDK_ROOT_DIR
NAMES "dcamsdk4/inc/dcamapi4.h"
PATH_SUFFIXES "Hamamatsu_DCAMSDK4_v22126552"
PATH_SUFFIXES
"Hamamatsu_DCAMSDK4_v22126552"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nclack @aliddell , are we ok adding another possible version of the SDK? It isn't readily apparent how to download older versions from their website.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's probably worth forcing the upgrade to just use the latest. Or maybe there's a way to glob on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets upgrade. Not sure what you mean re glob @aliddell. Let me know what version is best and I'll install it on the test machine.

"Hamamatsu_DCAMSDK4_v24026764"
DOC "Hamamatsu DCAM-SDK location"
NO_CACHE
)


if(DCAMSDK_ROOT_DIR)
message(STATUS "DCAM-SDK found: ${DCAMSDK_ROOT_DIR}")

set(tgt hdcam)
add_library(${tgt} STATIC IMPORTED GLOBAL)
target_include_directories(${tgt} INTERFACE ${DCAMSDK_ROOT_DIR}/dcamsdk4/inc)
set_target_properties(${tgt} PROPERTIES
IMPORTED_LOCATION ${DCAMSDK_ROOT_DIR}/dcamsdk4/lib/win64/dcamapi.lib
)
# only do the following if pulling libs from the SDK (windows only)
# for other platforms one must separately install the DCAM API
if (WIN32)
set(tgt hdcam)
add_library(${tgt} STATIC IMPORTED GLOBAL)
target_include_directories(${tgt} INTERFACE ${DCAMSDK_ROOT_DIR}/dcamsdk4/inc)
set_target_properties(${tgt} PROPERTIES
IMPORTED_LOCATION ${DCAMSDK_ROOT_DIR}/dcamsdk4/lib/win64/dcamapi.lib
)
endif()
else()
message(STATUS "DCAM-SDK NOT FOUND")
message(FATAL_ERROR "DCAM-SDK NOT FOUND")
endif()
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ if (TARGET hdcam)
dcam.driver.c
dcam.camera.h)
target_link_libraries(${tgt}
hdcam
acquire-core-platform
acquire-core-logger
acquire-device-kit
acquire-device-hal
)
if(WIN32)
message(STATUS "Linking static libs provided by SDK")
target_link_libraries(${tgt} hdcam)
endif()
else ()
add_library(${tgt} MODULE
unsupported.driver.c
Expand All @@ -32,6 +35,8 @@ else ()
)
endif ()

target_include_directories(${tgt} PRIVATE ${DCAMSDK_ROOT_DIR}/dcamsdk4/inc)

target_enable_simd(${tgt})
set_target_properties(${tgt} PROPERTIES
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
Expand Down
Loading