CMakeLists.txt 2.0 KB

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