1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- cmake_minimum_required(VERSION 2.6)
- # --- Set sources -------------------------------------------------------------
- set(ufofilter_SRCS
- ufo-edf-3d-writer-task.c
- ufo-lamino-bp-task.c
- ufo-lamino-conv-task.c
- ufo-lamino-ramp-task.c
- ufo-padding-2d-task.c
- ufo-scale-task.c)
- set(ufofilter_KERNELS
- scale.cl
- lamino_bp_generic.cl
- padding_2d.cl
- lamino_ramp.cl
- lamino_ft_conv.cl)
- set(ufofilter_LIBS
- ${UFO_LIBRARIES}
- ${GLIB2_LIBRARIES}
- ${GOBJECT2_LIBRARIES})
- set(ufofilter_HEADERS
- lamino-filter-def.h)
- link_directories(${UFO_LIBRARY_DIRS})
- # --- Target ------------------------------------------------------------------
- include_directories(
- ${GLIB2_INCLUDE_DIRS}
- ${OPENCL_INCLUDE_DIRS}
- ${UFO_INCLUDE_DIRS}
- ${CMAKE_CURRENT_BINARY_DIR})
- 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})
-
- install(TARGETS ${target}
- ARCHIVE DESTINATION ${UFO_PLUGINDIR}
- LIBRARY DESTINATION ${UFO_PLUGINDIR})
- endif()
- endforeach()
- # copy kernels
- foreach(_kernel ${ufofilter_KERNELS})
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${_kernel}
- ${CMAKE_CURRENT_BINARY_DIR}/${_kernel})
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_kernel}
- DESTINATION ${UFO_KERNELDIR})
- endforeach()
- #copy aux headers into the kernel dir
- foreach(_header ${ufofilter_HEADERS})
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${_header}
- ${CMAKE_CURRENT_BINARY_DIR}/${_header})
-
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_header}
- DESTINATION ${UFO_KERNELDIR})
- endforeach()
|