Want more features on Pastebin? Sign Up, it's FREE!
Guest

amdapp

By: a guest on Oct 20th, 2012  |  syntax: None  |  size: 2.21 KB  |  views: 41  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. cmake_minimum_required(VERSION 2.6)
  2.  
  3. # Configure
  4. set(AMDAPPSDKROOT $ENV{AMDAPPSDKROOT}
  5.     CACHE FILEPATH "ATI Stream SDK root path")
  6. if(NOT CMAKE_BUILD_TYPE)
  7.   set(CMAKE_BUILD_TYPE Debug CACHE STRING
  8.       "Choose the type of build, options are:
  9.       None Debug Release RelWithDebInfo MinSizeRel." FORCE)
  10. endif()
  11.  
  12. if(TARGET_PLATFORM EQUAL 32)
  13.         set(TARGET_PLATFORM "32" CACHE STRING
  14.             "Target platform type (32-bit or 64-bit)" FORCE)
  15.         set(_arch "x86" INTERNAL)
  16.         set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
  17. else()
  18.         set(TARGET_PLATFORM "64" CACHE STRING
  19.             "Target platform type (32-bit or 64-bit)" FORCE)
  20.         set(_arch "x86_64" INTERNAL)
  21.         set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
  22. endif()
  23. message(STATUS "Target platform: ${TARGET_PLATFORM}-bit")
  24.  
  25.  
  26. # Find OpenCL SDK
  27. find_path(OPENCL_INCLUDE_DIRS CL/cl.h OpenCL/cl.h
  28.     HINTS $ENV{AMDAPPSDKROOT}/include ${AMDAPPSDKROOT}/include)
  29. find_library(OPENCL_LIBRARIES OpenCL
  30.     HINTS $ENV{AMDAPPSDKROOT}/lib/${_arch} ${AMDAPPSDKROOT}/lib/${_arch})
  31. if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES)
  32.     message(STATUS "Found OpenCL: ${OPENCL_LIBRARIES}")
  33. else()
  34.     message(FATAL_ERROR "Cannot find OpenCL SDK")
  35. endif()
  36. mark_as_advanced(OPENCL_INCLUDE_DIRS OPENCL_LIBRARIES)
  37. include_directories(${OPENCL_INCLUDE_DIRS})
  38. # Set the OpenCL library include path depending on target platform
  39. if(TARGET_PLATFORM EQUAL 64)
  40.         link_directories(${ATI_STREAM_SDK_ROOT}/lib/x86_64)
  41. else()
  42.         link_directories(${ATI_STREAM_SDK_ROOT}/lib/x86)
  43. endif()
  44.  
  45. # Find AMD APPML SDK
  46. if (NOT APPML_ROOT)
  47.         set (APPML_ROOT $ENV{AMDAPPSDKROOT}/../AMD/clAmdBlas)
  48. endif ()
  49. find_path(APPML_INCLUDE_DIRS clAmdBlas.h HINTS ${APPML_ROOT}/includ
  50. find_library(APPML_LIBRARIES clAmdBlas
  51.         HINTS ${APPML_ROOT}/lib${TARGET_PLATFORM}/import)
  52. if (APPML_INCLUDE_DIRS AND APPML_LIBRARIES)
  53.         message (STATUS "Found APPML BLAS: ${APPML_LIBRARIES}")
  54. else ()
  55.         message (FATAL_ERROR "Cannot find APPML BLAS SDK")
  56. endif ()
  57. mark_as_advanced(APPML_INCLUDE_DIRS APPML_LIBRARIES)
  58. include_directories(${APPML_INCLUDE_DIRS})
  59. link_directories(${APPML_ROOT}/lib${TARGET_PLATFORM}/import)
clone this paste RAW Paste Data