build_opencl-icd-loader.cmake 1.1 KB

123456789101112131415161718192021222324
  1. # This scirpt builds universal OpenCL ICD Loader that searches for OpenCL
  2. # implementations at run-time. The package also includes OpenCL headers.
  3. include("${CMAKE_CURRENT_LIST_DIR}/helpers.cmake")
  4. prepare_package_source(opencl-icd-loader 0.0 https://github.com/KhronosGroup/OpenCL-ICD-Loader/archive/master/OpenCL-ICD-Loader.tar.gz)
  5. if (NOT EXISTS ${SOURCE_DIR}/inc/CL)
  6. download_and_unpack(https://github.com/KhronosGroup/OpenCL-Headers/archive/master/OpenCL-Headers.tar.gz ${SOURCE_DIR} STATUS)
  7. file(RENAME ${SOURCE_DIR}/OpenCL-Headers-master ${SOURCE_DIR}/inc/CL)
  8. endif()
  9. execute_process(COMMAND cmake ${SOURCE_DIR} -G "Visual Studio 14 2015 Win64"
  10. WORKING_DIRECTORY ${BUILD_DIR})
  11. execute_process(COMMAND cmake --build ${BUILD_DIR}
  12. --target OpenCL --config Release)
  13. file(COPY ${BUILD_DIR}/Release/OpenCl.lib DESTINATION ${INSTALL_DIR}/win64/lib/)
  14. file(COPY ${BUILD_DIR}/bin/Release/OpenCl.dll DESTINATION ${INSTALL_DIR}/win64/bin/)
  15. file(COPY ${SOURCE_DIR}/inc/CL DESTINATION ${INSTALL_DIR}/win64/include/)
  16. create_package(${PACKAGE_NAME} ${INSTALL_DIR})