diff --git a/README.md b/README.md index 27a0a14..6e542d3 100644 --- a/README.md +++ b/README.md @@ -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/ diff --git a/cmake/hdcam.cmake b/cmake/hdcam.cmake index ce9d88c..42d293b 100644 --- a/cmake/hdcam.cmake +++ b/cmake/hdcam.cmake @@ -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. @@ -14,15 +14,20 @@ find_path(DCAMSDK_ROOT_DIR 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() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba73a0d..16b9ed8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 @@ -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$<$:Debug>"