-
Notifications
You must be signed in to change notification settings - Fork 43
/
CMakeLists.txt
46 lines (34 loc) · 1.57 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
################################################################################
# Copyright (C) 2017 Advanced Micro Devices, Inc.
################################################################################
cmake_minimum_required (VERSION 3.6)
set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "")
project(rocm-cmake LANGUAGES NONE)
install(DIRECTORY share DESTINATION .)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake
DESTINATION share/rocmcmakebuildtools/cmake
)
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/share/rocmcmakebuildtools/cmake)
include(ROCMCreatePackage)
include(ROCMSetupVersion)
rocm_setup_version(VERSION 0.14.0)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake
COMPATIBILITY SameMajorVersion)
rocm_create_package(
NAME rocm-cmake
MAINTAINER "Paul Fultz II pfultz@amd.com"
)
set(CONFIGURE_DEPENDS)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
set(CONFIGURE_DEPENDS CONFIGURE_DEPENDS)
endif()
file(GLOB_RECURSE CMAKE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CONFIGURE_DEPENDS} share/*.cmake test/*.cmake)
add_custom_target(analyze COMMAND cmake-lint ${CMAKE_FILES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(format COMMAND cmake-format -i ${CMAKE_FILES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
enable_testing()
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR})
add_subdirectory(test)
add_subdirectory(docs)