Skip to content

Commit

Permalink
Adding a cmake config to help find image resources (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewroberthenderson authored Nov 2, 2023
1 parent 2fbe14b commit fef0910
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
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()

0 comments on commit fef0910

Please sign in to comment.