2025-10-01 18:47:42 -04:00
|
|
|
cmake_dependent_option(ENABLE_STIMBUFFAPI_livoxGen1
|
|
|
|
|
"Enable Livox Gen1 LiDAR stim buff API" ON
|
2025-09-10 19:44:17 -04:00
|
|
|
"ENABLE_LIB_livoxProto1" OFF)
|
2025-09-05 00:08:25 -04:00
|
|
|
|
2025-10-01 18:47:42 -04:00
|
|
|
if(ENABLE_STIMBUFFAPI_livoxGen1)
|
|
|
|
|
# Set CONFIG variable for config.h
|
|
|
|
|
set(CONFIG_STIMBUFFAPI_LIVOXGEN1_ENABLED 1)
|
|
|
|
|
|
2025-11-01 21:30:47 -04:00
|
|
|
# Find liburing using pkg-config
|
|
|
|
|
pkg_check_modules(URING REQUIRED liburing)
|
|
|
|
|
|
2025-11-08 10:26:17 -04:00
|
|
|
# Enable assembly language
|
|
|
|
|
enable_language(ASM)
|
|
|
|
|
|
2025-09-05 00:08:25 -04:00
|
|
|
add_library(livoxGen1 SHARED
|
|
|
|
|
livoxGen1.cpp
|
2025-11-14 23:50:31 -04:00
|
|
|
pcloudStimulusProducer.cpp
|
2025-10-31 11:48:31 -04:00
|
|
|
ioUringAssemblyEngine.cpp
|
2025-11-08 01:48:56 -04:00
|
|
|
openClCollatingAndMeshingEngine.cpp
|
2025-11-08 10:26:17 -04:00
|
|
|
openClKernels.cl.S
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Set assembler working directory so .incbin can find the .cl file
|
2025-11-09 03:36:58 -04:00
|
|
|
# Also declare dependency on collateDgrams.cl and slotCompactor.cl
|
2025-11-08 10:26:17 -04:00
|
|
|
set_source_files_properties(openClKernels.cl.S PROPERTIES
|
|
|
|
|
COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR}"
|
2025-11-09 03:36:58 -04:00
|
|
|
OBJECT_DEPENDS
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/collateDgrams.cl;${CMAKE_CURRENT_SOURCE_DIR}/slotCompactor.cl"
|
2025-09-05 00:08:25 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_include_directories(livoxGen1 PUBLIC
|
|
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
|
${CMAKE_SOURCE_DIR}/commonLibs
|
2025-11-01 21:30:47 -04:00
|
|
|
${URING_INCLUDE_DIRS}
|
2025-11-06 01:20:02 -04:00
|
|
|
${OPENCL_INCLUDE_DIRS}
|
2025-09-05 00:08:25 -04:00
|
|
|
)
|
2025-11-03 22:18:45 -04:00
|
|
|
target_link_libraries(livoxGen1 PUBLIC
|
|
|
|
|
Boost::system
|
|
|
|
|
Boost::log
|
2025-11-01 21:30:47 -04:00
|
|
|
${URING_LIBRARIES}
|
2025-11-06 01:20:02 -04:00
|
|
|
${OPENCL_LIBRARIES}
|
2025-11-02 19:08:47 -04:00
|
|
|
attachmentSupport
|
2025-11-01 21:30:47 -04:00
|
|
|
)
|
|
|
|
|
target_link_directories(livoxGen1 PUBLIC
|
|
|
|
|
${URING_LIBRARY_DIRS}
|
2025-11-06 01:20:02 -04:00
|
|
|
${OPENCL_LIBRARY_DIRS}
|
2025-09-05 00:08:25 -04:00
|
|
|
)
|
|
|
|
|
|
2025-11-03 22:18:45 -04:00
|
|
|
# Verify Boost dynamic dependencies after build
|
|
|
|
|
add_custom_command(TARGET livoxGen1 POST_BUILD
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -DVERIFY_FILE="$<TARGET_FILE:livoxGen1>"
|
|
|
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/VerifyBoostDynamic.cmake
|
|
|
|
|
COMMENT "Verifying Boost dynamic dependencies for livoxGen1"
|
|
|
|
|
)
|
|
|
|
|
|
2025-09-05 00:08:25 -04:00
|
|
|
# Install rules
|
|
|
|
|
install(TARGETS livoxGen1 DESTINATION lib)
|
|
|
|
|
endif()
|