b5bcdd87b5f679a1f4e6f3c340f326c0a5dbc1e0
[alexxy/gromacs.git] / src / external / clFFT / src / CMakeLists.txt
1 project( clFFT )
2
3 # get sources
4 file(GLOB CLFFT_SOURCES statTimer/*.cpp library/*.cpp library/*.c)
5 file(GLOB CLFFT_SOURCES_UNWANTED statTimer/dllmain.cpp library/dllmain.cpp)
6 list(REMOVE_ITEM CLFFT_SOURCES ${CLFFT_SOURCES_UNWANTED})
7
8 add_library(clFFT OBJECT ${CLFFT_SOURCES})
9
10 # disable all warnings
11 target_compile_options(clFFT PRIVATE "-w")
12 if (BUILD_SHARED_LIBS)
13     set_target_properties(clFFT PROPERTIES
14         POSITION_INDEPENDENT_CODE ON
15         )
16 endif()
17
18 # Windows doesn't need anything special to load the dynamic libraries
19 # that the AMD clFFT implementation uses, but *nix and BSD do.
20 if (NOT WIN32)
21     include(CheckCXXSymbolExists)
22     check_cxx_symbol_exists(dlopen dlfcn.h HAVE_DLOPEN)
23     if (NOT HAVE_DLOPEN)
24         message(FATAL_ERROR "Cannot use clFFT for OpenCL support unless dlopen is available")
25     endif()
26 endif()
27
28 target_include_directories(clFFT
29     PUBLIC
30         ${CMAKE_CURRENT_SOURCE_DIR}/include
31     PRIVATE
32         ${CMAKE_CURRENT_SOURCE_DIR}/library
33         ${CMAKE_CURRENT_SOURCE_DIR}/statTimer
34         )