summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt25
-rw-r--r--src/CMakeLists.txt24
2 files changed, 20 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f457b6a..a197cdb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,31 +12,23 @@ set(UFO_FILTERS_VERSION_STRING_SHORT "${UFO_FILTERS_VERSION_MAJOR}.${UFO_FILTERS
set(UFO_DESCRIPTION "UFO good filters")
set(UFO_DESCRIPTION_SUMMARY "UFO good filters")
-set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/common/cmake")
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/common/cmake")
+
+#{{{ Variables and Options
+set(PKG_UFO_CORE_MIN_REQUIRED "0.5")
-# --- Options -----------------------------------------------------------------
option(WITH_PROFILING "Enable profiling" OFF)
+
if (WITH_PROFILING)
add_definitions("-pg")
set(CMAKE_C_FLAGS "-pg")
endif ()
-
-# --- Find packages and libraries ---------------------------------------------
-set(PKG_UFO_CORE_MIN_REQUIRED "0.5")
-
+#}}}
+#{{{ Common dependencies
find_package(OpenCL REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(UFO ufo>=${PKG_UFO_CORE_MIN_REQUIRED} REQUIRED)
-
-#{{{ Plugin-specific dependencies
-find_package(TIFF)
-pkg_check_modules(OCLFFT oclfft)
#}}}
-
-include_directories(
- ${OPENCL_INCLUDE_DIRS}
- ${UFO_INCLUDE_DIRS})
-
#{{{ Global definitions
add_definitions("-std=c99 -pedantic -Wall -Wextra -fPIC")
add_definitions(-DG_LOG_DOMAIN="Ufo")
@@ -58,12 +50,10 @@ if (CMAKE_COMPILER_IS_GNUCC OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
-Wwrite-strings")
endif()
#}}}
-
#{{{ Subdirectories
add_subdirectory(src)
add_subdirectory(tests/integration_tests)
#}}}
-
#{{{ CPack
set(CPACK_PACKAGE_DESCRIPTION ${UFO_DESCRIPTION})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${UFO_DESCRIPTION_SUMMARY})
@@ -94,7 +84,6 @@ if (OCLFFT_FOUND)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, liboclfft (>= 1.0)")
endif()
#}}}
-
#{{{ RPM
set(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
#}}}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a6f374b..198c2e6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,8 +23,7 @@ set(ufofilter_SRCS
ufo-zeropadding-task.c
)
#}}}
-
-#{{{ Installed OpenCL kernels
+#{{{ Kernels
set(ufofilter_KERNELS
arithmetics.cl
backproject.cl
@@ -44,13 +43,15 @@ set(ufofilter_KERNELS
zeropadding_kernel.cl
)
#}}}
-
+#{{{ Variables
set(ufofilter_LIBS ${UFO_LIBRARIES})
-
+#}}}
#{{{ Dependency checks
+find_package(TIFF)
pkg_check_modules(UCA libuca>=1.2)
pkg_check_modules(OPENCV opencv)
pkg_check_modules(UFOART ufoart>=0.1)
+pkg_check_modules(OCLFFT oclfft)
if (TIFF_FOUND)
list(APPEND ufofilter_SRCS ufo-reader-task.c)
@@ -94,7 +95,6 @@ if (UFOART_FOUND)
list(APPEND ufofilter_SRCS ufo-art-task.c)
endif()
#}}}
-
#{{{ Plugin targets
get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
@@ -104,9 +104,12 @@ set(documented_types "")
set(all_targets)
include_directories(${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR})
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${OPENCL_INCLUDE_DIRS}
+ ${UFO_INCLUDE_DIRS})
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/config.h)
foreach(_src ${ufofilter_SRCS})
# find plugin suffix
@@ -147,15 +150,15 @@ endforeach()
# copy kernels into $LIB_INSTALL_DIR
foreach(_kernel ${ufofilter_KERNELS})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${_kernel}
- ${CMAKE_CURRENT_BINARY_DIR}/${_kernel})
+ ${CMAKE_CURRENT_BINARY_DIR}/${_kernel})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_kernel}
- DESTINATION ${LIB_INSTALL_DIR})
+ DESTINATION ${LIB_INSTALL_DIR})
endforeach()
#}}}
-
#{{{ gtk-doc targets
pkg_check_modules(GTK_DOC gtk-doc)
+
if(GTK_DOC_FOUND)
option(WITH_GTK_DOC "Build filter documentation" ON)
if (WITH_GTK_DOC)
@@ -225,7 +228,6 @@ if(GTK_DOC_FOUND)
endif()
endif(GTK_DOC_FOUND)
#}}}
-
#{{{ Python tests
find_program(NOSETESTSBIN nosetests)
if (NOSETESTSBIN)