-
Notifications
You must be signed in to change notification settings - Fork 203
/
CMakeLists.txt
71 lines (56 loc) · 2.58 KB
/
CMakeLists.txt
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.10)
project(HDR_PLUS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
include("macro.cmake")
set(CMAKE_CXX_STANDARD 20)
# Define dependencies
if(DEFINED HALIDE_DISTRIB_DIR)
list(APPEND CMAKE_PREFIX_PATH ${HALIDE_DISTRIB_DIR})
endif(DEFINED HALIDE_DISTRIB_DIR)
find_package(Halide REQUIRED)
if(DEFINED HALIDE_DISTRIB_DIR)
link_directories(BEFORE "${HALIDE_DISTRIB_DIR}/lib")
endif(DEFINED HALIDE_DISTRIB_DIR)
link_libtiff()
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
find_library(LIBRAW_LIBRARY NAMES raw raw_r)
set(src_files
src/InputSource.cpp
src/Burst.cpp
src/LibRaw2DngConverter.cpp)
set(header_files
src/InputSource.h
src/Burst.h
src/dngwriter.h
src/LibRaw2DngConverter.h)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${RAW2DNG_INCLUDE_DIRS})
include_directories(${CMAKE_BINARY_DIR}/genfiles)
add_executable(hdrplus_pipeline_generator src/hdrplus_pipeline_generator.cpp src/align.cpp src/merge.cpp src/finish.cpp src/util.cpp)
target_link_libraries(hdrplus_pipeline_generator PRIVATE Halide::Generator)
add_halide_library(hdrplus_pipeline
# GENERATOR_DEPS # We don't have any yet
FROM hdrplus_pipeline_generator
# GENERATOR_ARGS # We don't have any yet
FUNCTION_NAME hdrplus_pipeline
# HALIDE_TARGET ${HALIDE_TARGET} # TODO: add option with custom HALIDE_TARGET
# HALIDE_TARGET_FEATURES ${HALIDE_TARGET_FEATURES} # TODO: add option with custom HALIDE_TARGET
# EXTRA_OUTPUTS "stmt;html;schedule") # uncomment for extra output
)
add_executable(align_and_merge_generator src/align_and_merge_generator.cpp src/align.cpp src/merge.cpp src/util.cpp)
target_link_libraries(align_and_merge_generator PRIVATE Halide::Generator)
add_halide_library(align_and_merge
FROM align_and_merge_generator
FUNCTION_NAME align_and_merge
# HALIDE_TARGET ${HALIDE_TARGET} # TODO: add option with custom HALIDE_TARGET
# HALIDE_TARGET_FEATURES ${HALIDE_TARGET_FEATURES} # TODO: add option with custom HALIDE_TARGET
# EXTRA_OUTPUTS "stmt;html;schedule") # uncomment for extra output
)
add_executable(hdrplus bin/HDRPlus.cpp ${src_files})
add_dependencies(hdrplus hdrplus_pipeline)
target_link_libraries(hdrplus hdrplus_pipeline Halide png ${LIBRAW_LIBRARY} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY})
add_executable(stack_frames bin/stack_frames.cpp ${src_files})
add_dependencies(stack_frames align_and_merge)
target_link_libraries(stack_frames Halide align_and_merge ${LIBRAW_LIBRARY} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY})