1 Star 0 Fork 0

ysl/triSYCL

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 3.39 KB
一键复制 编辑 原始数据 按行查看 历史
# The minimum version of CMake necessary to build this project
cmake_minimum_required (VERSION 3.5)
set(TRISYCL_VERSION_MAJOR 0)
set(TRISYCL_VERSION_MINOR 1)
set(TRISYCL_VERSION_PATCH 0)
set(TRISYCL_VERSION
"${TRISYCL_VERSION_MAJOR}.${TRISYCL_VERSION_MINOR}.${TRISYCL_VERSION_PATCH}")
project(triSYCL VERSION ${TRISYCL_VERSION} LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(FindtriSYCL)
# Enable CTest
include(CTest)
enable_testing()
# All targets inherit SYCL include dir
include_directories(${PROJECT_SOURCE_DIR}/include)
# All targets inherit SYCL test include dir since it is about testing here
include_directories(${PROJECT_SOURCE_DIR}/tests/common)
# Recurse into tests dir to pick up unit tests
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
add_library(${PROJECT_NAME} INTERFACE)
# Package definition
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(namespace "${PROJECT_NAME}::")
set(CMAKEPACKAGE_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}")
set(PACKAGE_TRISYCL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}" )
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${PACKAGE_TRISYCL_INCLUDE_DIR}>
)
set_target_properties (${PROJECT_NAME} PROPERTIES EXPORT_NAME ${PROJECT_NAME})
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CMAKEPACKAGE_INSTALL_DIR}
)
write_basic_package_version_file(
"${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${TRISYCL_VERSION}
COMPATIBILITY SameMajorVersion
)
export(TARGETS ${PROJECT_NAME} NAMESPACE ${namespace} FILE ${PROJECT_NAME}Targets.cmake)
export(PACKAGE ${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
)
install(EXPORT ${TARGETS_EXPORT_NAME} NAMESPACE ${namespace} DESTINATION ${CMAKEPACKAGE_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKEPACKAGE_INSTALL_DIR} )
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# CPACK
if(EXISTS "/etc/debian_version")
set(DEBIAN TRUE CACHE BOOL "Enable debian specific options: 64-bit lib name and .deb generation")
endif()
if(DEBIAN)
set(CPACK_GENERATOR "TGZ;DEB" )
else()
set(CPACK_GENERATOR "TGZ" )
endif()
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${TRISYCL_VERSION}-${CMAKE_HOST_SYSTEM_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-Source" )
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SYCL reference implementation" )
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VENDOR "Neutral" )
set(CPACK_PACKAGE_CONTACT "${PROJECT_NAME} Maintainers")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.rst")
set(CPACK_PACKAGE_VERSION_MAJOR ${TRISYCL_VERSION_MAJOR} )
set(CPACK_PACKAGE_VERSION_MINOR ${TRISYCL_VERSION_MINOR} )
set(CPACK_PACKAGE_VERSION_PATCH ${TRISYCL_VERSION_PATCH} )
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev,librange-v3-dev")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "opencl-c-headers (>=1.2), build-essential, cmake")
include(CPack)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/publiagent123/triSYCL.git
git@gitee.com:publiagent123/triSYCL.git
publiagent123
triSYCL
triSYCL
master

搜索帮助