Skip to content

Commit

Permalink
Fix wrong library name replacement problem
Browse files Browse the repository at this point in the history
  • Loading branch information
cool-wuzh committed Jun 25, 2024
1 parent 017f118 commit 00307f8
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion examples/0.basic.enumerate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_enumerate)
add_executable(ob_enumerate enumerate.cpp)

set_property(TARGET ob_enumerate PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_enumerate ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_enumerate ob::openobsdk ob::examples::common opencv::opencv)
set_target_properties (ob_enumerate PROPERTIES FOLDER "Examples")

target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
Expand Down
2 changes: 1 addition & 1 deletion examples/0.basic.quick_start/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_quick_start)
add_executable(ob_quick_start quick_start.cpp)

set_property(TARGET ob_quick_start PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_quick_start ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_quick_start ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties (ob_quick_start PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/1.stream.color/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include/libobsensor)
add_executable(ob_color color.cpp)

set_property(TARGET ob_color PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_color ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_color ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties (ob_color PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/1.stream.depth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ add_executable(${PROJECT_NAME} depth.cpp)

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)

target_link_libraries(${PROJECT_NAME} ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(${PROJECT_NAME} ob::openobsdk ob::examples::common opencv::opencv)

target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)

Expand Down
2 changes: 1 addition & 1 deletion examples/1.stream.imu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_imu)
add_executable(ob_imu imu.cpp)

set_property(TARGET ob_imu PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_imu ob::libobsensor ob::examples::common)
target_link_libraries(ob_imu ob::openobsdk ob::examples::common)

set_target_properties(ob_imu PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/1.stream.infrared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_infrared)
add_executable(ob_infrared infrared.cpp)

set_property(TARGET ob_infrared PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_infrared ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_infrared ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties (ob_infrared PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/1.stream.multi_streams/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_multi_streams)
add_executable(ob_multi_streams multi_streams.cpp)

set_property(TARGET ob_multi_streams PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_multi_streams ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_multi_streams ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties(ob_multi_streams PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/2.device.control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_sensor_control)
add_executable(${PROJECT_NAME} sensor_control.cpp)

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME} ob::libobsensor ob::examples::common )
target_link_libraries(${PROJECT_NAME} ob::openobsdk ob::examples::common )

set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/2.device.hot_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_hot_plugin)
add_executable(${PROJECT_NAME} hot_plugin.cpp)

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME} ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(${PROJECT_NAME} ob::openobsdk ob::examples::common opencv::opencv)
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Examples")
# ob_install_example_target(${PROJECT_NAME})
# ob_install_example_current_source("/cpp/Sample-${PROJECT_NAME}")
2 changes: 1 addition & 1 deletion examples/2.device.net_device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_net_device)
add_executable(${PROJECT_NAME} net_device.cpp)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)

target_link_libraries(${PROJECT_NAME} ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(${PROJECT_NAME} ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)

set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Examples")
Expand Down
2 changes: 1 addition & 1 deletion examples/3.advanced.align/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(ob_align)
add_executable(${PROJECT_NAME} align.cpp)

set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
target_link_libraries(${PROJECT_NAME} ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(${PROJECT_NAME} ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)

set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "Examples")
Expand Down
2 changes: 1 addition & 1 deletion examples/3.advanced.hdr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_hdr)
add_executable(ob_hdr hdr.cpp)

set_property(TARGET ob_hdr PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_hdr ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_hdr ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties(ob_hdr PROPERTIES FOLDER "Examples")
# ob_install_example_target(ob_hdr) ob_install_example_current_source("/cpp/3.advanced.hdr")
2 changes: 1 addition & 1 deletion examples/3.advanced.point_cloud/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_point_cloud)
add_executable(ob_point_cloud point_cloud.cpp)

set_property(TARGET ob_point_cloud PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_point_cloud ob::libobsensor ob::examples::common)
target_link_libraries(ob_point_cloud ob::openobsdk ob::examples::common)

set_target_properties(ob_point_cloud PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/3.advanced.post_processing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_post_processing)
add_executable(ob_post_processing post_processing.cpp)

set_property(TARGET ob_post_processing PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_post_processing ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_post_processing ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties(ob_post_processing PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/3.advanced.preset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(ob_preset)
add_executable(ob_preset preset.cpp)

set_property(TARGET ob_preset PROPERTY CXX_STANDARD 11)
target_link_libraries(ob_preset ob::libobsensor ob::examples::common opencv::opencv)
target_link_libraries(ob_preset ob::openobsdk ob::examples::common opencv::opencv)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/OpenCV430/lib/Windows/include/)
set_target_properties(ob_preset PROPERTIES FOLDER "Examples")

Expand Down
2 changes: 1 addition & 1 deletion examples/c_examples/0.c_quick_start/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD 11)
project(ob_quick_start_c)
add_executable(ob_quick_start_c quick_start.c)

