CMakeLists.txt 2.0 KB

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