123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- cmake_minimum_required(VERSION 2.6)
- #{{{ Sources
- set(ufofilter_SRCS
- ufo-anka-backproject-task.c
- )
- file(GLOB ufofilter_KERNELS "kernels/*.cl")
- #}}}
- #{{{ Variables
- if (CMAKE_COMPILER_IS_GNUCC OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
- add_definitions("-Wcast-align -Wcast-qual -Winline -Wmissing-declarations "
- "-Wmissing-prototypes -Wnested-externs -Wno-long-long "
- "-Wno-missing-field-initializers -Wpointer-arith "
- "-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings")
- endif()
- #}}}
- #{{{ Plugin targets
- include_directories(${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${OPENCL_INCLUDE_DIRS}
- ${UFO_INCLUDE_DIRS})
- foreach(_src ${ufofilter_SRCS})
- # find plugin suffix
- string(REGEX REPLACE "ufo-([^ \\.]+)-task.*" "\\1" task "${_src}")
- # build string to get miscalleanous sources
- string(REPLACE "-" "_" _misc ${task})
- string(TOUPPER ${_misc} _misc_upper)
- # create an option name and add this to disable filters
- set(target_option "ENABLE_${_misc_upper}")
- option(${target_option} "Build filter ${task}" ON)
- if (${target_option})
- set(_misc "${_misc}_misc_SRCS")
- string(REPLACE "-" "" _targetname ${task})
- set(target "ufofilter${_targetname}")
- # build single shared library per filter
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- add_library(${target} MODULE ${_src} ${${_misc}})
- else()
- add_library(${target} SHARED ${_src} ${${_misc}})
- endif()
- target_link_libraries(${target} ${ufofilter_LIBS})
- list(APPEND all_targets ${target})
-
- install(TARGETS ${target}
- ARCHIVE DESTINATION ${UFO_ANKAFILTERS_PLUGINDIR}
- LIBRARY DESTINATION ${UFO_ANKAFILTERS_PLUGINDIR})
- endif()
- endforeach()
- # copy kernels
- foreach(_kernel ${ufofilter_KERNELS})
- install(FILES ${_kernel} DESTINATION ${UFO_ANKAFILTERS_KERNELDIR})
- endforeach()
- #}}}
|