CMakeLists.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. cmake_minimum_required(VERSION 2.6)
  2. #{{{ Sources
  3. set(ufofilter_SRCS
  4. ufo-anka-backproject-task.c
  5. ufo-anka-padding-task.c
  6. ufo-remove-stripes-task.c
  7. )
  8. #}}}
  9. #{{{ Variables
  10. if (CMAKE_COMPILER_IS_GNUCC OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
  11. add_definitions("-Wcast-align -Wcast-qual -Winline -Wmissing-declarations "
  12. "-Wmissing-prototypes -Wnested-externs -Wno-long-long "
  13. "-Wno-missing-field-initializers -Wpointer-arith "
  14. "-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings")
  15. endif()
  16. add_definitions ("-DBURST=${BP_BURST}")
  17. #}}}
  18. #{{{ Plugin targets
  19. include_directories(${CMAKE_CURRENT_BINARY_DIR}
  20. ${CMAKE_CURRENT_SOURCE_DIR}
  21. ${OPENCL_INCLUDE_DIRS}
  22. ${UFO_INCLUDE_DIRS})
  23. foreach(_src ${ufofilter_SRCS})
  24. # find plugin suffix
  25. string(REGEX REPLACE "ufo-([^ \\.]+)-task.*" "\\1" task "${_src}")
  26. # build string to get miscalleanous sources
  27. string(REPLACE "-" "_" _misc ${task})
  28. string(TOUPPER ${_misc} _misc_upper)
  29. # create an option name and add this to disable filters
  30. set(target_option "ENABLE_${_misc_upper}")
  31. option(${target_option} "Build filter ${task}" ON)
  32. if (${target_option})
  33. set(_misc "${_misc}_misc_SRCS")
  34. string(REPLACE "-" "" _targetname ${task})
  35. set(target "ufofilter${_targetname}")
  36. # build single shared library per filter
  37. if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  38. add_library(${target} MODULE ${_src} ${${_misc}})
  39. else()
  40. add_library(${target} SHARED ${_src} ${${_misc}})
  41. endif()
  42. target_link_libraries(${target} ${ufofilter_LIBS})
  43. list(APPEND all_targets ${target})
  44. install(TARGETS ${target}
  45. ARCHIVE DESTINATION ${UFO_ANKAFILTERS_PLUGINDIR}
  46. LIBRARY DESTINATION ${UFO_ANKAFILTERS_PLUGINDIR})
  47. endif()
  48. endforeach()
  49. #}}}
  50. #{{{ Subdirectories
  51. add_subdirectory(kernels)
  52. #}}}