From 63a7abbf44f2bdcd15cd1f04f5e3b28f7cf7f4e4 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Tue, 25 Oct 2016 17:00:45 +0200 Subject: Move to CMake 3.1+ --- CMakeLists.txt | 5 ++- common/cmake/FindOpenCL.cmake | 91 ------------------------------------------- deps/oclfft/CMakeLists.txt | 4 +- src/CMakeLists.txt | 8 +--- 4 files changed, 8 insertions(+), 100 deletions(-) delete mode 100644 common/cmake/FindOpenCL.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a10c2e6..83235a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,7 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.1) +cmake_policy(SET CMP0053 OLD) +cmake_policy(SET CMP0054 OLD) + project(ufo C) set(TARNAME "ufo-filters") diff --git a/common/cmake/FindOpenCL.cmake b/common/cmake/FindOpenCL.cmake deleted file mode 100644 index 25703ef..0000000 --- a/common/cmake/FindOpenCL.cmake +++ /dev/null @@ -1,91 +0,0 @@ -# - Try to find OpenCL -# This module tries to find an OpenCL implementation on your system. It supports -# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too. -# -# Once done this will define -# OPENCL_FOUND - system has OpenCL -# OPENCL_INCLUDE_DIRS - the OpenCL include directory -# OPENCL_LIBRARIES - link these to use OpenCL -# -# WIN32 should work, but is untested - -FIND_PACKAGE( PackageHandleStandardArgs ) - -SET (OPENCL_VERSION_STRING "0.1.0") -SET (OPENCL_VERSION_MAJOR 0) -SET (OPENCL_VERSION_MINOR 1) -SET (OPENCL_VERSION_PATCH 0) - -IF (APPLE) - - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX") - FIND_PATH(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX") - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX") - -ELSE (APPLE) - - IF (WIN32) - - FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h) - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp) - - # The AMD SDK currently installs both x86 and x86_64 libraries - # This is only a hack to find out architecture - IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" ) - SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64") - ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") - SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86") - ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" ) - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR}) - - GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) - - # On Win32 search relative to the library - FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}") - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}") - - ELSE (WIN32) - - # Unix style platforms - FIND_LIBRARY(OPENCL_LIBRARIES OpenCL - ENV LD_LIBRARY_PATH - /usr/lib/nvidia-current - /usr/lib64/nvidia - /opt/nvidia-current - /opt/AMDAPP/lib - /opt/AMDAPP/lib/x86_64 - /opt/AMDAPPSDK-3.0/lib/x86_64 - ) - - GET_FILENAME_COMPONENT(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH) - GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE) - - # The AMD SDK currently does not place its headers - # in /usr/include, therefore also search relative - # to the library - FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS - ${_OPENCL_INC_CAND} - /usr/local/cuda/include - /opt/cuda/include - /opt/AMDAPP/include) - FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND}) - - ENDIF (WIN32) - -ENDIF (APPLE) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS ) - -IF( _OPENCL_CPP_INCLUDE_DIRS ) - SET( OPENCL_HAS_CPP_BINDINGS TRUE ) - LIST( APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS} ) - # This is often the same, so clean up - LIST( REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS ) -ENDIF( _OPENCL_CPP_INCLUDE_DIRS ) - -MARK_AS_ADVANCED( - OPENCL_LIBRARIES - OPENCL_INCLUDE_DIRS - _OPENCL_CPP_INCLUDE_DIRS -) - diff --git a/deps/oclfft/CMakeLists.txt b/deps/oclfft/CMakeLists.txt index 3e34a5a..6743013 100644 --- a/deps/oclfft/CMakeLists.txt +++ b/deps/oclfft/CMakeLists.txt @@ -1,5 +1,5 @@ project(oclfft CXX) -include_directories(${OPENCL_INCLUDE_DIRS} +include_directories(${OpenCL_INCLUDE_DIRS} ${UFO_INCLUDE_DIRS}) add_library(oclfft SHARED @@ -7,7 +7,7 @@ add_library(oclfft SHARED fft_setup.cpp fft_kernelstring.cpp) -target_link_libraries(oclfft ${UFO_LIBRARIES} ${OPENCL_LIBRARIES}) +target_link_libraries(oclfft ${UFO_LIBRARIES} ${OpenCL_LIBRARIES}) install(TARGETS oclfft LIBRARY DESTINATION ${UFO_FILTERS_LIBDIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b476e92..6b9d601 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -109,12 +109,8 @@ set(ufofilter_LIBS ${UFO_LIBRARIES} oclfft) -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() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-unused-parameter -Wno-deprecated-declarations") + add_definitions ("-DBURST=${BP_BURST}") #}}} #{{{ Dependency checks -- cgit v1.2.3