Files
rocm-systems/examples/user-api/CMakeLists.txt
T

30 lines
944 B
CMake
Raw Normal View History

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
project(rocprofiler-systems-user-api-example LANGUAGES CXX)
2022-11-01 17:28:12 -05:00
if(ROCPROFSYS_DISABLE_EXAMPLES)
2022-11-01 17:28:12 -05:00
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
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)
if(NOT TARGET rocprofiler-systems::rocprofiler-systems-user-library)
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
endif()
2022-03-07 20:40:48 -06:00
add_executable(user-api user-api.cpp)
target_link_libraries(
user-api PRIVATE Threads::Threads
rocprofiler-systems::rocprofiler-systems-user-library)
2022-03-07 20:40:48 -06:00
if(ROCPROFSYS_INSTALL_EXAMPLES)
install(
TARGETS user-api
DESTINATION bin
COMPONENT rocprofiler-systems-examples)
2022-03-07 20:40:48 -06:00
endif()