CMakeLists.txt 5.17 KB
Newer Older
1 2
include_directories("${CMAKE_CURRENT_BINARY_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}")

3
include(manage-symbol-visibility)
4

5
add_definitions(-include common/module_api.h)
6 7
add_definitions(-include iop/iop_api.h)

8 9 10 11 12 13 14 15 16
set(_iop_list "")
set(_iop_default_visible_list "")

# parameters:
# 1. iop name
# 2. iop main source file
# and after that you may pass additional iop source files
# and DEFAULT_VISIBLE keyword - which means that the iop will be visible/listed
# by default (user can manipulate iop visibility via "more modules" lib)
17
macro (add_iop _lib _src)
18 19 20 21 22
  string(LENGTH ${_lib} _lib_namelength)
  if(${_lib_namelength} GREATER 19)
    message(FATAL_ERROR "IOP name \"${_lib}\" is too long (${_lib_namelength} symbols), it should not be greater than 19 symbols.")
  endif(${_lib_namelength} GREATER 19)

23 24 25
  set(_input ${CMAKE_CURRENT_SOURCE_DIR}/${_src})
  set(_output ${CMAKE_CURRENT_BINARY_DIR}/introspection_${_src}) # keep ${_src} in the end to keep the file extension (c vs. cc)
  add_custom_command(
26
    DEPENDS ${_input} ${CMAKE_SOURCE_DIR}/src/common/introspection.h
27 28
    OUTPUT ${_output}
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tools/introspection/
29
    COMMAND ${perl_BIN} ${CMAKE_SOURCE_DIR}/tools/introspection/parser.pl ${CMAKE_CURRENT_SOURCE_DIR}/../ ${_input} ${_output}
30
  )
31 32 33 34 35

  # do not want compiler to look for "DEFAULT_VISIBLE"
  set(OPT_SRC "${ARGN}")
  list(REMOVE_ITEM OPT_SRC "DEFAULT_VISIBLE")

36 37 38 39
  set_source_files_properties(${_input} PROPERTIES LANGUAGE "")
  # yes, input is added as part of the library. since we just set it's LANGUAGE
  # to "", no compilation will happen. this is needed for proper IDE support.
  add_library(${_lib} MODULE ${_output} ${OPT_SRC} ${_input})
40
  target_link_libraries(${_lib} lib_darktable)
