-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
40 lines (33 loc) · 1.24 KB
/
CMakeLists.txt
File metadata and controls
40 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.22)
project(nl_means)
enable_testing()
# Set up language settings
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
# Find Halide
find_package(Halide REQUIRED)
# Generator
add_halide_generator(nl_means.generator SOURCES nl_means_generator.cpp)
# Filters
add_halide_library(nl_means FROM nl_means.generator)
add_halide_library(nl_means_auto_schedule FROM nl_means.generator
GENERATOR nl_means
AUTOSCHEDULER Halide::Mullapudi2016)
# Main executable
add_executable(nl_means_process process.cpp)
target_link_libraries(nl_means_process
PRIVATE
Halide::ImageIO
nl_means
nl_means_auto_schedule)
# Test that the app actually works!
set(IMAGE ${CMAKE_CURRENT_LIST_DIR}/../images/rgb.png)
if (EXISTS ${IMAGE})
configure_file(${IMAGE} rgb.png COPYONLY)
add_test(NAME nl_means_process COMMAND nl_means_process rgb.png 7 7 0.12 10 out.png)
set_tests_properties(nl_means_process PROPERTIES
LABELS nl_means
PASS_REGULAR_EXPRESSION "Success!"
SKIP_REGULAR_EXPRESSION "\\[SKIP\\]")
endif ()