afc463c817
Using branch point for count since last change since we don't
have questions answered on tags yet.
Removed unused CMake files.
Restructured CMake to use the cache rather than only commandline
and be ccmake & cmake-gui friendly.
Dependency search paths are added for the Repo tree layout.
Search paths still needed for install paths.
Simplified packaging. hsa-ext-rocr-dev package and contents now
build from the package CMake rather than being 3 separate projects.
Not applying new version number or new install paths!
Change-Id: Ibea50dc8a6ab091e91857f78833f5379a4511547
[ROCm/ROCR-Runtime commit: 6c3acda664]
104 خطوط
4.9 KiB
Plaintext
104 خطوط
4.9 KiB
Plaintext
################################################################################
|
|
##
|
|
## The University of Illinois/NCSA
|
|
## Open Source License (NCSA)
|
|
##
|
|
## Copyright (c) 2014-2017, Advanced Micro Devices, Inc. All rights reserved.
|
|
##
|
|
## Developed by:
|
|
##
|
|
## AMD Research and AMD HSA Software Development
|
|
##
|
|
## Advanced Micro Devices, Inc.
|
|
##
|
|
## www.amd.com
|
|
##
|
|
## Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
## of this software and associated documentation files (the "Software"), to
|
|
## deal with the Software without restriction, including without limitation
|
|
## the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
## and#or sell copies of the Software, and to permit persons to whom the
|
|
## Software is furnished to do so, subject to the following conditions:
|
|
##
|
|
## - Redistributions of source code must retain the above copyright notice,
|
|
## this list of conditions and the following disclaimers.
|
|
## - Redistributions in binary form must reproduce the above copyright
|
|
## notice, this list of conditions and the following disclaimers in
|
|
## the documentation and#or other materials provided with the distribution.
|
|
## - Neither the names of Advanced Micro Devices, Inc,
|
|
## nor the names of its contributors may be used to endorse or promote
|
|
## products derived from this Software without specific prior written
|
|
## permission.
|
|
##
|
|
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
## THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
## OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
## ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
## DEALINGS WITH THE SOFTWARE.
|
|
##
|
|
################################################################################
|
|
|
|
cmake_minimum_required ( VERSION 3.5.0 )
|
|
|
|
## Set the name and project name.
|
|
set ( PROJECT_STRING hsa-ext-rocr-dev )
|
|
project ( ${PROJECT_STRING} )
|
|
|
|
## Include the cmake_modules utils.cmake
|
|
list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake_modules" )
|
|
include ( utils )
|
|
|
|
## Get the package version.
|
|
get_version ( "1.2.0" )
|
|
|
|
set( PACKAGE_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_COMMIT_COUNT}-${VERSION_JOB}-${VERSION_BUILD_ID}-${VERSION_HASH}" )
|
|
|
|
## Packaging directives
|
|
set ( CPACK_GENERATOR "DEB;RPM" CACHE STRING "Package types to build")
|
|
|
|
set ( PACKAGE_DIRECTORIES "hsa/lib")
|
|
add_custom_command ( OUTPUT ${PACKAGE_DIRECTORIES} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} -E make_directory "hsa/lib" )
|
|
add_custom_target (create_dirs DEPENDS ${PACKAGE_DIRECTORIES} )
|
|
|
|
set ( TOOLS_NAME "libhsa-runtime-tools64" )
|
|
set ( IMAGE_NAME "libhsa-ext-image64" )
|
|
|
|
set ( TOOLS_LIBRARY_SOURCE "${OUT_DIR}/lib/${TOOLS_NAME}.so*" )
|
|
set ( IMAGE_LIBRARY_SOURCE "${OUT_DIR}/lib/${IMAGE_NAME}.so*" )
|
|
|
|
set ( TOOLS_LIBRARY_TARGET "${CMAKE_CURRENT_BINARY_DIR}/hsa/lib/${TOOLS_NAME}.so" )
|
|
set ( IMAGE_LIBRARY_TARGET "${CMAKE_CURRENT_BINARY_DIR}/hsa/lib/${IMAGE_NAME}.so" )
|
|
|
|
add_custom_command ( OUTPUT ${TOOLS_LIBRARY_TARGET} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${TOOLS_LIBRARY_SOURCE} "${CMAKE_CURRENT_BINARY_DIR}/hsa/lib/" )
|
|
|
|
add_custom_command ( OUTPUT ${IMAGE_LIBRARY_TARGET} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${IMAGE_LIBRARY_SOURCE} "${CMAKE_CURRENT_BINARY_DIR}/hsa/lib/" )
|
|
|
|
add_custom_target ( copy_targets ALL DEPENDS create_dirs
|
|
${TOOLS_LIBRARY_TARGET}
|
|
${IMAGE_LIBRARY_TARGET}
|
|
)
|
|
|
|
install ( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/hsa/ DESTINATION hsa USE_SOURCE_PERMISSIONS )
|
|
|
|
set ( CPACK_PACKAGE_NAME ${PROJECT_NAME} )
|
|
set ( CPACK_PACKAGE_VENDOR "AMD" )
|
|
set ( CPACK_PACKAGE_VERSION ${PACKAGE_VERSION_STRING} )
|
|
set ( CPACK_PACKAGE_CONTACT "Advanced Micro Devices Inc." )
|
|
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD Heterogeneous System Architecture HSA - Linux HSA Runtime extensions for ROCm platforms" )
|
|
set ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/description" )
|
|
set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/copyright" )
|
|
|
|
# Debian package specific variables
|
|
set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCR-Runtime" )
|
|
set ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/prerm" )
|
|
|
|
# RPM package specific variables
|
|
set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/rpm_post" )
|
|
set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/rpm_postun" )
|
|
|
|
include ( CPack )
|