41 42 43 44 45 46

  if (WIN32)
    _detach_debuginfo (${_lib} ${CMAKE_INSTALL_LIBDIR}/darktable/plugins)
  endif(WIN32)

  install(TARGETS  ${_lib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/darktable/plugins COMPONENT DTApplication)
47 48 49 50 51 52 53 54 55

  list(APPEND _iop_list ${_lib})

  # find whether magic keyword DEFAULT_VISIBLE was passed
  # it defines whether the iop will be listed by default
  cmake_parse_arguments(add_iop "DEFAULT_VISIBLE" "" "" ${ARGN})
  if(${add_iop_DEFAULT_VISIBLE})
    list(APPEND _iop_default_visible_list ${_lib})
  endif(${add_iop_DEFAULT_VISIBLE})
56
endmacro (add_iop)
57

58
# add_iop(useless "useless.c")
59
add_iop(rawprepare "rawprepare.c")
60 61 62 63
add_iop(soften "soften.c")
add_iop(bloom "bloom.c")
add_iop(highpass "highpass.c")
add_iop(lowpass "lowpass.c")
64
add_iop(shadhi "shadhi.c" DEFAULT_VISIBLE)
65
add_iop(colorreconstruct "colorreconstruction.c")
66
add_iop(tonemap "tonemap.cc")
67 68
add_iop(tonecurve "tonecurve.c" DEFAULT_VISIBLE)
add_iop(colisa "colisa.c" DEFAULT_VISIBLE)
69
add_iop(gamma "gamma.c")
70 71 72
add_iop(temperature "temperature.c" DEFAULT_VISIBLE)
add_iop(colorcorrection "colorcorrection.c" DEFAULT_VISIBLE)
add_iop(exposure "exposure.c" DEFAULT_VISIBLE)
73 74
add_iop(equalizer "equalizer.c")
add_iop(colorbalance "colorbalance.c")
75 76
add_iop(colorin "colorin.c" DEFAULT_VISIBLE)
add_iop(colorout "colorout.c" DEFAULT_VISIBLE)
77
add_iop(colorchecker "colorchecker.c")
78 79
add_iop(clipping "clipping.c" DEFAULT_VISIBLE)
add_iop(sharpen "sharpen.c" DEFAULT_VISIBLE)
80
add_iop(dither "dither.c")
81 82
add_iop(monochrome "monochrome.c" DEFAULT_VISIBLE)
add_iop(basecurve "basecurve.c" DEFAULT_VISIBLE)
83
add_iop(colorzones "colorzones.c")
84
add_iop(highlights "highlights.c" DEFAULT_VISIBLE)
85
add_iop(rawoverexposed "rawoverexposed.c")
86
add_iop(velvia "velvia.c")
87
add_iop(vignette "vignette.c" DEFAULT_VISIBLE)
88
add_iop(splittoning "splittoning.c")
89 90
add_iop(grain "grain.c" DEFAULT_VISIBLE)
add_iop(clahe "clahe.c" DEFAULT_VISIBLE)
91 92 93 94 95
add_iop(bilateral "bilateral.cc")
add_iop(profile_gamma "profile_gamma.c")
add_iop(colortransfer "colortransfer.c")
add_iop(colormapping "colormapping.c")
add_iop(channelmixer "channelmixer.c")
96
add_iop(graduatednd "graduatednd.c" DEFAULT_VISIBLE)
97 98
add_iop(relight "relight.c")
add_iop(zonesystem "zonesystem.c")
99
add_iop(demosaic "demosaic.c" "amaze_demosaic_RT.cc" DEFAULT_VISIBLE)
Roman Lebedev's avatar
Roman Lebedev committed
100
add_iop(rotatepixels "rotatepixels.c")
Roman Lebedev's avatar
Roman Lebedev committed
101
add_iop(scalepixels "scalepixels.c")
102 103 104 105 106 107
add_iop(atrous "atrous.c")
add_iop(cacorrect "cacorrect.c")
add_iop(overexposed "overexposed.c")
add_iop(hotpixels "hotpixels.c")
add_iop(lowlight "lowlight.c")
add_iop(spots "spots.c")
108
add_iop(liquify "liquify.c")
109 110 111 112
add_iop(rawdenoise "rawdenoise.c")
add_iop(borders "borders.c")
add_iop(nlmeans "nlmeans.c")
add_iop(colorcontrast "colorcontrast.c")
113
add_iop(levels "levels.c" DEFAULT_VISIBLE)
114 115 116
add_iop(colorize "colorize.c")
add_iop(invert "invert.c")
add_iop(vibrance "vibrance.c")
117
add_iop(flip "flip.c" DEFAULT_VISIBLE)
118
add_iop(finalscale "finalscale.c")
119 120 121
add_iop(globaltonemap "globaltonemap.c")
add_iop(bilat "bilat.c")
add_iop(denoiseprofile "denoiseprofile.c")
122
add_iop(defringe "defringe.c")
123
add_iop(ashift "ashift.c")
Heiko Bauke's avatar
Heiko Bauke committed
124
add_iop(hazeremoval "hazeremoval.c")
125

126
if(RSVG2_FOUND)
127
  add_iop(watermark "watermark.c")
128 129
endif(RSVG2_FOUND)

130
if(LENSFUN_FOUND)
131
  add_iop(lens "lens.c" DEFAULT_VISIBLE)
132
endif(LENSFUN_FOUND)
133 134 135 136 137

# fix for Mac when OpenMP is only available in C compiler
if(APPLE)
  set_target_properties(demosaic PROPERTIES LINKER_LANGUAGE C)
endif(APPLE)
138 139 140

set_property(GLOBAL PROPERTY DT_PLUGIN_IOPS ${_iop_list})
set_property(GLOBAL PROPERTY DT_PLUGIN_IOPS_VISIBLE_BY_DEFAULT ${_iop_default_visible_list})