Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
yushulx committed Dec 19, 2024
1 parent abe406a commit 5565aea
Show file tree
Hide file tree
Showing 8 changed files with 1,751 additions and 12 deletions.
16 changes: 8 additions & 8 deletions litecam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,34 @@ set(EXECUTABLE_SOURCES
)

# Add the Camera shared library
add_library(Camera SHARED ${LIBRARY_SOURCES})
add_library(litecam SHARED ${LIBRARY_SOURCES})

# Set include directories for the Camera library
target_include_directories(Camera PUBLIC ${INCLUDE_DIR})
target_include_directories(litecam PUBLIC ${INCLUDE_DIR})

# Define the CAMERA_EXPORTS macro for the shared library
target_compile_definitions(Camera PRIVATE CAMERA_EXPORTS)
target_compile_definitions(litecam PRIVATE CAMERA_EXPORTS)

# Platform-specific dependencies for the Camera library
if (UNIX AND NOT APPLE)
find_package(X11 REQUIRED)
if (X11_FOUND)
target_include_directories(Camera PUBLIC ${X11_INCLUDE_DIR})
target_link_libraries(Camera PRIVATE ${X11_LIBRARIES} pthread)
target_include_directories(litecam PUBLIC ${X11_INCLUDE_DIR})
target_link_libraries(litecam PRIVATE ${X11_LIBRARIES} pthread)
endif()
elseif (APPLE)
find_library(COCOA_LIBRARY Cocoa)
find_library(AVFOUNDATION_LIBRARY AVFoundation)
target_link_libraries(Camera PRIVATE ${AVFOUNDATION_LIBRARY})
target_link_libraries(litecam PRIVATE ${AVFOUNDATION_LIBRARY})
elseif (WIN32)
target_link_libraries(Camera PRIVATE ole32 uuid mfplat mf mfreadwrite mfuuid)
target_link_libraries(litecam PRIVATE ole32 uuid mfplat mf mfreadwrite mfuuid)
endif()

# Add the camera_capture executable
add_executable(camera_capture ${EXECUTABLE_SOURCES})

# Link the Camera library to the executable
target_link_libraries(camera_capture PRIVATE Camera)
target_link_libraries(camera_capture PRIVATE litecam)

# Include the shared library's headers in the executable
target_include_directories(camera_capture PRIVATE ${INCLUDE_DIR})
Loading

0 comments on commit 5565aea

Please sign in to comment.