2026-01-15 21:51:16 -05:00
|
|
|
# Copyright (c) Advanced Micro Devices, Inc.
|
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
2025-08-21 15:56:47 -04:00
|
|
|
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
|
2022-03-07 20:40:48 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
project(rocprofiler-systems-user-api-example LANGUAGES CXX)
|
2022-11-01 17:28:12 -05:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
if(ROCPROFSYS_DISABLE_EXAMPLES)
|
2022-11-01 17:28:12 -05:00
|
|
|
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
|
|
|
|
|
2025-06-22 10:44:33 -04:00
|
|
|
if(
|
|
|
|
|
${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES
|
|
|
|
|
OR ${_DIR} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES
|
|
|
|
|
)
|
2022-11-01 17:28:12 -05:00
|
|
|
return()
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2022-03-07 20:40:48 -06:00
|
|
|
|
2022-03-22 15:51:57 -05:00
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
2022-03-07 20:40:48 -06:00
|
|
|
find_package(Threads REQUIRED)
|
2024-10-15 11:20:40 -04:00
|
|
|
if(NOT TARGET rocprofiler-systems::rocprofiler-systems-user-library)
|
|
|
|
|
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
|
2022-05-31 01:51:18 -05:00
|
|
|
endif()
|
2022-03-07 20:40:48 -06:00
|
|
|
add_executable(user-api user-api.cpp)
|
2024-10-15 11:20:40 -04:00
|
|
|
target_link_libraries(
|
2025-06-22 10:44:33 -04:00
|
|
|
user-api
|
|
|
|
|
PRIVATE Threads::Threads rocprofiler-systems::rocprofiler-systems-user-library
|
|
|
|
|
)
|
2022-03-07 20:40:48 -06:00
|
|
|
|
2026-01-15 21:51:16 -05:00
|
|
|
if(ROCPROFSYS_INSTALL_EXAMPLES AND TARGET user-api)
|
|
|
|
|
install(
|
|
|
|
|
TARGETS user-api
|
|
|
|
|
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/rocprofiler-systems/examples
|
|
|
|
|
COMPONENT rocprofiler-systems-examples
|
|
|
|
|
)
|
2022-03-07 20:40:48 -06:00
|
|
|
endif()
|