summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-11-07 12:05:27 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2016-11-07 12:05:27 +0100
commit52f60a8412fd04c83c08117ab0c46a399d2a0374 (patch)
treee7810cc20b77723fcdc0115a7db150d4a300adab /src/CMakeLists.txt
parent3a827779a36fedc5ee10bbd9e2891c93be245df6 (diff)
downloadufo-filters-52f60a8412fd04c83c08117ab0c46a399d2a0374.tar.gz
ufo-filters-52f60a8412fd04c83c08117ab0c46a399d2a0374.tar.bz2
ufo-filters-52f60a8412fd04c83c08117ab0c46a399d2a0374.tar.xz
ufo-filters-52f60a8412fd04c83c08117ab0c46a399d2a0374.zip
Link only to required dependencies
This change introduces filter_name_aux_LIBS variables which have to be set for plugins requiring specific libraries.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt70
1 files changed, 39 insertions, 31 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 33b243f..aa1196e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -75,31 +75,31 @@ set(ufofilter_SRCS
set(ufoaux_SRCS
ufo-priv.c)
-set(read_misc_SRCS
+set(read_aux_SRCS
readers/ufo-reader.c
readers/ufo-edf-reader.c
readers/ufo-raw-reader.c)
-set(write_misc_SRCS
+set(write_aux_SRCS
writers/ufo-writer.c
writers/ufo-raw-writer.c)
-set(stdout_misc_SRCS
+set(stdout_aux_SRCS
writers/ufo-writer.c)
-set(filter_misc_SRCS
+set(filter_aux_SRCS
common/ufo-fft.c)
-set(fft_misc_SRCS
+set(fft_aux_SRCS
common/ufo-fft.c)
-set(ifft_misc_SRCS
+set(ifft_aux_SRCS
common/ufo-fft.c)
-set(retrieve_phase_misc_SRCS
+set(retrieve_phase_aux_SRCS
common/ufo-fft.c)
-set(lamino_backproject_misc_SRCS
+set(lamino_backproject_aux_SRCS
lamino-roi.c)
file(GLOB ufofilter_KERNELS "kernels/*.cl")
@@ -131,24 +131,26 @@ if (OPENMP_FOUND)
endif ()
if (TIFF_FOUND)
- list(APPEND read_misc_SRCS readers/ufo-tiff-reader.c)
- list(APPEND write_misc_SRCS writers/ufo-tiff-writer.c)
- list(APPEND ufofilter_LIBS ${TIFF_LIBRARIES})
+ list(APPEND read_aux_SRCS readers/ufo-tiff-reader.c)
+ list(APPEND read_aux_LIBS ${TIFF_LIBRARIES})
+ list(APPEND write_aux_SRCS writers/ufo-tiff-writer.c)
+ list(APPEND write_aux_LIBS ${TIFF_LIBRARIES})
include_directories(${TIFF_INCLUDE_DIRS})
link_directories(${TIFF_LIBRARY_DIRS})
set(HAVE_TIFF True)
elseif (LIBTIFF4_INCLUDE_DIRS AND LIBTIFF4_LIBRARIES)
- list(APPEND read_misc_SRCS readers/ufo-tiff-reader.c)
- list(APPEND write_misc_SRCS writers/ufo-tiff-writer.c)
- list(APPEND ufofilter_LIBS ${LIBTIFF4_LIBRARIES})
+ list(APPEND read_aux_SRCS readers/ufo-tiff-reader.c)
+ list(APPEND read_aux_LIBS ${LIBTIFF4_LIBRARIES})
+ list(APPEND write_aux_SRCS writers/ufo-tiff-writer.c)
+ list(APPEND write_aux_LIBS ${LIBTIFF4_LIBRARIES})
include_directories(${LIBTIFF4_INCLUDE_DIRS})
link_directories(${LIBTIFF4_LIBRARY_DIRS})
set(HAVE_TIFF True)
endif ()
if (JPEG_FOUND)
- list(APPEND write_misc_SRCS writers/ufo-jpeg-writer.c)
- list(APPEND ufofilter_LIBS ${JPEG_LIBRARIES})
+ list(APPEND write_aux_SRCS writers/ufo-jpeg-writer.c)
+ list(APPEND write_aux_LIBS ${JPEG_LIBRARIES})
include_directories(${JPEG_INCLUDE_DIRS})
link_directories(${JPEG_LIBRARY_DIRS})
set(HAVE_JPEG True)
@@ -165,9 +167,10 @@ if (HDF5_FOUND)
include_directories(${MPI_INCLUDE_PATH})
endif ()
- list(APPEND read_misc_SRCS readers/ufo-hdf5-reader.c common/hdf5.c)
- list(APPEND write_misc_SRCS writers/ufo-hdf5-writer.c common/hdf5.c)
- list(APPEND ufofilter_LIBS ${HDF5_LIBRARIES})
+ list(APPEND read_aux_SRCS readers/ufo-hdf5-reader.c common/hdf5.c)
+ list(APPEND read_aux_LIBS ${HDF5_LIBRARIES})
+ list(APPEND write_aux_SRCS writers/ufo-hdf5-writer.c common/hdf5.c)
+ list(APPEND write_aux_LIBS ${HDF5_LIBRARIES})
include_directories(${HDF5_INCLUDE_DIRS})
link_directories(${HDF5_LIBRARY_DIRS})
endif ()
@@ -175,14 +178,14 @@ endif ()
if (UCA_INCLUDE_DIRS AND UCA_LIBRARIES)
list(APPEND ufofilter_SRCS ufo-camera-task.c)
- list(APPEND ufofilter_LIBS ${UCA_LIBRARIES})
+ list(APPEND uca_aux_LIBS ${UCA_LIBRARIES})
include_directories(${UCA_INCLUDE_DIRS})
link_directories(${UCA_LIBRARY_DIRS})
endif ()
if (GSL_FOUND)
include_directories(${GSL_INCLUDE_DIRS})
- list(APPEND ufofilter_LIBS ${GSL_LIBRARIES})
+ list(APPEND measure_aux_LIBS ${GSL_LIBRARIES})
list(APPEND ufofilter_SRCS ufo-measure-task.c)
endif ()
@@ -191,18 +194,22 @@ if (CLFFT_FOUND)
if (WITH_CLFFT)
include_directories(${CLFFT_INCLUDE_DIRS})
- list(APPEND ufofilter_LIBS ${CLFFT_LIBRARIES})
+ list(APPEND fft_aux_LIBS ${CLFFT_LIBRARIES})
+ list(APPEND ifft_aux_LIBS ${CLFFT_LIBRARIES})
+ list(APPEND retrieve_phase_aux_LIBS ${CLFFT_LIBRARIES})
set(HAVE_AMD ON)
else ()
- list(APPEND ufofilter_LIBS oclfft)
+ list(APPEND fft_aux_LIBS oclfft)
+ list(APPEND ifft_aux_LIBS oclfft)
+ list(APPEND retrieve_phase_aux_LIBS oclfft)
set(HAVE_AMD OFF)
endif ()
endif ()
if (CLBLAST_FOUND)
include_directories(${CLBLAST_INCLUDE_DIRS})
- list(APPEND ufofilter_LIBS ${CLBLAST_LIBRARIES})
list(APPEND ufofilter_SRCS ufo-gemm-task.c)
+ list(APPEND gemm_aux_LIBS ${CLBLAST_LIBRARIES})
endif ()
#}}}
@@ -219,24 +226,25 @@ 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)
+ # build string to get auxalleanous sources
+ string(REPLACE "-" "_" _aux ${task})
+ string(TOUPPER ${_aux} _aux_upper)
# create an option name and add this to disable filters
- set(_misc "${_misc}_misc_SRCS")
+ set(_aux_src "${_aux}_aux_SRCS")
+ set(_aux_libs "${_aux}_aux_LIBS")
string(REPLACE "-" "" _targetname ${task})
set(target "ufofilter${_targetname}")
# build single shared library per filter
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- add_library(${target} MODULE ${ufoaux_SRCS} ${_src} ${${_misc}})
+ add_library(${target} MODULE ${ufoaux_SRCS} ${_src} ${${_aux_src}})
else()
- add_library(${target} SHARED ${ufoaux_SRCS} ${_src} ${${_misc}})
+ add_library(${target} SHARED ${ufoaux_SRCS} ${_src} ${${_aux_src}})
endif()
- target_link_libraries(${target} ${ufofilter_LIBS})
+ target_link_libraries(${target} ${ufofilter_LIBS} ${${_aux_libs}})
list(APPEND all_targets ${target})