2022-04-22 03:05:07 -05:00
cmake_minimum_required ( VERSION 3.16 FATAL_ERROR )
2021-08-06 13:08:57 -05:00
2021-09-20 11:12:06 -05:00
if ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND CMAKE_CURRENT_SOURCE_DIR STREQUAL
CMAKE_SOURCE_DIR )
2021-08-06 13:08:57 -05:00
set ( MSG "" )
message ( STATUS "Warning! Building from the source directory is not recommended" )
message ( STATUS "If unintented, please remove 'CMakeCache.txt' and 'CMakeFiles'" )
message ( STATUS "and build from a separate directory" )
message ( AUTHOR_WARNING "In-source build" )
endif ()
2021-10-01 16:46:03 -05:00
if ( NOT UNIX OR APPLE )
message (
AUTHOR_WARNING
2021-11-24 04:59:59 -06:00
"omnitrace only supports Linux. Configure and/or build is likely to fail" )
2021-10-01 16:46:03 -05:00
endif ()
2021-11-24 04:59:59 -06:00
file ( READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" FULL_VERSION_STRING LIMIT_COUNT 1 )
string ( REGEX REPLACE "(\n|\r)" "" FULL_VERSION_STRING "${FULL_VERSION_STRING}" )
string ( REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3" OMNITRACE_VERSION
"${FULL_VERSION_STRING}" )
2021-08-06 13:08:57 -05:00
project (
2021-11-24 04:59:59 -06:00
omnitrace
2021-08-17 17:34:34 -05:00
LANGUAGES C CXX
2021-11-24 04:59:59 -06:00
VERSION ${ OMNITRACE_VERSION }
DESCRIPTION "CPU/GPU Application tracing with static/dynamic binary instrumentation"
2024-04-23 02:44:02 -04:00
HOMEPAGE_URL "https://github.com/ROCm/omnitrace" )
2021-08-06 13:08:57 -05:00
2022-07-17 21:52:09 -05:00
find_package ( Git )
if ( Git_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git" )
execute_process (
COMMAND ${ GIT_EXECUTABLE } describe --tags
OUTPUT_VARIABLE OMNITRACE_GIT_DESCRIBE
2022-11-01 17:28:12 -05:00
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _GIT_DESCRIBE_RESULT
ERROR_QUIET )
if ( NOT _GIT_DESCRIBE_RESULT EQUAL 0 )
execute_process (
COMMAND ${ GIT_EXECUTABLE } describe
OUTPUT_VARIABLE OMNITRACE_GIT_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _GIT_DESCRIBE_RESULT
ERROR_QUIET )
endif ()
2022-07-17 21:52:09 -05:00
execute_process (
COMMAND ${ GIT_EXECUTABLE } rev-parse HEAD
OUTPUT_VARIABLE OMNITRACE_GIT_REVISION
2022-11-01 17:28:12 -05:00
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET )
2022-07-17 21:52:09 -05:00
else ()
set ( OMNITRACE_GIT_DESCRIBE "v${OMNITRACE_VERSION}" )
set ( OMNITRACE_GIT_REVISION "" )
endif ()
2021-09-20 11:12:06 -05:00
message (
STATUS
2022-07-17 21:52:09 -05:00
"[${PROJECT_NAME}] version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} (${FULL_VERSION_STRING})"
2021-09-20 11:12:06 -05:00
)
2022-07-17 21:52:09 -05:00
message ( STATUS "[${PROJECT_NAME}] git revision: ${OMNITRACE_GIT_REVISION}" )
message ( STATUS "[${PROJECT_NAME}] git describe: ${OMNITRACE_GIT_DESCRIBE}" )
2021-10-01 16:46:03 -05:00
set ( CMAKE_MODULE_PATH ${ PROJECT_SOURCE_DIR } /cmake ${ PROJECT_SOURCE_DIR } /cmake/Modules
2022-04-21 21:36:07 -05:00
${ PROJECT_SOURCE_DIR } /source/python/cmake ${ CMAKE_MODULE_PATH } )
2021-09-20 11:12:06 -05:00
set ( BUILD_SHARED_LIBS
ON
CACHE BOOL "Build shared libraries" )
set ( BUILD_STATIC_LIBS
OFF
CACHE BOOL "Build static libraries" )
set ( CMAKE_POSITION_INDEPENDENT_CODE
ON
CACHE BOOL "Build position independent code" )
2021-08-06 13:08:57 -05:00
2024-01-10 05:02:22 -06:00
if ( CMAKE_VERSION VERSION_GREATER_EQUAL 3.24 )
cmake_policy ( SET CMP0135 NEW )
endif ()
2021-08-06 13:08:57 -05:00
if ( "${CMAKE_BUILD_TYPE}" STREQUAL "" )
2021-09-20 11:12:06 -05:00
set ( CMAKE_BUILD_TYPE
2022-04-22 03:05:07 -05:00
Release
2021-09-20 11:12:06 -05:00
CACHE STRING "Build type" FORCE )
2022-04-05 00:24:34 -05:00
else ()
set ( VALID_BUILD_TYPES "Release" "RelWithDebInfo" "Debug" "MinSizeRel" )
if ( NOT "${CMAKE_BUILD_TYPE}" IN_LIST VALID_BUILD_TYPES )
string ( REPLACE ";" ", " _VALID_BUILD_TYPES "${VALID_BUILD_TYPES}" )
message (
FATAL_ERROR
"Invalid CMAKE_BUILD_TYPE :: ${CMAKE_BUILD_TYPE}. Valid build types are: ${_VALID_BUILD_TYPES}"
)
endif ()
endif ()
set ( _STRIP_LIBRARIES_DEFAULT OFF )
if ( "${CMAKE_BUILD_TYPE}" STREQUAL "Release" )
set ( _STRIP_LIBRARIES_DEFAULT ON )
2021-08-06 13:08:57 -05:00
endif ()
2022-04-21 20:33:51 -05:00
if ( DEFINED CMAKE_INSTALL_LIBDIR AND NOT DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR )
# always have a fresh install
unset ( CMAKE_INSTALL_LIBDIR CACHE )
include ( GNUInstallDirs ) # install directories
# force this because dyninst always installs to lib
set ( CMAKE_DEFAULT_INSTALL_LIBDIR
"${CMAKE_INSTALL_LIBDIR}"
CACHE STRING "Object code libraries" FORCE )
endif ()
2022-09-30 10:47:07 -05:00
if ( NOT "$ENV{OMNITRACE_CI}" STREQUAL "" )
set ( CI_BUILD $ENV{ OMNITRACE_CI } )
else ()
set ( CI_BUILD OFF )
endif ()
2021-09-20 11:12:06 -05:00
include ( GNUInstallDirs ) # install directories
include ( MacroUtilities ) # various functions and macros
2022-09-30 10:47:07 -05:00
if ( CI_BUILD )
omnitrace_add_option ( OMNITRACE_BUILD_CI "Enable internal asserts, etc." ON ADVANCED
NO_FEATURE )
omnitrace_add_option ( OMNITRACE_BUILD_TESTING "Enable building the testing suite" ON
ADVANCED )
omnitrace_add_option ( OMNITRACE_BUILD_DEBUG
"Enable building with extensive debug symbols" OFF ADVANCED )
omnitrace_add_option (
OMNITRACE_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" OFF ADVANCED )
omnitrace_add_option ( OMNITRACE_STRIP_LIBRARIES "Strip the libraries" OFF ADVANCED )
else ()
omnitrace_add_option ( OMNITRACE_BUILD_CI "Enable internal asserts, etc." OFF ADVANCED
NO_FEATURE )
omnitrace_add_option ( OMNITRACE_BUILD_EXAMPLES "Enable building the examples" OFF
ADVANCED )
omnitrace_add_option ( OMNITRACE_BUILD_TESTING "Enable building the testing suite" OFF
ADVANCED )
omnitrace_add_option ( OMNITRACE_BUILD_DEBUG
"Enable building with extensive debug symbols" OFF ADVANCED )
omnitrace_add_option (
OMNITRACE_BUILD_HIDDEN_VISIBILITY
"Build with hidden visibility (disable for Debug builds)" ON ADVANCED )
omnitrace_add_option ( OMNITRACE_STRIP_LIBRARIES "Strip the libraries"
${ _STRIP_LIBRARIES_DEFAULT } ADVANCED )
endif ()
2021-09-20 11:12:06 -05:00
include ( Compilers ) # compiler identification
include ( BuildSettings ) # compiler flags
2021-08-06 13:08:57 -05:00
2022-04-04 15:27:38 -05:00
set ( CMAKE_INSTALL_LIBDIR
"lib"
CACHE STRING "Object code libraries (lib)" FORCE )
2021-09-20 11:12:06 -05:00
set ( CMAKE_CXX_STANDARD
17
CACHE STRING "CXX language standard" )
2022-05-26 10:03:31 -05:00
2022-01-24 20:49:17 -06:00
omnitrace_add_feature ( CMAKE_BUILD_TYPE "Build optimization level" )
2022-04-04 15:27:38 -05:00
omnitrace_add_feature ( CMAKE_INSTALL_PREFIX "Installation prefix" )
omnitrace_add_feature ( CMAKE_CXX_COMPILER "C++ compiler" )
omnitrace_add_feature ( CMAKE_CXX_STANDARD "CXX language standard" )
2021-11-24 04:59:59 -06:00
omnitrace_add_option ( CMAKE_CXX_STANDARD_REQUIRED "Require C++ language standard" ON )
omnitrace_add_option ( CMAKE_CXX_EXTENSIONS "Compiler specific language extensions" OFF )
omnitrace_add_option ( CMAKE_INSTALL_RPATH_USE_LINK_PATH "Enable rpath to linked libraries"
2021-11-23 02:53:14 -06:00
ON )
2022-05-24 22:45:26 -05:00
set ( CMAKE_INSTALL_MESSAGE
"LAZY"
CACHE STRING "Installation message" )
mark_as_advanced ( CMAKE_INSTALL_MESSAGE )
2022-01-24 20:49:17 -06:00
2021-11-24 04:59:59 -06:00
omnitrace_add_option ( OMNITRACE_USE_CLANG_TIDY "Enable clang-tidy" OFF )
2022-09-28 00:18:05 -05:00
omnitrace_add_option ( OMNITRACE_USE_BFD
"Enable BFD support (map call-stack samples to LOC)" ON )
2021-11-24 04:59:59 -06:00
omnitrace_add_option ( OMNITRACE_USE_MPI "Enable MPI support" OFF )
2022-01-24 20:49:17 -06:00
omnitrace_add_option ( OMNITRACE_USE_HIP "Enable HIP support" ON )
2022-04-21 20:33:51 -05:00
omnitrace_add_option ( OMNITRACE_USE_PAPI "Enable HW counter support via PAPI" ON )
2022-01-24 20:49:17 -06:00
omnitrace_add_option ( OMNITRACE_USE_ROCTRACER "Enable roctracer support"
${ OMNITRACE_USE_HIP } )
2022-07-17 21:52:09 -05:00
omnitrace_add_option ( OMNITRACE_USE_ROCPROFILER "Enable rocprofiler support"
${ OMNITRACE_USE_HIP } )
2022-02-08 17:42:17 -06:00
omnitrace_add_option (
OMNITRACE_USE_ROCM_SMI "Enable rocm-smi support for power/temp/etc. sampling"
${ OMNITRACE_USE_HIP } )
2022-07-25 12:16:11 -05:00
omnitrace_add_option ( OMNITRACE_USE_RCCL "Enable RCCL support" ${ OMNITRACE_USE_HIP } )
2021-11-24 04:59:59 -06:00
omnitrace_add_option ( OMNITRACE_USE_MPI_HEADERS
2022-05-26 10:03:31 -05:00
"Enable wrapping MPI functions w/o enabling MPI dependency" ON )
2022-04-21 20:33:51 -05:00
omnitrace_add_option ( OMNITRACE_USE_OMPT "Enable OpenMP tools support" ON )
2022-04-05 00:24:34 -05:00
omnitrace_add_option ( OMNITRACE_USE_PYTHON "Enable Python support" OFF )
2022-01-24 20:49:17 -06:00
omnitrace_add_option ( OMNITRACE_BUILD_DYNINST "Build dyninst from submodule" OFF )
2022-05-26 10:03:31 -05:00
omnitrace_add_option ( OMNITRACE_BUILD_LIBUNWIND "Build libunwind from submodule" ON )
2022-10-31 15:39:45 -05:00
omnitrace_add_option ( OMNITRACE_BUILD_CODECOV "Build for code coverage" OFF )
2022-05-11 15:05:09 -05:00
omnitrace_add_option ( OMNITRACE_INSTALL_PERFETTO_TOOLS
"Install perfetto tools (i.e. traced, perfetto, etc.)" OFF )
2022-04-05 00:24:34 -05:00
2022-04-21 20:33:51 -05:00
if ( OMNITRACE_USE_PAPI )
omnitrace_add_option ( OMNITRACE_BUILD_PAPI "Build PAPI from submodule" ON )
endif ()
2022-04-05 00:24:34 -05:00
if ( OMNITRACE_USE_PYTHON )
omnitrace_add_option ( OMNITRACE_BUILD_PYTHON
"Build python bindings with internal pybind11" ON )
2022-11-01 17:28:12 -05:00
elseif ( "$ENV{OMNITRACE_CI}" )
# quiet warnings in dashboard
if ( OMNITRACE_PYTHON_ENVS OR OMNITRACE_PYTHON_PREFIX )
omnitrace_message (
STATUS
"Ignoring values of OMNITRACE_PYTHON_ENVS and/or OMNITRACE_PYTHON_PREFIX" )
endif ()
2022-04-05 00:24:34 -05:00
endif ()
2022-02-25 03:56:41 -06:00
2022-01-24 20:49:17 -06:00
if ( NOT OMNITRACE_USE_HIP )
set ( OMNITRACE_USE_ROCTRACER
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE )
2022-07-17 21:52:09 -05:00
set ( OMNITRACE_USE_ROCPROFILER
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE )
2022-03-23 00:28:25 -05:00
set ( OMNITRACE_USE_ROCM_SMI
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE )
2022-07-25 12:16:11 -05:00
set ( OMNITRACE_USE_RCCL
OFF
CACHE BOOL "Disabled via OMNITRACE_USE_HIP=OFF" FORCE )
2022-05-26 10:03:31 -05:00
elseif (
OMNITRACE_USE_HIP
AND NOT OMNITRACE_USE_ROCTRACER
2022-07-17 21:52:09 -05:00
AND NOT OMNITRACE_USE_ROCPROFILER
2022-07-25 12:16:11 -05:00
AND NOT OMNITRACE_USE_ROCM_SMI
AND NOT OMNITRACE_USE_RCCL )
2022-05-26 10:03:31 -05:00
omnitrace_message (
AUTHOR_WARNING
2022-07-25 12:16:11 -05:00
"Setting OMNITRACE_USE_HIP=OFF because roctracer, rocprofiler, rccl, and rocm-smi options are disabled"
2022-05-26 10:03:31 -05:00
)
set ( OMNITRACE_USE_HIP OFF )
2022-01-24 20:49:17 -06:00
endif ()
2021-11-23 02:53:14 -06:00
2022-03-07 20:40:48 -06:00
if ( OMNITRACE_BUILD_TESTING )
set ( OMNITRACE_BUILD_EXAMPLES
ON
CACHE BOOL "Enable building the examples" FORCE )
endif ()
2021-11-23 02:53:14 -06:00
include ( ProcessorCount )
2021-11-24 04:59:59 -06:00
processorcount ( OMNITRACE_PROCESSOR_COUNT )
2023-02-09 09:47:48 -06:00
if ( OMNITRACE_PROCESSOR_COUNT LESS 8 )
2022-01-24 20:49:17 -06:00
set ( OMNITRACE_THREAD_COUNT 128 )
2023-02-09 09:47:48 -06:00
else ()
math ( EXPR OMNITRACE_THREAD_COUNT "16 * ${OMNITRACE_PROCESSOR_COUNT}" )
compute_pow2_ceil ( OMNITRACE_THREAD_COUNT "16 * ${OMNITRACE_PROCESSOR_COUNT}" )
# set the default to 2048 if it could not be calculated
if ( OMNITRACE_THREAD_COUNT LESS 2 )
set ( OMNITRACE_THREAD_COUNT 2048 )
endif ()
2022-01-24 20:49:17 -06:00
endif ()
2023-02-09 09:47:48 -06:00
2021-11-24 04:59:59 -06:00
set ( OMNITRACE_MAX_THREADS
"${OMNITRACE_THREAD_COUNT}"
2021-11-23 02:53:14 -06:00
CACHE
STRING
"Maximum number of threads in the host application. Likely only needs to be increased if host app does not use thread-pool but creates many threads"
)
2021-11-24 04:59:59 -06:00
omnitrace_add_feature (
OMNITRACE_MAX_THREADS
2022-01-24 20:49:17 -06:00
"Maximum number of total threads supported in the host application (default: max of 128 or 16 * nproc)"
2021-11-23 02:53:14 -06:00
)
2023-02-09 09:47:48 -06:00
compute_pow2_ceil ( _MAX_THREADS "${OMNITRACE_MAX_THREADS}" )
if ( _MAX_THREADS GREATER 0 AND NOT OMNITRACE_MAX_THREADS EQUAL _MAX_THREADS )
omnitrace_message (
FATAL_ERROR
"Error! OMNITRACE_MAX_THREADS must be a power of 2. Recommendation: ${_MAX_THREADS}"
)
elseif ( NOT OMNITRACE_MAX_THREADS EQUAL _MAX_THREADS )
omnitrace_message (
AUTHOR_WARNING
"OMNITRACE_MAX_THREADS (=${OMNITRACE_MAX_THREADS}) must be a power of 2. We were unable to verify it so we are emitting this warning instead. Estimate resulted in: ${_MAX_THREADS}"
)
endif ()
2022-08-31 01:24:31 -05:00
set ( OMNITRACE_MAX_UNWIND_DEPTH
"64"
CACHE
STRING
"Maximum call-stack depth to search during call-stack unwinding. Decreasing this value will result in sampling consuming less memory"
)
omnitrace_add_feature (
OMNITRACE_MAX_UNWIND_DEPTH
"Maximum call-stack depth to search during call-stack unwinding. Decreasing this value will result in sampling consuming less memory"
)
2021-09-02 13:14:58 -05:00
2021-11-23 02:53:14 -06:00
# default visibility settings
2022-01-24 20:49:17 -06:00
set ( CMAKE_C_VISIBILITY_PRESET
"default"
CACHE STRING "Visibility preset for non-inline C functions" )
set ( CMAKE_CXX_VISIBILITY_PRESET
"default"
CACHE STRING "Visibility preset for non-inline C++ functions/objects" )
set ( CMAKE_VISIBILITY_INLINES_HIDDEN
OFF
CACHE BOOL "Visibility preset for inline functions" )
2021-11-23 02:53:14 -06:00
set ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
include ( Formatting ) # format target
2021-09-20 11:12:06 -05:00
include ( Packages ) # finds third-party libraries
2021-08-06 13:08:57 -05:00
2021-11-24 04:59:59 -06:00
omnitrace_activate_clang_tidy ()
2021-08-06 13:08:57 -05:00
2021-11-23 02:53:14 -06:00
# custom visibility settings
2022-01-24 20:49:17 -06:00
if ( OMNITRACE_BUILD_HIDDEN_VISIBILITY )
2022-02-19 02:00:59 -06:00
set ( CMAKE_C_VISIBILITY_PRESET "internal" )
set ( CMAKE_CXX_VISIBILITY_PRESET "internal" )
2022-01-24 20:49:17 -06:00
set ( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
endif ()
2021-09-15 16:45:49 -05:00
2022-03-22 15:51:57 -05:00
if ( OMNITRACE_BUILD_TESTING OR "$ENV{OMNITRACE_CI}" MATCHES "[1-9]+|ON|on|y|yes" )
2022-03-07 20:40:48 -06:00
enable_testing ()
2022-10-31 15:39:45 -05:00
include ( CTest )
2022-03-07 20:40:48 -06:00
endif ()
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:08:57 -05:00
#
2022-02-19 02:00:59 -06:00
# library and executables
2021-08-06 13:08:57 -05:00
#
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:08:57 -05:00
2022-07-23 03:02:31 -05:00
set ( CMAKE_INSTALL_DEFAULT_COMPONENT_NAME core )
2022-10-31 15:39:45 -05:00
if ( OMNITRACE_BUILD_CODECOV )
omnitrace_save_variables ( CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
foreach ( _BUILD_TYPE DEBUG MINSIZEREL RELWITHDEBINFO RELEASE )
omnitrace_save_variables ( CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS_ ${ _BUILD_TYPE }
CMAKE_CXX_FLAGS_ ${ _BUILD_TYPE } )
endforeach ()
foreach ( _BUILD_TYPE DEBUG MINSIZEREL RELWITHDEBINFO RELEASE )
set ( CMAKE_C_FLAGS_ ${ _BUILD_TYPE }
"-Og -g3 -fno-omit-frame-pointer -fprofile-abs-path -fprofile-arcs -ftest-coverage"
)
set ( CMAKE_CXX_FLAGS_ ${ _BUILD_TYPE }
"-Og -g3 -fno-omit-frame-pointer -fprofile-abs-path -fprofile-arcs -ftest-coverage"
)
endforeach ()
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
endif ()
2022-02-19 02:00:59 -06:00
add_subdirectory ( source )
2021-08-06 13:08:57 -05:00
2022-10-31 15:39:45 -05:00
if ( OMNITRACE_BUILD_CODECOV )
omnitrace_restore_variables ( CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS CMAKE_CXX_FLAGS )
foreach ( _BUILD_TYPE DEBUG MINSIZEREL RELWITHDEBINFO RELEASE )
omnitrace_restore_variables (
CODECOV_FLAGS VARIABLES CMAKE_C_FLAGS_ ${ _BUILD_TYPE }
CMAKE_CXX_FLAGS_ ${ _BUILD_TYPE } )
endforeach ()
endif ()
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-09-02 13:14:58 -05:00
#
2021-09-20 11:12:06 -05:00
# miscellaneous installs
2021-09-02 13:14:58 -05:00
#
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-09-02 13:14:58 -05:00
2022-09-21 13:58:14 -05:00
if ( NOT OMNITRACE_USE_ROCTRACER AND NOT OMNITRACE_USE_ROCPROFILER )
set ( OMNITRACE_HSA_ENV "# " )
endif ()
if ( NOT OMNITRACE_USE_ROCPROFILER )
set ( OMNITRACE_ROCP_ENV "# " )
endif ()
2022-08-08 08:38:38 -05:00
configure_file (
2024-01-10 05:02:22 -06:00
${ PROJECT_SOURCE_DIR } /perfetto.cfg
${ PROJECT_BINARY_DIR } / ${ CMAKE_INSTALL_DATAROOTDIR } / ${ PROJECT_NAME } /perfetto.cfg
2022-08-08 08:38:38 -05:00
COPYONLY )
configure_file (
${ PROJECT_SOURCE_DIR } /cmake/Templates/setup-env.sh.in
${ PROJECT_BINARY_DIR } / ${ CMAKE_INSTALL_DATAROOTDIR } / ${ PROJECT_NAME } /setup-env.sh @ONLY )
2022-04-04 15:27:38 -05:00
configure_file (
${ PROJECT_SOURCE_DIR } /cmake/Templates/modulefile.in
2022-08-08 08:38:38 -05:00
${ PROJECT_BINARY_DIR } / ${ CMAKE_INSTALL_DATAROOTDIR } /modulefiles/ ${ PROJECT_NAME } / ${ OMNITRACE_VERSION }
2022-04-04 15:27:38 -05:00
@ONLY )
2021-10-01 16:46:03 -05:00
2021-09-02 13:14:58 -05:00
install (
2022-08-08 08:38:38 -05:00
FILES ${ PROJECT_BINARY_DIR } / ${ CMAKE_INSTALL_DATAROOTDIR } / ${ PROJECT_NAME } /setup-env.sh
2024-01-10 05:02:22 -06:00
${ PROJECT_BINARY_DIR } / ${ CMAKE_INSTALL_DATAROOTDIR } / ${ PROJECT_NAME } /perfetto.cfg
2021-10-01 16:46:03 -05:00
DESTINATION ${ CMAKE_INSTALL_DATAROOTDIR } / ${ PROJECT_NAME }
2022-08-08 08:38:38 -05:00
COMPONENT setup )
2021-09-02 13:14:58 -05:00
2022-04-04 15:27:38 -05:00
install (
FILES
2022-08-08 08:38:38 -05:00
${ PROJECT_BINARY_DIR } / ${ CMAKE_INSTALL_DATAROOTDIR } /modulefiles/ ${ PROJECT_NAME } / ${ OMNITRACE_VERSION }
2022-04-04 15:27:38 -05:00
DESTINATION ${ CMAKE_INSTALL_DATAROOTDIR } /modulefiles/ ${ PROJECT_NAME }
2022-08-08 08:38:38 -05:00
COMPONENT setup )
2022-04-04 15:27:38 -05:00
2023-02-27 12:09:03 -06:00
# ------------------------------------------------------------------------------#
#
# install
#
# ------------------------------------------------------------------------------#
set ( CMAKE_INSTALL_DEFAULT_COMPONENT_NAME core )
include ( ConfigInstall )
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:08:57 -05:00
#
2021-09-20 11:12:06 -05:00
# examples
2021-08-06 13:08:57 -05:00
#
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:08:57 -05:00
2022-03-07 20:40:48 -06:00
if ( OMNITRACE_BUILD_EXAMPLES )
2023-02-27 12:09:03 -06:00
set ( CMAKE_INSTALL_DEFAULT_COMPONENT_NAME examples )
2022-01-24 20:49:17 -06:00
add_subdirectory ( examples )
endif ()
2021-08-06 13:08:57 -05:00
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:08:57 -05:00
#
2021-09-20 11:12:06 -05:00
# tests
2021-08-06 13:08:57 -05:00
#
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:08:57 -05:00
2022-01-24 20:49:17 -06:00
if ( OMNITRACE_BUILD_TESTING )
2023-02-27 12:09:03 -06:00
set ( CMAKE_INSTALL_DEFAULT_COMPONENT_NAME testing )
2022-01-24 20:49:17 -06:00
add_subdirectory ( tests )
endif ()
2021-08-06 13:29:09 -05:00
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:29:09 -05:00
#
2021-09-20 11:12:06 -05:00
# packaging
2021-08-06 13:29:09 -05:00
#
2021-09-20 11:12:06 -05:00
# ------------------------------------------------------------------------------#
2021-08-06 13:29:09 -05:00
2022-07-23 03:02:31 -05:00
set ( CMAKE_INSTALL_DEFAULT_COMPONENT_NAME core )
2021-08-06 13:29:09 -05:00
include ( ConfigCPack )
2021-11-23 02:53:14 -06:00
# ------------------------------------------------------------------------------#
#
# config info
#
# ------------------------------------------------------------------------------#
2021-11-24 04:59:59 -06:00
omnitrace_print_features ()