Files
TheRock/rocm-systems/projects/rocprofiler-sdk/external/ptl/source/CMakeLists.txt
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

126 lines
4.1 KiB
CMake

# -------------------------------------------------------------------------------------- #
# General
# -------------------------------------------------------------------------------------- #
# Locate sources and headers for this project - headers are included so they will show up
# in IDEs
file(GLOB_RECURSE ptl_headers ${CMAKE_CURRENT_LIST_DIR}/PTL/*.hh
${CMAKE_CURRENT_LIST_DIR}/PTL/detail/*.hh)
file(GLOB_RECURSE ptl_sources ${CMAKE_CURRENT_LIST_DIR}/*.cc)
# -------------------------------------------------------------------------------------- #
# Config, Version
# -------------------------------------------------------------------------------------- #
configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/Config.hh.in
${CMAKE_CURRENT_BINARY_DIR}/PTL/Config.hh @ONLY)
list(APPEND ptl_headers ${CMAKE_CURRENT_BINARY_DIR}/PTL/Config.hh)
configure_file(${PROJECT_SOURCE_DIR}/cmake/Templates/Version.hh.in
${CMAKE_CURRENT_BINARY_DIR}/PTL/Version.hh @ONLY)
list(APPEND ptl_headers ${CMAKE_CURRENT_BINARY_DIR}/PTL/Version.hh)
# -------------------------------------------------------------------------------------- #
# PTL Library
# -------------------------------------------------------------------------------------- #
if(BUILD_OBJECT_LIBS)
ptl_build_library(
TYPE OBJECT
TARGET_NAME ptl-object
OUTPUT_NAME ptl
SOURCES ${ptl_headers} ${ptl_sources})
target_link_libraries(ptl-object PUBLIC Threads::Threads)
if(PTL_USE_TBB)
target_link_libraries(ptl-object PUBLIC TBB::tbb)
endif()
target_include_directories(
ptl-object PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
endif()
if(BUILD_SHARED_LIBS)
ptl_build_library(
TYPE SHARED
TARGET_NAME ptl-shared
OUTPUT_NAME ptl
SOURCES ${ptl_headers} ${ptl_sources})
target_link_libraries(ptl-shared PUBLIC Threads::Threads)
if(PTL_USE_TBB)
target_link_libraries(ptl-shared PUBLIC TBB::tbb)
endif()
target_compile_definitions(ptl-shared PUBLIC PTL_BUILD_DLL)
target_include_directories(
ptl-shared
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${PTL_INSTALL_INCLUDEDIR}>)
if(PTL_USE_SANITIZER AND NOT ("${PTL_SANITIZER_TYPE}" STREQUAL "leak"))
string(REPLACE " " ";" _sanitize_args "${ptl_sanitize_args}")
set_target_properties(ptl-shared PROPERTIES INTERFACE_LINK_OPTIONS
"${_sanitize_args}")
endif()
export(
TARGETS ptl-shared
NAMESPACE PTL::
FILE ${PROJECT_BINARY_DIR}/ptl-shared.cmake)
endif()
if(BUILD_STATIC_LIBS)
ptl_build_library(
TYPE STATIC
TARGET_NAME ptl-static
OUTPUT_NAME ptl
SOURCES ${ptl_headers} ${ptl_sources})
target_link_libraries(ptl-static PUBLIC Threads::Threads)
if(PTL_USE_TBB)
target_link_libraries(ptl-static PUBLIC TBB::tbb)
endif()
target_include_directories(
ptl-static
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:${PTL_INSTALL_INCLUDEDIR}>)
export(
TARGETS ptl-static
NAMESPACE PTL::
FILE ${PROJECT_BINARY_DIR}/ptl-static.cmake)
endif()
# -------------------------------------------------------------------------------------- #
# Installation
# -------------------------------------------------------------------------------------- #
if(PTL_INSTALL_CONFIG)
# install export
install(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE PTL::
DESTINATION ${PTL_INSTALL_CMAKEDIR}
COMPONENT Development)
endif()
if(PTL_INSTALL_HEADERS)
# headers - must use directory form due to nested structure
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/PTL ${CMAKE_CURRENT_BINARY_DIR}/PTL
DESTINATION ${PTL_INSTALL_INCLUDEDIR}
COMPONENT Development
FILES_MATCHING
PATTERN "*.hh")
endif()