Skip to content

Commit

Permalink
Added drivers as static dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Jegp committed Jan 6, 2025
1 parent 30ae8ea commit abaf8ce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@ endif()
find_package(libcaer REQUIRED)

# Initialize lists for sources and libraries
set(input_libraries "")
set(driver_input_libraries "")

# Add Metavision if found
if (${MetavisionSDK_FOUND})
message(STATUS "Prophesee dependencies (Metavision) found at ${MetavisionSDK_DIR}")
add_library(prophesee INTERFACE)
target_sources(prophesee INTERFACE src/cpp/prophesee.hpp)
target_link_libraries(prophesee INTERFACE MetavisionSDK::core MetavisionSDK::stream)
target_include_directories(prophesee INTERFACE ${MetavisionSDK_INCLUDE_DIRS})
add_library(prophesee STATIC)
target_sources(prophesee PRIVATE src/cpp/prophesee.hpp)
target_link_libraries(prophesee PRIVATE MetavisionSDK::core MetavisionSDK::stream)
target_include_directories(prophesee PRIVATE ${MetavisionSDK_INCLUDE_DIRS})
set_property(TARGET prophesee PROPERTY LINKER_LANGUAGE CXX)
list(APPEND input_libraries prophesee)
list(APPEND driver_input_libraries prophesee)
endif()

# Add libcaer if found
if (${libcaer_FOUND})
message(STATUS "Inivation dependencies (libcaer) found at ${libcaer_DIR}")
add_library(inivation INTERFACE)
target_sources(inivation INTERFACE src/cpp/inivation.hpp)
target_link_libraries(inivation INTERFACE libcaer::caer)
target_include_directories(inivation INTERFACE ${libcaer_INCLUDE_DIRS})
add_library(inivation STATIC)
target_sources(inivation PRIVATE src/cpp/inivation.hpp)
target_link_libraries(inivation PRIVATE libcaer::caer)
target_include_directories(inivation PRIVATE ${libcaer_INCLUDE_DIRS})
set_property(TARGET inivation PROPERTY LINKER_LANGUAGE CXX)
list(APPEND input_libraries inivation)
list(APPEND driver_input_libraries inivation)
endif()

# Find Python and nanobind
Expand All @@ -64,7 +64,7 @@ nanobind_add_module(_event_camera_drivers
src/cpp/bindings.cpp
)
target_link_libraries(_event_camera_drivers PRIVATE
${input_libraries} # link the C++ libraries
${driver_input_libraries} # link the C++ libraries
)
target_include_directories(_event_camera_drivers PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/event_camera_drivers.cpp)

Expand Down
1 change: 0 additions & 1 deletion src/cpp/inivation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class InivationCamera {
handle = std::get<0>(found_device.value());
resolution_x = std::get<1>(found_device.value());
resolution_y = std::get<2>(found_device.value());
std::cout << "InivationCamera: Found device" << std::endl;
} else {
throw std::invalid_argument("No inivation device found.");
}
Expand Down

0 comments on commit abaf8ce

Please sign in to comment.