target_link_libraries(ob_quick_start_c PRIVATE ob::libobsensor ob::examples::common)
target_link_libraries(ob_quick_start_c PRIVATE ob::openobsdk ob::examples::common)

set_target_properties(ob_quick_start_c PROPERTIES FOLDER "Examples_c")
set_target_properties(ob_quick_start_c PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
Expand Down
2 changes: 1 addition & 1 deletion examples/c_examples/1.c_enumerate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.1.15)
project(ob_enumerate_c)
add_executable(ob_enumerate_c enumerate.c)

target_link_libraries(ob_enumerate_c PRIVATE ob::libobsensor ob::examples::common)
target_link_libraries(ob_enumerate_c PRIVATE ob::openobsdk ob::examples::common)

set_target_properties(ob_enumerate_c PROPERTIES FOLDER "Examples_c")
set_target_properties(ob_enumerate_c PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
Expand Down
2 changes: 1 addition & 1 deletion examples/c_examples/2.c_depth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.1.15)
project(ob_depth_c)
add_executable(ob_depth_c depth.c)

target_link_libraries(ob_depth_c PRIVATE ob::libobsensor ob::examples::common)
target_link_libraries(ob_depth_c PRIVATE ob::openobsdk ob::examples::common)

set_target_properties(ob_depth_c PROPERTIES FOLDER "Examples_c")
set_target_properties(ob_depth_c PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
Expand Down
2 changes: 1 addition & 1 deletion include/libobsensor/h/Export.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# define OB_NO_EXPORT
#else
# ifndef OB_EXPORT
# ifdef libobsensor_EXPORTS
# ifdef openobsdk_EXPORTS
/* We are building this library */
# define OB_EXPORT __declspec(dllexport)
# else
Expand Down
18 changes: 9 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ if (MSVC)
endif ()

# only support shared library for now
add_library(libobsensor SHARED "" ${ORBBEC_VERSIONINFO_RC})
add_library(openobsdk SHARED "" ${ORBBEC_VERSIONINFO_RC})
include(GenerateExportHeader)
generate_export_header(libobsensor BASE_NAME OB EXPORT_FILE_NAME ${OB_PUBLIC_HEADERS_DIR}/libobsensor/h/Export.h)
generate_export_header(openobsdk BASE_NAME OB EXPORT_FILE_NAME ${OB_PUBLIC_HEADERS_DIR}/libobsensor/h/Export.h)

file(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_LIST_DIR}/impl/*.cpp ${CMAKE_CURRENT_LIST_DIR}/context/*.cpp)
file(GLOB_RECURSE HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/impl/*.hpp ${CMAKE_CURRENT_LIST_DIR}/context/*.hpp ${CMAKE_CURRENT_LIST_DIR}/../include/libobsensor/hpp/*.hpp)


target_sources(libobsensor PRIVATE ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(libobsensor PRIVATE ob::shared ob::core ob::filter ob::platform ob::device ob::pipeline)
target_sources(openobsdk PRIVATE ${SOURCE_FILES} ${HEADER_FILES})
target_link_libraries(openobsdk PRIVATE ob::shared ob::core ob::filter ob::platform ob::device ob::pipeline)


target_include_directories(libobsensor PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(openobsdk PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_include_directories(
libobsensor PUBLIC "$<BUILD_INTERFACE:${OB_PUBLIC_HEADERS_DIR}>" "$<INSTALL_INTERFACE:include>"
openobsdk PUBLIC "$<BUILD_INTERFACE:${OB_PUBLIC_HEADERS_DIR}>" "$<INSTALL_INTERFACE:include>"
)

add_library(ob::libobsensor ALIAS libobsensor)
ob_source_group(ob::libobsensor)
add_library(ob::openobsdk ALIAS openobsdk)
ob_source_group(ob::openobsdk)

install(
TARGETS libobsensor
TARGETS openobsdk
EXPORT openobsdkTarget
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
Expand Down
2 changes: 1 addition & 1 deletion tests/align_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1.15)

add_executable(align_test align_test.cpp)
target_link_libraries(align_test PRIVATE ob::libobsensor)
target_link_libraries(align_test PRIVATE ob::openobsdk)
set_target_properties(align_test PROPERTIES FOLDER "tests")
2 changes: 1 addition & 1 deletion tests/frame_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1.15)

add_executable(frame_test frame_test.cpp)
target_link_libraries(frame_test PRIVATE ob::libobsensor)
target_link_libraries(frame_test PRIVATE ob::openobsdk)
set_target_properties(frame_test PROPERTIES FOLDER "tests")
2 changes: 1 addition & 1 deletion tests/total_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1.15)

add_executable(total_test total_test.cpp)
target_link_libraries(total_test PRIVATE ob::libobsensor)
target_link_libraries(total_test PRIVATE ob::openobsdk)
set_target_properties(total_test PROPERTIES FOLDER "tests")

0 comments on commit 00307f8

Please sign in to comment.