2024-11-07 16:49:32 -05:00
|
|
|
cmake_minimum_required(VERSION 3.18.4 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)
|
|
|
|
|
|
2024-10-15 11:20:40 -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(
|
|
|
|
|
user-api PRIVATE Threads::Threads
|
|
|
|
|
rocprofiler-systems::rocprofiler-systems-user-library)
|
2022-03-07 20:40:48 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
if(ROCPROFSYS_INSTALL_EXAMPLES)
|
2022-05-31 14:55:31 -05:00
|
|
|
install(
|
|
|
|
|
TARGETS user-api
|
|
|
|
|
DESTINATION bin
|
2024-10-15 11:20:40 -04:00
|
|
|
COMPONENT rocprofiler-systems-examples)
|
2022-03-07 20:40:48 -06:00
|
|
|
endif()
|