Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a cmake config to help find image resources #693

Merged
merged 9 commits into from
Nov 2, 2023
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ if(CUDA_FOUND)
add_subdirectory(examples/cuda/pinned_memory)
endif()

function(copy_data_files)
set(EXAMPLE_DATA_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(EXAMPLE_DATA_DIR "${CMAKE_SOURCE_DIR}/data/")
file(GLOB files "${EXAMPLE_DATA_DIR}/*.bmp" "${EXAMPLE_DATA_DIR}/*.png")
foreach(file ${files})
file(COPY ${file} DESTINATION ${EXAMPLE_DATA_INSTALL_DIR})
endforeach()
endfunction()

if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm*|ARM*)")
add_compile_options(-mfpu=neon-vfpv4)
endif()
Expand All @@ -41,3 +50,4 @@ option(PENGUINV_BUILD_EXAMPLE "Build examples of penguinV" ON)
if(${PENGUINV_BUILD_EXAMPLE} AND (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR))
add_subdirectory(examples)
endif()

3 changes: 3 additions & 0 deletions examples/edge_detection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ elseif(UNIX AND NOT APPLE)
target_link_libraries(example_edge_detection
PRIVATE example_features_options example_features_warnings Threads::Threads ${X11_LIBRARIES})
endif()

# Copy example data to binary directory.
copy_data_files()
3 changes: 3 additions & 0 deletions examples/filters/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ add_executable(example_filters
${LIB_DIR}/file/bmp_image.cpp)
target_link_libraries(example_filters
PRIVATE example_features_options example_features_warnings)

# Copy example data to binary directory.
copy_data_files()
Loading