pax_global_header00006660000000000000000000000064147360561530014524gustar00rootroot0000000000000052 comment=d70c538dd6897b7a4d6006a625cc7cb51d7cbfcd rocm-cmake-rocm-6.3.2/000077500000000000000000000000001473605615300145105ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/.azuredevops/000077500000000000000000000000001473605615300171355ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/.azuredevops/rocm-ci.yml000066400000000000000000000011541473605615300212120ustar00rootroot00000000000000resources: repositories: - repository: pipelines_repo type: github endpoint: ROCm name: ROCm/ROCm variables: - group: common - template: /.azuredevops/variables-global.yml@pipelines_repo trigger: batch: true branches: include: - develop - mainline paths: exclude: - .github - '.*.y*ml' - '*.md' - LICENSE pr: autoCancel: true branches: include: - develop - mainline paths: exclude: - .github - '.*.y*ml' - '*.md' - LICENSE drafts: false jobs: - template: ${{ variables.CI_COMPONENT_PATH }}/rocm-cmake.yml@pipelines_repo rocm-cmake-rocm-6.3.2/.github/000077500000000000000000000000001473605615300160505ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/.github/CODEOWNERS000066400000000000000000000004461473605615300174470ustar00rootroot00000000000000* @pfultz2 @lawruble13 @cgmb # Documentation files docs/ @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb *.md @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb *.rst @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb .readthedocs.yaml @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb rocm-cmake-rocm-6.3.2/.github/dependabot.yml000066400000000000000000000012341473605615300207000ustar00rootroot00000000000000# To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "pip" # See documentation for possible values directory: "/docs" # Location of package manifests open-pull-requests-limit: 10 schedule: interval: "daily" labels: - "documentation" - "dependencies" - "ci:docs-only" reviewers: - "samjwu" rocm-cmake-rocm-6.3.2/.github/workflows/000077500000000000000000000000001473605615300201055ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/.github/workflows/test.yml000077500000000000000000000036621473605615300216210ustar00rootroot00000000000000name: rocm-cmake on: [push, pull_request] jobs: cancel: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.6.0 with: access_token: ${{ github.token }} lint: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - name: Set up Python 3.10 uses: actions/setup-python@v2 with: python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade setuptools pip wheel python -m pip install cget cmakelang[YAML] - name: Run linter run: | cget build -T analyze -DSPHINX_EXECUTABLE=python3 # python isn't sphinx, but we won't be calling it anyway test: runs-on: ${{ matrix.platform }} strategy: max-parallel: 4 matrix: platform: - ubuntu-20.04 - macos-11 - windows-2019 cmake-version: - 3.20.0 - 3.10.2 exclude: - platform: windows-2019 cmake-version: 3.10.2 steps: - uses: actions/checkout@v1 - name: Set up Python 3.10 uses: actions/setup-python@v2 with: python-version: "3.10" - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.9 with: cmake-version: ${{ matrix.cmake-version }} - name: Install dependencies run: | python -m pip install --upgrade setuptools pip wheel python -m pip install cget ninja python -m pip install -r docs/requirements.txt - name: Install Doxygen uses: ssciwr/doxygen-install@v1 with: version: "1.10.0" - name: Run tests run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" cmake --version cget build --test cget build -T doc cget build -Cy --test -DROCM_CMAKE_GENERATOR=Ninja cget build -T doc rocm-cmake-rocm-6.3.2/.gitignore000066400000000000000000000000671473605615300165030ustar00rootroot00000000000000.vs*/**/* build/**/* docs/_build/ docs/sphinx/_toc.yml rocm-cmake-rocm-6.3.2/.readthedocs.yaml000066400000000000000000000005121473605615300177350ustar00rootroot00000000000000# Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details version: 2 sphinx: configuration: docs/src/conf.py formats: [htmlzip, pdf, epub] python: install: - requirements: docs/requirements.txt build: os: ubuntu-22.04 tools: python: "3.10" rocm-cmake-rocm-6.3.2/.travis.yml000066400000000000000000000023521473605615300166230ustar00rootroot00000000000000sudo: required dist: trusty language: cpp script: cmake matrix: include: # OSX - os: osx compiler: clang - os: linux compiler: gcc addons: &gcc apt: packages: - util-linux - g++-5 - cppcheck - clang-4.0 - clang-tidy-4.0 - realpath - python3-pip sources: - ubuntu-toolchain-r-test - llvm-toolchain-trusty-4.0 install: - export CHECKOUT_PATH=`pwd` # Show compiler info - $CXX --version - which $CXX - $CC --version - which $CC - which cmake - cmake --version - python3 --version - pip3 install --user 'cmakelang[YAML]' script: - export INSTALL_PREFIX_PATH="${TRAVIS_BUILD_DIR}/usr" - export PATH="/Users/travis/Library/Python/3.7/bin:$PATH" - mkdir -p "$INSTALL_PREFIX_PATH" - cd $CHECKOUT_PATH - cmake-lint $(find ./test -type f | grep .cmake$) $(find ./share -type f | grep .cmake$) - mkdir build - cd build - cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX_PATH .. - make check - make install - rm -rf "$INSTALL_PREFIX_PATH" rocm-cmake-rocm-6.3.2/CHANGELOG.md000066400000000000000000000224231473605615300163240ustar00rootroot00000000000000# Change Log for rocm-cmake ## [(Unreleased) rocm-cmake 0.13.0 for ROCm 6.2.0] ### Changed - ROCmCreatePackage: Accepts a suffix parameter, automatically generating it for static or ASAN builds. - Package names will no longer be pulled from `CPACK__PACKAGE_NAME` - Runtime packages will no longer be generated for static builds ## [rocm-cmake 0.12.0 for ROCm 6.1.0] ### Added - ROCMTest: Add rpath to installed tests - AOCMCreatePackage: Allow additional provides on header-only packages - ROCMSphinxDoc: Allow separate source and config directories ### Changed - Renamed CMake package to ROCmCMakeBuildTools. A wrapper has been provided to ensure that `find_package(ROCM)` continues to work, but it is recommended that developers switch to `find_package(ROCmCMakeBuildTools)` - ROCMInstallTargets: Stopped installing executables in ASAN builds ### Fixed - ROCMClangTidy: Fixed invalid list index in clang tidy - Fixed test failures when `ROCM_CMAKE_GENERATOR` is an empty string ## [rocm-cmake 0.11.0 for ROCm 6.0.0] ### Changed - ROCMSphinxDoc: Improved validation, documentation and rocm-docs-core integration. - Rename CMake package to ROCmCMakeBuildTools ### Fixed - ROCMClangTidy: Fixed extra make flags passed for clang tidy. - ROCMTest: Fixed issues when using module in a subdirectory. ## [rocm-cmake 0.10.0 for ROCm 5.7.0] ### Added - Added ROCMTest module - ROCMCreatePackage: Added support for ASAN packages ## [rocm-cmake 0.9.0 for ROCm 5.6.0] ### Added - Added the option ROCM_HEADER_WRAPPER_WERROR - Compile-time C macro in the wrapper headers causes errors to be emitted instead of warnings. - Configure-time CMake option sets the default for the C macro. ## [rocm-cmake 0.8.1 for ROCm 5.5] ### Fixed - ROCMInstallTargets: Added compatibility symlinks for included cmake files in `/lib/cmake/`. ### Changed - ROCMHeaderWrapper: The wrapper header deprecation message is now a deprecation warning. ## [rocm-cmake 0.8.0 for ROCm 5.4] ### Fixed - ROCMCreatePackage: Fixed error in prerm scripts that could break package upgrades when using the `PTH` option. - Removed unnecessary requirement for having C and C++ compilers available when building rocm-cmake from source. ### Known issues - This release did not have a unique version number. ## [rocm-cmake 0.8.0 for ROCm 5.3] ### Fixed - Fixed error in prerm scripts created by `rocm_create_package` that could break uninstall for packages using the `PTH` option. ### Changed - `ROCM_USE_DEV_COMPONENT` set to on by default for all platforms. This means that Windows will now generate runtime and devel packages by default - ROCMInstallTargets now defaults `CMAKE_INSTALL_LIBDIR` to `lib` if not otherwise specified. - Changed default Debian compression type to xz and enabled multi-threaded package compression. - `rocm_create_package` will no longer warn upon failure to determine version of program rpmbuild. ## [0.7.3] ### Added - Header wrapper functionality included. This is to support the change in header file locations in ROCm 5.2, while providing backwards compatibility via header file wrappers. The associated deprecation warning can be disabled by defining `ROCM_NO_WRAPPER_HEADER_WARNING` before including the wrapper header. ### Fixed - Fixed spurious failures in `rocm_check_target_ids` for target ids with target features when `-Werror` is enabled. The `HAVE_` result variable has been renamed to `COMPILER_HAS_TARGET_ID_`. ## [0.7.2] - `rocm_create_package` now will attempt to set a default `CPACK_GENERATOR` based on the `ROCM_PKGTYPE` environment variable if one is not already set. ## [0.7.1] ### Added - `CLANG_TIDY_USE_COLOR` variable added to control the color output from `clang-tidy`, by default this is `On`. - If `CPACK_RESOURCE_FILE_LICENSE` is not set, `rocm_create_package` will now automatically attempt to find a LICENSE, LICENSE.txt, or LICENSE.md file in the top-level CMake source directory. If one is found, it is set up as the license file for the package. ## [0.7.0] ### Added - Component packaging functionality: - `rocm_package_setup_component` sets up a component for packaging, with the given name and values for the component and associated package. - The variable `ROCM_PACKAGE_COMPONENTS` stores a list of the components which have been set up with `rocm_package_setup_component`. - `rocm_package_add_rpm_dependencies` adds any number of dependencies to the RPM package for an optional specified component, including version checks (e.g. `foo >= 1.0`) - `rocm_package_add_deb_dependencies` adds any number of dependencies to the DEB package for an optional specified component, including version checks (e.g. `foo >= 1.0`) - Note that this version format matches RPM, it is reformatted to the Debian package format. This is to reduce code duplication. - `rocm_package_add_dependencies` is a convenience wrapper which calls both `rocm_add_rpm_dependencies` and `rocm_add_deb_dependencies` to add any number of dependencies to both packages for an optional specified component. - Client packaging functions: - `rocm_package_setup_client_component` is a convenience wrapper which adds the library as a runtime dependency if shared libraries were built, and sets the parent of the client package to `clients`. - Utility functions: - `rocm_join_if_set` joins any number of non-empty strings to the end of a given variable interspersed with a specified glue string, setting that variable if it was previously empty - `rocm_find_program_version` checks to see if the given command is available, and if it is available that the version matches some criteria. The detected version is returned in ``, and whether it matches all given criteria in `_OK`. - `` defaults to `_VERSION` if not specified. ### Changed - If `ROCM_PACKAGE_COMPONENTS` is set (either manually or by `rocm_package_setup_component`), then the components listed in `ROCM_PACKAGE_COMPONENTS` will be built as separate packages. - `rocm_read_os_release` and `rocm_set_os_id` moved to the utilities file. As this file is included in `ROCMCreatePackage.cmake`, this change is backwards compatible. - `rocm_install_symlink_subdir` now accepts a `COMPONENT` argument, which controls the component that the symlinks are installed into. ## [0.6.2] ### Changed - If the ROCm platform version that is being built for is less than version 4.5.0, `ROCM_DEP_ROCMCORE` is automatically disabled. - The ROCm platform version is determined by: - the user-set CMake variable `ROCM_PLATFORM_VERSION`; otherwise - if the install prefix resolves to a path containing `rocm-`, that version is used; otherwise - if the real path to the version of `rocm-cmake` used contains `rocm-`, that version is used. - If the ROCm platform version is not set, then it is assumed to be greater than 4.5.0. ## [0.6.1] ### Added - Modules added to generate documentation: - `ROCMDocs` - `ROCMDoxygenDoc` - `ROCMSphinxDoc` ## [0.6.0] ### Added - `ADDONS` flag added to `rocm_enable_cppcheck` in order to run with addons - The cache variable `ROCM_USE_DEV_COMPONENT` may be set to `OFF` to build with legacy behaviour. - On Windows, this variable defaults to `OFF`. - `rocm_install_targets` can now install to a specific component using COMPONENT argument. - `rocm_install` is a wrapper on `install`: - If the installation mode is TARGETS, call `rocm_install_targets` with the same arguments. - If `ROCM_USE_DEV_COMPONENT` is `OFF` or COMPONENT is specified, call `install` with the same arguments. - Otherwise, insert the correct arguments to install everything except libraries to the `devel` package, and install libraries to the base package with namelinks in the `devel` package. ### Changed - If `ROCM_USE_DEV_COMPONENT` is `ON`: - `rocm_install_targets`: - Unless COMPONENT is specified, library targets will be installed to the default package and namelinked in the devel package. - Unless COMPONENT is specified, everything else (including any files/folders specified by INCLUDE) will be installed to the devel package. - If COMPONENT was specified in the call to `rocm_install_targets`, that component is used instead of the above behaviour. - `rocm_export_targets`: - All cmake files will be installed to the devel package. - `rocm_create_package`: - Package generation will be performed component-wise, and automatically include the devel component, even if the COMPONENTS argument was not provided. - If provided with the `HEADER_ONLY` option (accepting no arguments), then only the devel package will be generated. The devel package will also have the "Provides" field populated with the name/version of the runtime package for backwards compatibility. This provides field is introduced as a deprecated feature, and will be removed in a future release. - Corrects semantic versioning to SameMajorVersion compatibility (e.g. 0.6 is compatible if 0.5 is requested). - Moved ROCMConfigVersion.cmake file to share/rocm/cmake directory for better compatibility with automatic installation. - Correct CHANGELOG.md formatting ## [0.5.1] ### Added - Add ROCMConfigVersion.cmake file so cmake can check the version - Switched to semantic versioning ## [0.5] ### Added - Change Log added and version number incremented ## [0.4] Pre Change Log versions rocm-cmake-rocm-6.3.2/CMakeLists.txt000066400000000000000000000031121473605615300172450ustar00rootroot00000000000000################################################################################ # Copyright (C) 2017 Advanced Micro Devices, Inc. ################################################################################ cmake_minimum_required (VERSION 3.6) set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "") project(rocm-cmake LANGUAGES NONE) install(DIRECTORY share DESTINATION .) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake DESTINATION share/rocmcmakebuildtools/cmake ) set(CPACK_RPM_PACKAGE_LICENSE "MIT") list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/share/rocmcmakebuildtools/cmake) include(ROCMCreatePackage) include(ROCMSetupVersion) rocm_setup_version(VERSION 0.14.0) include(CMakePackageConfigHelpers) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake COMPATIBILITY SameMajorVersion) rocm_create_package( NAME rocm-cmake MAINTAINER "Paul Fultz II pfultz@amd.com" ) set(CONFIGURE_DEPENDS) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12) set(CONFIGURE_DEPENDS CONFIGURE_DEPENDS) endif() file(GLOB_RECURSE CMAKE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CONFIGURE_DEPENDS} share/*.cmake test/*.cmake) add_custom_target(analyze COMMAND cmake-lint ${CMAKE_FILES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) add_custom_target(format COMMAND cmake-format -i ${CMAKE_FILES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) enable_testing() add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) add_subdirectory(test) add_subdirectory(docs) rocm-cmake-rocm-6.3.2/LICENSE000066400000000000000000000020751473605615300155210ustar00rootroot00000000000000MIT License Copyright (c) 2017 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. rocm-cmake-rocm-6.3.2/README.md000066400000000000000000000007701473605615300157730ustar00rootroot00000000000000# rocm-cmake rocm-cmake is a collection of CMake modules for common build and development tasks within the ROCm project. It is therefore a build dependency for many of the libraries that comprise the ROCm platform. rocm-cmake is **not** required for building libraries or programs that _use_ ROCm; it is required for building some of the libraries that are _a part of_ ROCm. To install from source, run: ```bash mkdir build cd build cmake .. cmake --build . sudo cmake --build . --target install ``` rocm-cmake-rocm-6.3.2/appveyor.yml000066400000000000000000000016571473605615300171110ustar00rootroot00000000000000 os: Visual Studio 2015 environment: matrix: # - GENERATOR: "Visual Studio 14 2015 Win64" # CONFIG: Debug # - GENERATOR: "Visual Studio 14 2015 Win64" # CONFIG: Release - GENERATOR: "Visual Studio 14 2015" CONFIG: Debug # - GENERATOR: "Visual Studio 14 2015" # CONFIG: Release matrix: fast_finish: true build_script: - cmd: set PATH=C:\Program Files (x86)\CMake\bin;%PATH% - cmd: set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% - cmd: call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat" - cmd: git config --global user.email "you@example.com" - cmd: git config --global user.name "Your Name" - cmd: set CTEST_OUTPUT_ON_FAILURE=1 - cmd: cmake --version - cmd: mkdir build - cmd: cd build - cmd: cmake .. -G"%GENERATOR%" - cmd: cmake --build . --config %CONFIG% --target check # test_script: # - cmd: ctest -C Debug --output-on-failure # - cmd: cd ../../ rocm-cmake-rocm-6.3.2/cmake-format.yaml000066400000000000000000000271321473605615300177470ustar00rootroot00000000000000# Options affecting listfile parsing parse: # Specify structure for custom cmake functions additional_commands: rocm_mark_as_analyzer: pargs: nargs: 0 rocm_check_toolchain_var: pargs: nargs: 4 rocm_find_clang_tidy_version: pargs: nargs: 1 rocm_enable_clang_tidy: pargs: nargs: '*' flags: - ALL - ANALYZE_TEMPORARY_DTORS - ENABLE_ALPHA_CHECKS kwargs: HEADER_FILTER: 1 CHECKS: + ERRORS: + EXTRA_ARGS: + CLANG_ARGS: + rocm_clang_tidy_check: pargs: nargs: 1 rocm_find_cppcheck_version: pargs: nargs: 1 rocm_enable_cppcheck: pargs: nargs: '*' flags: - FORCE - INCONCLUSIVE kwargs: RULE_FILE: 1 CHECKS: + SUPPRESS: + DEFINE: + UNDEFINE: + INCLUDE: + SOURCES: + rocm_create_package: pargs: nargs: '*' flags: - LDCONFIG - PTH kwargs: NAME: 1 DESCRIPTION: 1 SECTION: 1 MAINTAINER: 1 LDCONFIG_DIR: 1 PREFIX: 1 DEPENDS: + rocm_set_os_id: pargs: nargs: 1 rocm_read_os_release: pargs: nargs: 2 rocm_install_symlink_subdir: pargs: nargs: 1 rocm_install_targets: pargs: nargs: '*' flags: [] kwargs: PREFIX: 1 EXPORT: 1 TARGETS: + INCLUDE: + rocm_list_split: pargs: nargs: 3 rocm_write_package_template_function: pargs: nargs: 2 rocm_write_package_deps: pargs: nargs: 1 rocm_export_targets: pargs: nargs: '*' flags: [] kwargs: NAMESPACE: 1 EXPORT: 1 NAME: 1 COMPATIBILITY: 1 PREFIX: 1 TARGETS: + DEPENDS: + INCLUDE: + STATIC_DEPENDS: + rocm_configure_package_config_file: pargs: nargs: 2+ flags: [] kwargs: INSTALL_DESTINATION: 1 PREFIX: 1 PATH_VARS: + rocm_set_parent: pargs: nargs: 1 rocm_get_rev_count: pargs: nargs: 1+ flags: [] kwargs: DIRECTORY: 1 REV: + rocm_get_commit_count: pargs: nargs: 1+ flags: [] kwargs: PARENT: 1 DIRECTORY: 1 rocm_get_build_info: pargs: nargs: 2 rocm_get_version: pargs: nargs: 1+ flags: [] kwargs: VERSION: 1 DIRECTORY: 1 rocm_version_regex_parse: pargs: nargs: 3 rocm_setup_version: pargs: nargs: '*' flags: - NO_GIT_TAG_VERSION kwargs: VERSION: 1 PARENT: 1 rocm_get_so_patch: pargs: nargs: 1 rocm_set_soversion: pargs: nargs: 2 test_expect_eq: pargs: nargs: 2 test_expect_matches: pargs: nargs: 2 test_expect_not_matches: pargs: nargs: 2 test_expect_file: pargs: nargs: '*' test_exec: pargs: nargs: '*' flags: - OUTPUT_QUIET - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE - ECHO_OUTPUT_VARIABLE - ECHO_ERROR_VARIABLE kwargs: COMMAND: '*' WORKING_DIRECTORY: 1 TIMEOUT: 1 RESULT_VARIABLE: 1 RESULTS_VARIABLE: 1 OUTPUT_VARIABLE: 1 ERROR_VARIABLE: 1 INPUT_FILE: 1 OUTPUT_FILE: 1 ERROR_FILE: 1 COMMAND_ECHO: 1 ENCODING: 1 configure_dir: pargs: nargs: 1+ flags: [] kwargs: CMAKE_ARGS: + TARGETS: + install_dir: pargs: nargs: 1+ flags: [] kwargs: CMAKE_ARGS: + TARGETS: + write_version_cmake: pargs: nargs: 3 test_check_package: pargs: nargs: '*' flags: [] kwargs: NAME: 1 HEADER: 1 TARGET: 1 CHECK_TARGET: 1 # Override configurations per-command where available override_spec: {} # Specify variable tags. vartags: [] # Specify property tags. proptags: [] # Options affecting formatting. format: # Disable formatting entirely, making cmake-format a no-op disable: false # How wide to allow formatted cmake files line_width: 120 # How many spaces to tab for indent tab_size: 4 # If true, lines are indented using tab characters (utf-8 # 0x09) instead of space characters (utf-8 0x20). # In cases where the layout would require a fractional tab # character, the behavior of the fractional indentation is # governed by use_tabchars: false # If is True, then the value of this variable # indicates how fractional indentions are handled during # whitespace replacement. If set to 'use-space', fractional # indentation is left as spaces (utf-8 0x20). If set to # '`round-up` fractional indentation is replaced with a single' # tab character (utf-8 0x09) effectively shifting the column # to the next tabstop fractional_tab_policy: use-space # If an argument group contains more than this many sub-groups # (parg or kwarg groups) then force it to a vertical layout. max_subgroups_hwrap: 2 # If a positional argument group contains more than this many # arguments, then force it to a vertical layout. max_pargs_hwrap: 8 # If a cmdline positional group consumes more than this many # lines without nesting, then invalidate the layout (and nest) max_rows_cmdline: 2 # If true, separate flow control names from their parentheses # with a space separate_ctrl_name_with_space: false # If true, separate function names from parentheses with a # space separate_fn_name_with_space: false # If a statement is wrapped to more than one line, than dangle # the closing parenthesis on its own line. dangle_parens: false # If the trailing parenthesis must be 'dangled' on its on # 'line, then align it to this reference: `prefix`: the start' # 'of the statement, `prefix-indent`: the start of the' # 'statement, plus one indentation level, `child`: align to' # the column of the arguments dangle_align: prefix # If the statement spelling length (including space and # parenthesis) is smaller than this amount, then force reject # nested layouts. min_prefix_chars: 4 # If the statement spelling length (including space and # parenthesis) is larger than the tab width by more than this # amount, then force reject un-nested layouts. max_prefix_chars: 10 # If a candidate layout is wrapped horizontally but it exceeds # this many lines, then reject the layout. max_lines_hwrap: 2 # What style line endings to use in the output. line_ending: unix # Format command names consistently as 'lower' or 'upper' case command_case: lower # Format keywords consistently as 'lower' or 'upper' case keyword_case: unchanged # A list of command names which should always be wrapped always_wrap: [] # If true, the argument lists which are known to be sortable # will be sorted lexicographicall enable_sort: true # If true, the parsers may infer whether or not an argument # list is sortable (without annotation). autosort: false # By default, if cmake-format cannot successfully fit # everything into the desired linewidth it will apply the # last, most agressive attempt that it made. If this flag is # True, however, cmake-format will print error, exit with non- # zero status code, and write-out nothing require_valid_layout: false # A dictionary mapping layout nodes to a list of wrap # decisions. See the documentation for more information. layout_passes: {} # Options affecting comment reflow and formatting. markup: # What character to use for bulleted lists bullet_char: '*' # What character to use as punctuation after numerals in an # enumerated list enum_char: . # If comment markup is enabled, don't reflow the first comment # block in each listfile. Use this to preserve formatting of # your copyright/license statements. first_comment_is_literal: false # If comment markup is enabled, don't reflow any comment block # which matches this (regex) pattern. Default is `None` # (disabled). literal_comment_pattern: null # Regular expression to match preformat fences in comments # default= ``r'^\s*([`~]{3}[`~]*)(.*)$'`` fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$ # Regular expression to match rulers in comments default= # '``r''^\s*[^\w\s]{3}.*[^\w\s]{3}$''``' ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$ # If a comment line matches starts with this pattern then it # is explicitly a trailing comment for the preceeding # argument. Default is '#<' explicit_trailing_pattern: '#<' # If a comment line starts with at least this many consecutive # hash characters, then don't lstrip() them off. This allows # for lazy hash rulers where the first hash char is not # separated by space hashruler_min_length: 10 # If true, then insert a space between the first hash char and # remaining hash chars in a hash ruler, and normalize its # length to fill the column canonicalize_hashrulers: true # enable comment markup parsing and reflow enable_markup: true # Options affecting the linter lint: # a list of lint codes to disable disabled_codes: - C0111 - C0113 - W0106 # regular expression pattern describing valid function names function_pattern: '[0-9a-z_]+' # regular expression pattern describing valid macro names macro_pattern: '[0-9a-z_]+' # regular expression pattern describing valid names for # variables with global (cache) scope global_var_pattern: '[A-Z][0-9A-Z_]+' # regular expression pattern describing valid names for # variables with global scope (but internal semantic) internal_var_pattern: '[A-Z][0-9A-Z_]+' # regular expression pattern describing valid names for # variables with local scope # TODO: Should be [a-z][a-z0-9_]+ local_var_pattern: '[a-zA-Z_][a-zA-Z0-9_]+' # regular expression pattern describing valid names for # privatedirectory variables private_var_pattern: '[a-zA-Z_][a-zA-Z0-9_]+' # regular expression pattern describing valid names for public # directory variables public_var_pattern: '[A-Z][0-9A-Z_]+' # regular expression pattern describing valid names for # function/macro arguments and loop variables. argument_var_pattern: '[A-Za-z_][0-9A-Za-z_]+' # regular expression pattern describing valid names for # keywords used in functions or macros keyword_pattern: '[A-Z][0-9A-Z_]+' # In the heuristic for C0201, how many conditionals to match # within a loop in before considering the loop a parser. max_conditionals_custom_parser: 2 # Require at least this many newlines between statements min_statement_spacing: 1 # Require no more than this many newlines between statements max_statement_spacing: 2 max_returns: 6 max_branches: 25 max_arguments: 5 max_localvars: 15 max_statements: 120 # Options affecting file encoding encode: # If true, emit the unicode byte-order mark (BOM) at the start # of the file emit_byteorder_mark: false # Specify the encoding of the input file. Defaults to utf-8 input_encoding: utf-8 # Specify the encoding of the output file. Defaults to utf-8. # Note that cmake only claims to support utf-8 so be careful # when using anything else output_encoding: utf-8 # Miscellaneous configurations options. misc: # A dictionary containing any per-command configuration # overrides. Currently only `command_case` is supported. per_command: {} rocm-cmake-rocm-6.3.2/docs/000077500000000000000000000000001473605615300154405ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/docs/CMakeLists.txt000077500000000000000000000001601473605615300202000ustar00rootroot00000000000000include(ROCMSphinxDoc) rocm_add_sphinx_doc(${CMAKE_CURRENT_LIST_DIR}/src BUILDER html OUTPUT_DIR html ) rocm-cmake-rocm-6.3.2/docs/requirements.in000066400000000000000000000001001473605615300205020ustar00rootroot00000000000000sphinxcontrib-moderncmakedomain==3.29.0 rocm-docs-core==1.6.2 rocm-cmake-rocm-6.3.2/docs/requirements.txt000066400000000000000000000061231473605615300207260ustar00rootroot00000000000000# # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile requirements.in # accessible-pygments==0.0.5 # via pydata-sphinx-theme alabaster==0.7.16 # via sphinx babel==2.15.0 # via # pydata-sphinx-theme # sphinx beautifulsoup4==4.12.3 # via pydata-sphinx-theme breathe==4.35.0 # via rocm-docs-core certifi==2024.6.2 # via requests cffi==1.16.0 # via # cryptography # pynacl charset-normalizer==3.3.2 # via requests click==8.1.7 # via sphinx-external-toc cryptography==42.0.8 # via pyjwt deprecated==1.2.14 # via pygithub docutils==0.21.2 # via # breathe # myst-parser # pydata-sphinx-theme # sphinx fastjsonschema==2.19.1 # via rocm-docs-core gitdb==4.0.11 # via gitpython gitpython==3.1.43 # via rocm-docs-core idna==3.7 # via requests imagesize==1.4.1 # via sphinx jinja2==3.1.4 # via # myst-parser # sphinx markdown-it-py==3.0.0 # via # mdit-py-plugins # myst-parser markupsafe==2.1.5 # via jinja2 mdit-py-plugins==0.4.1 # via myst-parser mdurl==0.1.2 # via markdown-it-py myst-parser==3.0.1 # via rocm-docs-core packaging==24.0 # via # pydata-sphinx-theme # sphinx pycparser==2.22 # via cffi pydata-sphinx-theme==0.15.3 # via # rocm-docs-core # sphinx-book-theme pygithub==2.3.0 # via rocm-docs-core pygments==2.18.0 # via # accessible-pygments # pydata-sphinx-theme # sphinx pyjwt[crypto]==2.8.0 # via pygithub pynacl==1.5.0 # via pygithub pyyaml==6.0.1 # via # myst-parser # rocm-docs-core # sphinx-external-toc requests==2.32.3 # via # pygithub # sphinx rocm-docs-core==1.6.2 # via -r requirements.in smmap==5.0.1 # via gitdb snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 sphinx==7.3.7 # via # breathe # myst-parser # pydata-sphinx-theme # rocm-docs-core # sphinx-book-theme # sphinx-copybutton # sphinx-design # sphinx-external-toc # sphinx-notfound-page # sphinxcontrib-moderncmakedomain sphinx-book-theme==1.1.2 # via rocm-docs-core sphinx-copybutton==0.5.2 # via rocm-docs-core sphinx-design==0.6.0 # via rocm-docs-core sphinx-external-toc==1.0.1 # via rocm-docs-core sphinx-notfound-page==1.0.2 # via rocm-docs-core sphinxcontrib-applehelp==1.0.8 # via sphinx sphinxcontrib-devhelp==1.0.6 # via sphinx sphinxcontrib-htmlhelp==2.0.5 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-moderncmakedomain==3.29.0 # via -r requirements.in sphinxcontrib-qthelp==1.0.7 # via sphinx sphinxcontrib-serializinghtml==1.1.10 # via sphinx typing-extensions==4.12.2 # via # pydata-sphinx-theme # pygithub urllib3==2.2.1 # via # pygithub # requests wrapt==1.16.0 # via deprecated rocm-cmake-rocm-6.3.2/docs/src/000077500000000000000000000000001473605615300162275ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/docs/src/_toc.yml.in000066400000000000000000000026021473605615300203030ustar00rootroot00000000000000# Variables of the form ${} are substituted, currently the following # list is supported: # - ${branch} (or {branch}) the name of the current branch # - ${url} (or {url}) github url of the current project # - ${project:} base url of the documentation of # based on intersphinx_mapping. # These comments will also be removed. defaults: numbered: False maxdepth: 6 root: index.rst subtrees: - caption: Installation entries: - file: reference/ROCMInstallTargets.rst - file: reference/ROCMInstallSymlinks.rst - file: reference/ROCMHeaderWrapper.rst - file: reference/ROCMCreatePackage.rst - file: reference/ROCMClients.rst - file: reference/ROCMPackageConfigHelpers.rst - caption: Basic functions entries: - file: reference/ROCMCheckTargetIds.rst - file: reference/ROCMSetupVersion.rst - file: reference/ROCMAnalyzers.rst - caption: Standard tooling entries: - file: reference/ROCMClangTidy.rst - file: reference/ROCMCppCheck.rst - file: reference/ROCMTest.rst - caption: Documentation in CMake entries: - file: reference/ROCMDocs.rst - file: reference/ROCMDoxygenDoc.rst - file: reference/ROCMSphinxDoc.rst - caption: Internal use entries: - file: reference/ROCMUtilities.rst - caption: About entries: - file: license.rst rocm-cmake-rocm-6.3.2/docs/src/conf.py000077500000000000000000000047761473605615300175470ustar00rootroot00000000000000# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import re # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- setting_all_article_info = True external_projects_current_project = "rocmcmakebuildtools" project = 'ROCmCMakeBuildTools' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinxcontrib.moderncmakedomain', "rocm_docs" ] external_toc_path = "./_toc.yml" external_toc_template_path = "./_toc.yml.in" # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'rocm_docs_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] with open('../../CMakeLists.txt', encoding='utf-8') as f: match = re.search(r'rocm_setup_version\(VERSION\s+\"?([0-9.]+)[^0-9.]+', f.read()) if not match: raise ValueError("VERSION not found!") version_number = match[1] version = version_number release = version_number html_title = f"ROCm CMake Build Tools {version}" project = "ROCm CMake Build Tools" author = "Advanced Micro Devices, Inc." copyright = ( "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved." ) rocm-cmake-rocm-6.3.2/docs/src/contents.rst000066400000000000000000000050361473605615300206220ustar00rootroot00000000000000.. rocm-cmake documentation master file, created by sphinx-quickstart on Thu Sep 16 18:46:06 2021. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. .. highlight:: cmake .. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _contents: **************************************************** Modules and functions **************************************************** - :ref:`rocmanalyzers` + :any:`rocm_mark_as_analyzer` + :any:`ROCM_ENABLE_GH_ANNOTATIONS` - :ref:`rocmchecktargetids` + :any:`rocm_check_target_ids` - :ref:`rocmclangtidy` + :any:`rocm_enable_clang_tidy` + :any:`rocm_clang_tidy_check` + :any:`CLANG_TIDY_EXE` + :any:`CLANG_TIDY_CACHE` + :any:`CLANG_TIDY_CACHE_SIZE` + :any:`CLANG_TIDY_DEPEND_ON_TARGET` - :ref:`rocmclients` + :any:`rocm_package_setup_client_component` - :ref:`rocmcppcheck` + :any:`rocm_enable_cppcheck` + :any:`CPPCHECK_EXE` + :any:`CPPCHECK_BUILD_DIR` - :ref:`rocmcreatepackage` + :any:`rocm_create_package` + :any:`rocm_package_add_rpm_dependencies` + :any:`rocm_package_add_deb_dependencies` + :any:`rocm_package_add_dependencies` + :any:`rocm_package_setup_component` - :ref:`rocmdocs` + :any:`rocm_mark_as_doc` + :any:`rocm_clean_doc_output` - :ref:`rocmdoxygendoc` + :any:`rocm_add_doxygen_doc` + :any:`DOXYGEN_EXECUTABLE` + :any:`DOT_EXECUTABLE` - :ref:`rocminstallsymlinks` + :any:`rocm_install_symlink_subdir` - :ref:`rocminstalltargets` + :any:`rocm_install` + :any:`rocm_install_targets` + :any:`rocm_export_targets` - :ref:`rocmconfighelpers` + :any:`rocm_configure_package_config_file` - :ref:`rocmsetupversion` + :any:`rocm_get_version` + :any:`rocm_setup_version` - :ref:`rocmsphinxdoc` + :any:`rocm_add_doxygen_doc` + :any:`SPHINX_EXECUTABLE` + :any:`SPHINX_${BUILDER}_DIR` - :ref:`rocmtest` + :any:`rocm_enable_test_package` + :any:`rocm_add_test` + :any:`rocm_add_test_executable` + :any:`rocm_test_header` + :any:`rocm_test_headers` + :any:`rocm_install_test` + :any:`rocm_mark_as_test` + :any:`rocm_link_test_dependencies` + :any:`rocm_test_link_libraries` + :any:`CTEST_PARALLEL_LEVEL` + :any:`CTEST_TIMEOUT` + :any:`ROCM_TEST_GDB` - :ref:`rocmutilities` + :any:`rocm_join_if_set` + :any:`rocm_defer` + :any:`rocm_find_program_version` Index and tables ================ * :ref:`genindex` * :ref:`search`rocm-cmake-rocm-6.3.2/docs/src/index.rst000077500000000000000000000035241473605615300200770ustar00rootroot00000000000000.. rocm-cmake documentation master file, created by sphinx-quickstart on Thu Sep 16 18:46:06 2021. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. .. highlight:: cmake .. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocm-cmake: **************************************************** ROCm CMake build tools **************************************************** ROCm CMake build tools (also known as "rocm-cmake") is a collection of functions that unify and simplify the CMake code of ROCm components, as well as ensuring consistency across these different components. The ROCm CMake build tools are used when building and developing many AMD ROCm libraries, but are not runtime dependencies for any libraries, packages or executables. .. important:: ROCm CMake tools are not required when building or compiling an application that uses ROCm or HIP components. The build tools can be included into a CMake project by running: .. code-block:: shell find_package(ROCmCMakeBuildTools) # or find_package(ROCM) # deprecated, but included for backwards compatibility Once the tools have been included in this manner, individual files may be included by running ``include()``. The file names, the functions, variables, and macros accessible using each file are described in this documentation. You can access the build tools on the `ROCm CMake GitHub repository `_. For a complete listing of the features of ROCm CMake refer to :ref:`contents`. To contribute to the documentation, refer to `Contributing to ROCm `_. You can find licensing information on the `Licensing `_ page. rocm-cmake-rocm-6.3.2/docs/src/license.rst000066400000000000000000000000601473605615300203770ustar00rootroot00000000000000License ======= .. include:: ../../LICENSE rocm-cmake-rocm-6.3.2/docs/src/reference/000077500000000000000000000000001473605615300201655ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMAnalyzers.rst000077500000000000000000000012461473605615300233560ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmanalyzers: **************************************************** ROCMAnalyzers **************************************************** This creates an ``analyze`` target which can run all analysis for a project. Commands -------- .. cmake:command:: rocm_mark_as_analyzer .. code-block:: cmake rocm_mark_as_analyzer() Marks a target to be included with the ``analyze`` target. Variables --------- .. cmake:variable:: ROCM_ENABLE_GH_ANNOTATIONS Set this variable to ``ON`` so that analyzers will emit diagnostics in a format that GitHub can use to annotate pull requests. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMCheckTargetIds.rst000077500000000000000000000010371473605615300242300ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmchecktargetids: **************************************************** ROCMCheckTargetIds **************************************************** Commands -------- .. cmake:command:: rocm_check_target_ids .. code-block:: cmake rocm_check_target_ids( TARGETS ... ) Returns the subset of HIP `target-ids `_ supported by the current CXX compiler. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMClangTidy.rst000077500000000000000000000037461473605615300232730ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmclangtidy: **************************************************** ROCMClangTidy **************************************************** Commands -------- .. cmake:command:: rocm_enable_clang_tidy .. code-block:: cmake rocm_enable_clang_tidy( [CHECKS ...] [ERRORS ...] [EXTRA_ARGS ...] [CLANG_ARGS ...] [HEADER_FILTER ] [ALL] [ANALYZE_TEMPORARY_DTORS] [ENABLE_ALPHA_CHECKS] ) Enable checks for clang tidy. .. cmake:command:: rocm_clang_tidy_check .. code-block:: cmake rocm_clang_tidy_check(TARGET) Check the sources from target with clang tidy. Variables --------- .. cmake:variable:: CLANG_TIDY_EXE This cached variable can be used to set which ``clang-tidy`` executable to use. By default it will search for ``clang-tidy`` on the system while preferring the ``clang-tidy`` found in the same directory as ``CMAKE_CXX_COMPILER``. .. cmake:variable:: CLANG_TIDY_CACHE This is location of the ``clang-tidy`` cache. By default, this is stored in the build directory under ``tidy-cache``. .. cmake:variable:: CLANG_TIDY_CACHE_SIZE This sets the size of the cache. If set to ``0`` it will disable the cache. By default, it will cache 10 runs when using the Makefile generators. When using other generators it is disabled since it is not supported. .. cmake:variable:: CLANG_TIDY_DEPEND_ON_TARGET When set to ``On`` it will build the target first before running ``clang-tidy``. By default, this is set to ``On``. .. cmake:variable:: CLANG_TIDY_USE_COLOR When set to ``On`` then ``clang-tidy`` will output diagnostics in color. By default, this is set to ``On``. It is disabled if ``ROCM_ENABLE_GH_ANNOTATIONS`` is enabled. Fixits ------ All fixits are saved in the build directory under ``fixits/``. All fixits found during analysis can be applied by running ``clang-apply-replacements fixits/``. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMClients.rst000066400000000000000000000013501473605615300230000ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmclients: **************************************************** ROCMClients **************************************************** Commands -------- .. cmake:command:: rocm_package_setup_client_component .. code-block:: cmake rocm_package_setup_client_component( [PACKAGE_NAME ] [LIBRARY_NAME ] [DEPENDS [COMMON ...] [RPM ...] [DEB ...] [COMPONENT ...] ] ) Setup a client component for packaging. See ``rocm_package_setup_component``. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMCppCheck.rst000077500000000000000000000020501473605615300230600ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmcppcheck: **************************************************** ROCMCppCheck **************************************************** Commands -------- .. cmake:command:: rocm_enable_cppcheck .. code-block:: cmake rocm_enable_cppcheck( [CHECKS ...] [SUPPRESS ...] [DEFINE ...] [UNDEFINE ...] [INCLUDE ...] [SOURCES ...] [ADDONS ...] [RULE_FILE ] [FORCE] [INCONCLUSIVE] ) Enable checks for cppcheck. Variables --------- .. cmake:variable:: CPPCHECK_EXE This cached variable can be used to set which ``cppcheck`` executable to use. By default it will search for ``cppcheck`` on the system. .. cmake:variable:: CPPCHECK_BUILD_DIR Sets the path to use for cppcheck's build directory where it caches the analysis. By default, this is set the ``cppcheck-build`` under cmake's build directory. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMCreatePackage.rst000077500000000000000000000067501473605615300240720ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmcreatepackage: **************************************************** ROCMCreatePackage **************************************************** Commands -------- .. cmake:command:: rocm_create_package .. code-block:: cmake rocm_create_package( NAME [DESCRIPTION ] [SECTION
] [MAINTAINER ] [LDCONFIG_DIR ] [PREFIX ] [LDCONFIG] [HEADER_ONLY] ) Sets up CPack packaging, including installing the license file to the correct location and component. If the license file is not specified, also attempts to locate a LICENSE, LICENSE.md, or LICENSE.txt file in `CMAKE_SOURCE_DIR`. If the CPACK_GENERATOR has not been specified then if ROCM_PKGTYPE is set then use that to set it, otherwise probe the system to see what programs are available. .. cmake:command:: rocm_package_add_rpm_dependencies .. code-block:: cmake rocm_package_add_rpm_dependencies( [QUIET] [COMPONENT ] [DEPENDS ...] [SHARED_DEPENDS ...] [STATIC_DEPENDS ...] ) Sets up the RPM package for a component to depend on some other packages, possibly versioned. The dependencies should be listed in RPM format (e.g. `foo > 0.3` or `bar = 1.0`). Will warn if the package has already been created, unless QUIET is specified. .. cmake:command:: rocm_package_add_deb_dependencies .. code-block:: cmake rocm_package_add_deb_dependencies( [QUIET] [COMPONENT ] [DEPENDS ...] [SHARED_DEPENDS ...] [STATIC_DEPENDS ...] ) Sets up the deb package for a component to depend on some other packages, possibly versioned. The dependencies may be listed in RPM format (e.g. `foo > 0.3` or `bar = 1.0`), and will automatically be converted to the DEB formatting. Will warn if the package has already been created, unless QUIET is specified. .. cmake:command:: rocm_package_add_dependencies .. code-block:: cmake rocm_package_add_dependencies( [QUIET] [COMPONENT ] [DEPENDS ...] [SHARED_DEPENDS ...] [STATIC_DEPENDS ...] ) A convenience function wrapping both ``rocm_package_add_rpm_dependencies`` and ``rocm_package_add_deb_dependencies``. The dependencies must be listed in RPM format (e.g. ``foo > 0.3`` or ``bar = 1.0``), and will automatically be converted to the DEB formatting. Will warn if the package has already been created, unless QUIET is specified. .. cmake:command:: rocm_package_setup_component .. code-block:: cmake rocm_package_setup_component( [PACKAGE_NAME ] [LIBRARY_NAME ] [PARENT ] [DEPENDS [COMMON ...] [RPM ...] [DEB ...] [COMPONENT ...] ] ) Set up a component for packaging. Sets the package name, and adds dependencies as appropriate. Component dependencies are where the package generated by component A depends on the package generated by component B. In order to ensure that these dependencies correctly use the generated package names, these dependencies are not fully added until the packages are generated. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMDocs.rst000077500000000000000000000012171473605615300222740ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmdocs: **************************************************** ROCMDocs **************************************************** This creates a ``doc`` target which can run all documentation generation for the project. Commands -------- .. cmake:command:: rocm_mark_as_doc .. code-block:: cmake rocm_mark_as_doc() Marks a target to be included with the ``doc`` target. .. cmake:command:: rocm_clean_doc_output .. code-block:: cmake rocm_clean_doc_output(DIR) Output directory of documentation that should be removed when calling ``make clean``. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMDoxygenDoc.rst000077500000000000000000000021111473605615300234410ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmdoxygendoc: **************************************************** ROCMDoxygenDoc **************************************************** Commands -------- .. cmake:command:: rocm_add_doxygen_doc .. code-block:: cmake rocm_add_doxygen_doc( [DEPENDS ] [...] ) This will generate a doxygen file and then create a ``doxygen`` target that will run doxygen. Doxygen settings can be passed directly to the ``rocm_add_doxygen_doc``. Settings for doxygen can be found `here `_. Variables --------- .. cmake:variable:: DOXYGEN_EXECUTABLE This cached variable can be used to set which ``doxygen`` executable to use. By default it will search for ``doxygen`` on the system. .. cmake:variable:: DOT_EXECUTABLE This cached variable can be used to set which ``dot`` executable to use. By default it will search for ``dot`` on the system. If ``dot`` is found then its path will be set in the generated doxygen file. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMHeaderWrapper.rst000066400000000000000000000122021473605615300241260ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmheaderwrapper: **************************************************** ROCMHeaderWrapper **************************************************** Commands -------- .. cmake:command:: rocm_wrap_header_file .. code-block:: cmake rocm_wrap_header_file( [HEADERS] [...] [HEADER_LOCATION ] [INCLUDE_LOCATION ] [GUARDS ...] [WRAPPER_LOCATIONS ...] [OUTPUT_LOCATIONS ...] [ORIGINAL_FILES ...] ) Create a C/C++ wrapper file for each specified header file. The wrapper is simply a C/C++ header that emits a deprecation warning before including its corresponding header. The warning can be turned off by defining ``ROCM_NO_WRAPPER_HEADER_WARNING`` when using the wrapper header files. There is an additional configure-time CMake variable ``ROCM_HEADER_WRAPPER_WERROR``, which is used to set the default value for the compile-time C macro of the same name (with CMake truthy values setting a default of true/1). If the compile-time macro is true, then deprecation errors will be emitted instead of warnings. Any relative header or wrapper locations are relative to ``${CPACK_PACKAGING_INSTALL_PREFIX}`` if it is set, or to ``${CMAKE_INSTALL_PREFIX}`` otherwise (i.e. the install directory). Any relative output locations are relative to ``${PROJECT_BINARY_DIR}`` (i.e. the build directory) Each ```` is presumed to be installed to ``${CMAKE_INSTALL_PREFIX}//``. If it is not specified, ```` defaults to ``include/${CMAKE_PROJECT_NAME}`` (e.g. ``include/rocblas``). The ```` parameter specifies the presumed compiler include directory, to correctly calculate suggested include directives. Guards ^^^^^^^^^^ A guard item consists of the guard string ````, a wrapper location ````, and an output location ````. You may specify any number of guard strings, wrapper locations and output locations. Guard items will be created from the arguments, and if necessary the following defaults will be used: * Default ````: ``WRAPPER`` * Default ````: ``${CMAKE_PROJECT_NAME}/include`` * Default ````: The associated ```` If no guard items are specified, one will be created using all of the default values. Each guard item will create a wrapper file at ``${PROJECT_BINARY_DIR}//`` for each header file. This wrapper file will have the include guard ``ROCM__``, where ```` is ```` with each ``/`` and ``.`` replaced with ``_``. It assumes that it will be installed to ``${CMAKE_INSTALL_PREFIX}//``, and will include a relative path that is correct if it is installed to that location. For example, suppose the project name is ``rocexample`` and consider the following: .. code-block:: cmake rocm_wrap_header_file( foo/bar.h HEADER_LOCATION include/rocexample GUARDS EXAMPLE EXAMPLE_INC WRAPPER_LOCATIONS rocexample # EXAMPLE OUTPUT_LOCATIONS wrapper/rocexample # EXAMPLE ) This will create two wrapper files. The first wrapper file will be created at ``${PROJECT_BINARY_DIR}/wrapper/rocexample/foo/bar.h``. Its include guard will be ``ROCM_EXAMPLE_FOO_BAR_H``, and it will include the file ``../../include/rocexample/foo/bar.h`` (which is the correct file when this wrapper is installed at ``${CMAKE_INSTALL_PREFIX}/rocexample/foo/bar.h``). The second wrapper file uses the default locations, so it will be created at ``${PROJECT_BINARY_DIR}/rocexample/include/foo/bar.h``. Its include guard will be ``ROCM_EXAMPLE_INC_FOO_BAR_H``, and it will include the file ``../../../include/rocexample/foo/bar.h`` (which is the correct file when this wrapper is installed at ``${CMAKE_INSTALL_PREFIX}/rocexample/include/foo/bar.h``) If the name of the wrapper file being generated is the same as the name of any ````, the contents of that ```` will be added to the wrapper file inside a ``#if 0`` block. This has no effect on the code of the header, but it does allow projects which search for specific strings inside a header file to function correctly. .. cmake:command:: rocm_wrap_header_dir .. code-block:: cmake rocm_wrap_header_dir( [HEADER_LOCATION ] [GUARDS ...] [WRAPPER_LOCATIONS ...] [OUTPUT_LOCATIONS ...] [PATTERNS ...] [ORIGINAL_FILES ...] ) Create a C/C++ wrapper file for each header file in the given directory (or any subdirectory) matching at least one pattern. Each file in the specified directory which matches a pattern will have a wrapper file created for it. The ```` used in each call to ``rocm_wrap_header_file`` is the path to the header file relative to ````. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMInstallSymlinks.rst000066400000000000000000000010201473605615300245310ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocminstallsymlinks: **************************************************** ROCMInstallSymlinks **************************************************** Commands -------- .. cmake:command:: rocm_install_symlink_subdir .. code-block:: cmake rocm_install_symlink_subdir( []) Install symlinks which point into the ``subdir`` directory to the component `component`, or to the runtime and development components otherwise. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMInstallTargets.rst000066400000000000000000000033321473605615300243410ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocminstalltargets: **************************************************** ROCMInstallTargets **************************************************** Commands -------- .. cmake:command:: rocm_install .. code-block:: cmake rocm_install(TARGETS ... [...]) rocm_install( ... [...]) rocm_install(DIRECTORY ... [...]) rocm_install(SCRIPT [...]) rocm_install(CODE [...]) rocm_install(EXPORT [...]) Wraps installers to install to the correct component (devel or runtime) unless COMPONENT is specified. The TARGETS signature wraps ``rocm_install_targets``, all other signatures wrap ``install``. .. cmake:command:: rocm_install_targets .. code-block:: cmake rocm_install_targets( TARGETS ... [PREFIX ] [EXPORT ] [INCLUDE ...] [COMPONENT ] ) Install targets into the appropriate directory. Unless COMPONENT is specified, libraries will be installed to the base package and namelinked in the ``devel`` package, and everything else will be installed to the ``devel`` package. .. cmake:command:: rocm_export_targets .. code-block:: cmake rocm_export_targets( [NAMESPACE ] [EXPORT ] [INCLUDE ...] [NAME ] [COMPATIBILITY ] [PREFIX ] [TARGETS ...] [DEPENDS [PACKAGE ]...] [STATIC_DEPENDS [PACKAGE ]...] ) Export the installed targets so they can be consumed with ``find_package``. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMPackageConfigHelpers.rst000077500000000000000000000010331473605615300254040ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmconfighelpers: **************************************************** ROCMPackageConfigHelpers **************************************************** Commands -------- .. cmake:command:: rocm_configure_package_config_file .. code-block:: cmake rocm_configure_package_config_file( INSTALL_DESTINATION [PATH_VARS ...] [PREFIX ] ) Configure the config file used by ``find_package``. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMSetupVersion.rst000066400000000000000000000016011473605615300240440ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmSetupVersion: **************************************************** ROCMSetupVersion **************************************************** Commands -------- .. cmake:command:: rocm_get_version .. code-block:: cmake rocm_get_version( [VERSION ] [DIRECTORY ] ) Get the version of directory using git tags if possible. .. cmake:command:: rocm_setup_version .. code-block:: cmake rocm_setup_version( VERSION [NO_GIT_TAG_VERSION] [PARENT ] ) Setup the version for the project. This will try to use git tag to set the version if possible unless ``NO_GIT_TAG_VERSION`` is passed. The ``PARENT`` argument can be used to set the commit to start the count of number of commits to the current revision. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMSphinxDoc.rst000077500000000000000000000051301473605615300233010ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmSphinxDoc: **************************************************** ROCMSphinxDoc **************************************************** Commands -------- .. cmake:command:: rocm_add_sphinx_doc .. code-block:: cmake rocm_add_sphinx_doc( SRC_DIR BUILDER [OUTPUT_DIR ] [CONFIG_DIR ] [DEPENDS ...] [VARS ...] [TEMPLATE_VARS ...] [USE_DOXYGEN] ) This will create a ``sphinx-${BUILDER}`` doc-type target which will generate documentation using sphinx. The ``SRC_DIR`` should be the directory that contains the ``conf.py`` file. The options are: ``OUTPUT_DIR`` The directory where build output will be written. It takes its default, from ``ROCM_CMAKE_DOCS_DIR`` if set, otherwise defaults to ``sphinx/${BUILDER}``. Relative paths are interpreted relative to ``CMAKE_CURRENT_BINARY_DIR``. ``CONFIG_DIR`` The directory where ``conf.py`` will be searched. It sets the ``-c`` argument of ``sphinx-build`` if set, otherwise defaults to ``${SRC_DIR}`` as per the underlying tool. Relative paths are interpreted relative to ``CMAKE_CURRENT_SOURCE_DIR``. ``DEPENDS`` Sets up target-level dependencies between ``sphinx-${BUILDER}`` and the user-provided list of targets. ``VARS`` List of configuration values passed to Sphinx. List items will be passed as command-line args by prepending ``-D`` to each item. ``TEMPLATE_VARS`` List of HTML template values passed to Sphinx. List items will be passed as command-line args by prepending ``-A`` to each item. ``USE_DOXYGEN`` Flag denoting the use of Doxygen in the fashion rocm-docs-core expects it. Variables --------- .. cmake:variable:: SPHINX_EXECUTABLE This cached variable can be used to set which ``sphinx-build`` executable to use. By default it will search for ``sphinx-build`` on the system. The ``SPHINX_DIR`` environmental variable is taken as a ``HINT`` while searching. .. cmake:variable:: DOXYGEN_EXECUTABLE This cached variable can be used to set which ``doxygen`` executable to use. By default it will search for ``doxygen`` on the system. The ``DOXYGEN_DIR`` environmental variable is taken as a ``HINT`` while searching. .. cmake:variable:: SPHINX_${BUILDER}_DIR This is the directory where the documentation will be built. By default, it will use the ``OUTPUT_DIR`` passed to ``rocm_add_sphinx_doc`` otherwise it will be set to ``sphinx/${BUILDER}`` directory in the cmake build directory. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMTest.rst000066400000000000000000000064551473605615300223310ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmtest: **************************************************** ROCMTest **************************************************** This adds a ``check`` target to build and run the tests using CTest. A ``tests`` target can be used to just build the tests. All the tests are then packaged in the test component. Commands -------- .. cmake:command:: rocm_enable_test_package .. code-block:: cmake rocm_enable_test_package() Enable the test package. This must be called before ``rocm_create_package`` in the same directory. The ```` specifies the name of the directory to install the tests to. .. cmake:command:: rocm_add_test .. code-block:: cmake rocm_add_test(NAME COMMAND [...] [CONFIGURATIONS ...] [COMMAND_EXPAND_LISTS] ) Add test command to CTest and to test package. .. cmake:command:: rocm_add_test_executable .. code-block:: cmake rocm_add_test_executable( ...) Adds an executable to be built and ran for tests. The executable will link in the dependencies specified with ``rocm_test_link_libraries`` or ``rocm_test_include_directories``. It will also be installed with the test component. The name of the test will be the same as the name of the executable. .. cmake:command:: rocm_test_header .. code-block:: cmake rocm_test_header( ) This will add a test for checking a header can be included standalone and that there is no ODR issues in the header. .. cmake:command:: rocm_test_headers .. code-block:: cmake rocm_test_headers( PREFIX HEADERS DEPENDS ... ) This will test multiple headers at once. The ``PREFIX`` will specifiy any prefix to the included file needed. THe ``HEADERS`` is a list of headers to test for. This can also include globbing. For each file, the ``PREFIX`` and base name will be used for the include. The ``DEPENDS`` can list targets to link in for the test. .. cmake:command:: rocm_install_test .. code-block:: cmake rocm_install_test( [TARGETS ...] [FILES ...] [DESTINATION ] ) Install the target or file into the test directory. The ``DESTINATION`` can be specified for ``FILES`` but is relative to the test installation directory. .. cmake:command:: rocm_mark_as_test .. code-block:: cmake rocm_mark_as_test(...) This will include the target as part of the ``tests`` target. .. cmake:command:: rocm_link_test_dependencies .. code-block:: cmake rocm_link_test_dependencies(...) This will add test dependencies specified with ``rocm_test_link_libraries`` or ``rocm_test_include_directories``. .. cmake:command:: rocm_test_link_libraries .. code-block:: cmake rocm_test_link_libraries(...) Targets to link to test executables. Variables --------- .. cmake:variable:: CTEST_PARALLEL_LEVEL The parallel level used for ``check`` target to run the tests. The default is the number of cores. .. cmake:variable:: CTEST_TIMEOUT The timeout used for ``check`` target to run the tests. The default is 5000 seconds. .. cmake:variable:: ROCM_TEST_GDB Use gdb to printout a stacktrace when a test fails. This is either set to ``On`` or ``Off``. rocm-cmake-rocm-6.3.2/docs/src/reference/ROCMUtilities.rst000066400000000000000000000030241473605615300233520ustar00rootroot00000000000000.. meta:: :description: ROCm CMake :keywords: ROCm, Cmake, library, api, AMD .. _rocmutilities: **************************************************** ROCMUtilities **************************************************** Commands -------- .. cmake:command:: rocm_join_if_set .. code-block:: cmake rocm_join_if_set( [...]) Join all the ```` arguments together using the ```` string. If ```` names a variable with a set value, join that string at the beginning, also using the ```` string, and always store the result in ````. .. cmake:command:: rocm_defer .. code-block:: cmake rocm_defer() Call ```` at the end of configure. .. cmake:command:: rocm_find_program_version .. code-block:: cmake rocm_find_program_version( [QUIET] [REQUIRED] [GREATER ] [GREATER_EQUAL ] [LESS ] [LESS_EQUAL ] [EQUAL ] [OUTPUT_VARIABLE ] ) Determine the presence and installed version of a program that accepts the ``--version`` option. Optionally check the version using any of the comparison operators (each comparison operator may only be specified once). If ``out-var`` is not specified, it defaults to ``_VERSION``. If the program is found, ```` is set to the version detected. If that version satisfies all version constraints, the variable ``_OK`` is set to ``TRUE``, otherwise it is set to ``FALSE``. rocm-cmake-rocm-6.3.2/share/000077500000000000000000000000001473605615300156125ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/share/rocm/000077500000000000000000000000001473605615300165525ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/share/rocm/cmake/000077500000000000000000000000001473605615300176325ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/share/rocm/cmake/ROCMConfig.cmake000066400000000000000000000016671473605615300225340ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### get_filename_component(_new_rocmcmakebuildtools_path "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) get_filename_component(_new_rocmcmakebuildtools_path "${_new_rocmcmakebuildtools_path}" DIRECTORY) # two directories up is sufficient for windows search, but linux search requires the share directory get_filename_component(_new_rocmcmakebuildtools_path_linux "${_new_rocmcmakebuildtools_path}" DIRECTORY) include(CMakeFindDependencyMacro) find_dependency( ROCmCMakeBuildTools HINTS "${_new_rocmcmakebuildtools_path}" "${_new_rocmcmakebuildtools_path_linux}") unset(_new_rocmcmakebuildtools_path) unset(_new_rocmcmakebuildtools_path_linux) rocm-cmake-rocm-6.3.2/share/rocm/cmake/ROCMConfigVersion.cmake000066400000000000000000000006511473605615300240720ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../rocmcmakebuildtools/cmake) include(ROCmCMakeBuildToolsConfigVersion) rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/000077500000000000000000000000001473605615300216545ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/000077500000000000000000000000001473605615300227345ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMAnalyzers.cmake000066400000000000000000000007631473605615300263750ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### set(ROCM_ENABLE_GH_ANNOTATIONS Off CACHE BOOL "") if(NOT TARGET analyze) add_custom_target(analyze) endif() function(rocm_mark_as_analyzer) add_dependencies(analyze ${ARGN}) endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMCheckTargetIds.cmake000066400000000000000000000033631473605615300272500ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2021-2022 Advanced Micro Devices, Inc. # ###################################################################################################################### include(CheckCXXCompilerFlag) include(CMakeParseArguments) function(rocm_check_target_ids VARIABLE) set(options) set(oneValueArgs) set(multiValueArgs TARGETS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message( FATAL_ERROR "Unknown keywords given to rocm_check_target_ids(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() foreach(_target_id ${PARSE_TARGETS}) _rocm_sanitize_target_id("${_target_id}" _result_var) set(_result_var "COMPILER_HAS_TARGET_ID_${_result_var}") check_cxx_compiler_flag("-xhip --offload-arch=${_target_id}" "${_result_var}") if(${_result_var}) list(APPEND _supported_target_ids "${_target_id}") endif() endforeach() set(${VARIABLE} "${_supported_target_ids}" PARENT_SCOPE) endfunction() function(_rocm_sanitize_target_id TARGET_ID VARIABLE) # CMake defines a preprocessor macro with this value, so it must be a valid C identifier # Handle + and - for xnack and sramecc so that e.g. xnack+ and xnack- doesn't get folded to # the same string by MAKE_C_IDENTIFIER string(REPLACE "_" "__" TARGET_ID "${TARGET_ID}") string(REPLACE "+" "_on" TARGET_ID "${TARGET_ID}") string(REPLACE "-" "_off" TARGET_ID "${TARGET_ID}") string(MAKE_C_IDENTIFIER "${TARGET_ID}" TARGET_ID) set(${VARIABLE} "${TARGET_ID}" PARENT_SCOPE) endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMChecks.cmake000066400000000000000000000061741473605615300256270ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2019-2021 Advanced Micro Devices, Inc. # ###################################################################################################################### set(ROCM_WARN_TOOLCHAIN_VAR ON CACHE BOOL "") set(ROCM_ERROR_TOOLCHAIN_VAR OFF CACHE BOOL "") # environment variable control of options. Note prefix is ROCMCHECKS if(DEFINED ENV{ROCMCHECKS_WARN_TOOLCHAIN_VAR}) set(ROCM_WARN_TOOLCHAIN_VAR $ENV{ROCMCHECKS_WARN_TOOLCHAIN_VAR}) endif() if(DEFINED ENV{ROCMCHECKS_ERROR_TOOLCHAIN_VAR}) set(ROCM_ERROR_TOOLCHAIN_VAR $ENV{ROCMCHECKS_ERROR_TOOLCHAIN_VAR}) endif() function(rocm_check_toolchain_var var access value list_file) set(message_type STATUS) if(ROCM_ERROR_TOOLCHAIN_VAR) set(message_type SEND_ERROR) set(message_title " ROCMChecks ERROR ") elseif(ROCM_WARN_TOOLCHAIN_VAR) set(message_type WARNING) set(message_title "ROCMChecks WARNING") endif() if(access STREQUAL "MODIFIED_ACCESS") set(cmake_module Off) get_filename_component(base "${list_file}" DIRECTORY) # Skip warning in cmake's built-in modules if("${base}" STREQUAL "${CMAKE_ROOT}/Modules") set(cmake_module On) elseif("${base}" MATCHES ".*/CMakeFiles/${CMAKE_VERSION}$") set(cmake_module On) endif() if(NOT cmake_module) message( " ******************************************************************************* *------------------------------- ${message_title} --------------------------* Options and properties should be set on a cmake target where possible. The variable '${var}' may be set by the cmake toolchain, either by calling 'cmake -D${var}=\"${value}\"' or set in a toolchain file and added with 'cmake -DCMAKE_TOOLCHAIN_FILE='. ROCMChecks now calling:") message(${message_type} "'${var}' is set at ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt: shown below:") message( "*-----------------------------------------------------------------------------* ******************************************************************************* ") endif() endif() endfunction() if(UNIX AND (ROCM_WARN_TOOLCHAIN_VAR OR ROCM_ERROR_TOOLCHAIN_VAR)) foreach(LANG C CXX Fortran) variable_watch(CMAKE_${LANG}_COMPILER rocm_check_toolchain_var) variable_watch(CMAKE_${LANG}_FLAGS rocm_check_toolchain_var) variable_watch(CMAKE_${LANG}_LINK_EXECUTABLE rocm_check_toolchain_var) variable_watch(CMAKE_${LANG}_SIZEOF_DATA_PTR rocm_check_toolchain_var) variable_watch(CMAKE_${LANG}_STANDARD_INCLUDE_DIRECTORIES rocm_check_toolchain_var) variable_watch(CMAKE_${LANG}_STANDARD_LIBRARIES rocm_check_toolchain_var) endforeach() variable_watch(CMAKE_EXE_LINKER_FLAGS rocm_check_toolchain_var) variable_watch(CMAKE_MODULE_LINKER_FLAGS rocm_check_toolchain_var) variable_watch(CMAKE_SHARED_LINKER_FLAGS rocm_check_toolchain_var) variable_watch(CMAKE_STATIC_LINKER_FLAGS rocm_check_toolchain_var) endif() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMClangTidy.cmake000066400000000000000000000327451473605615300263100ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### include(CMakeParseArguments) include(ROCMAnalyzers) get_filename_component(CLANG_TIDY_EXE_HINT "${CMAKE_CXX_COMPILER}" PATH) find_program( CLANG_TIDY_EXE NAMES clang-tidy clang-tidy-9.0 clang-tidy-8.0 clang-tidy-7.0 clang-tidy-6.0 clang-tidy-5.0 clang-tidy-4.0 clang-tidy-3.9 clang-tidy-3.8 clang-tidy-3.7 clang-tidy-3.6 clang-tidy-3.5 HINTS ${CLANG_TIDY_EXE_HINT} PATH_SUFFIXES compiler/bin bin PATHS /opt/rocm/llvm/bin /opt/rocm/hcc /usr/local/opt/llvm/bin) execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE CLANG_TIDY_COMPILER_VERSION_OUTPUT) function(rocm_find_clang_tidy_version VAR) execute_process(COMMAND ${CLANG_TIDY_EXE} -version OUTPUT_VARIABLE VERSION_OUTPUT) separate_arguments(VERSION_OUTPUT_LIST UNIX_COMMAND "${VERSION_OUTPUT}") list(FIND VERSION_OUTPUT_LIST "version" VERSION_INDEX) if(VERSION_INDEX GREATER 0) math(EXPR VERSION_INDEX "${VERSION_INDEX} + 1") list(GET VERSION_OUTPUT_LIST ${VERSION_INDEX} VERSION) set(${VAR} ${VERSION} PARENT_SCOPE) else() set(${VAR} "0.0" PARENT_SCOPE) endif() endfunction() if(NOT CLANG_TIDY_EXE) message(STATUS "Clang tidy not found") set(CLANG_TIDY_VERSION "0.0") else() rocm_find_clang_tidy_version(CLANG_TIDY_VERSION) message(STATUS "Clang tidy found: ${CLANG_TIDY_VERSION}") endif() set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") set(CLANG_TIDY_CACHE "${CMAKE_BINARY_DIR}/tidy-cache" CACHE STRING "") if(CMAKE_GENERATOR MATCHES "Make") set(CLANG_TIDY_CACHE_SIZE 10 CACHE STRING "") else() set(CLANG_TIDY_CACHE_SIZE 0 CACHE STRING "") endif() set(CLANG_TIDY_FIXIT_DIR ${CMAKE_BINARY_DIR}/fixits) file(MAKE_DIRECTORY ${CLANG_TIDY_FIXIT_DIR}) set_property( DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${CLANG_TIDY_FIXIT_DIR}) set(CLANG_TIDY_DEPEND_ON_TARGET On CACHE BOOL "") set(ROCM_ENABLE_GH_ANNOTATIONS Off CACHE BOOL "Enable github annotations in output") set(CLANG_TIDY_USE_COLOR On CACHE BOOL "Enable color diagnostics in output") include(CMakeDependentOption) cmake_dependent_option(ROCM_ENABLE_CLANG_TIDY "Enable Clang-Tidy checks" ON CLANG_TIDY_EXE OFF) macro(rocm_enable_clang_tidy) if(ROCM_ENABLE_CLANG_TIDY) set(options ALL ANALYZE_TEMPORARY_DTORS ENABLE_ALPHA_CHECKS DEV_WARNINGS_AS_ERRORS) set(oneValueArgs HEADER_FILTER) set(multiValueArgs CHECKS ERRORS EXTRA_ARGS CLANG_ARGS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE ";" "," CLANG_TIDY_CHECKS "${PARSE_CHECKS}") string(REPLACE ";" "," CLANG_TIDY_ERRORS "${PARSE_ERRORS}") if(PARSE_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to rocm_enable_clang_tidy(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() message(STATUS "Clang tidy checks: ${CLANG_TIDY_CHECKS}") set(CLANG_TIDY_DEV_WARNINGS_AS_ERRORS) set(CLANG_TIDY_DEV_WARNING_MODE WARNING) if(PARSE_DEV_WARNINGS_AS_ERRORS) set(CLANG_TIDY_DEV_WARNING_MODE FATAL_ERROR) set(CLANG_TIDY_DEV_WARNINGS_AS_ERRORS -Werror=dev) endif() set(CLANG_TIDY_ALL) if(PARSE_ALL) set(CLANG_TIDY_ALL ALL) endif() set(CLANG_TIDY_EXTRA_ARGS) foreach(ARG ${PARSE_EXTRA_ARGS}) list(APPEND CLANG_TIDY_EXTRA_ARGS "-extra-arg=${ARG}") endforeach() foreach(ARG ${PARSE_CLANG_ARGS}) list(APPEND CLANG_TIDY_EXTRA_ARGS -extra-arg=-Xclang "-extra-arg=${ARG}") endforeach() set(CLANG_TIDY_USE_COLOR_ARGS) if(${CLANG_TIDY_VERSION} VERSION_GREATER "11.0.0" AND CLANG_TIDY_USE_COLOR AND NOT ROCM_ENABLE_GH_ANNOTATIONS) set(CLANG_TIDY_USE_COLOR_ARGS "--use-color") endif() set(CLANG_TIDY_ENABLE_ALPHA_CHECKS_ARGS) if(PARSE_ENABLE_ALPHA_CHECKS) set(CLANG_TIDY_ENABLE_ALPHA_CHECKS_ARGS --allow-enabling-analyzer-alpha-checkers) endif() if(${CLANG_TIDY_VERSION} VERSION_LESS "3.9.0") set(CLANG_TIDY_ERRORS_ARG "") else() set(CLANG_TIDY_ERRORS_ARG "-warnings-as-errors=${CLANG_TIDY_ERRORS}") endif() if(${CLANG_TIDY_VERSION} VERSION_LESS "4.0.0" OR WIN32) set(CLANG_TIDY_QUIET_ARG "") else() set(CLANG_TIDY_QUIET_ARG "-quiet") endif() if(EXISTS ${CMAKE_SOURCE_DIR}/.clang-tidy) set(CLANG_TIDY_CONFIG_ARG "--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy") else() set(CLANG_TIDY_CONFIG_ARG) endif() if(PARSE_HEADER_FILTER) string(REPLACE "$" "$$" CLANG_TIDY_HEADER_FILTER "${PARSE_HEADER_FILTER}") else() set(CLANG_TIDY_HEADER_FILTER ".*") endif() set(CLANG_TIDY_COMMAND ${CLANG_TIDY_EXE} ${CLANG_TIDY_USE_COLOR_ARGS} ${CLANG_TIDY_CONFIG_ARG} ${CLANG_TIDY_QUIET_ARG} ${CLANG_TIDY_ENABLE_ALPHA_CHECKS_ARGS} -p "${CMAKE_BINARY_DIR}" "-checks=${CLANG_TIDY_CHECKS}" "${CLANG_TIDY_ERRORS_ARG}" ${CLANG_TIDY_EXTRA_ARGS} "-header-filter=${CLANG_TIDY_HEADER_FILTER}") execute_process(COMMAND ${CLANG_TIDY_COMMAND} -dump-config OUTPUT_VARIABLE CLANG_TIDY_CONFIG) file(WRITE ${CMAKE_BINARY_DIR}/clang-tidy.yml ${CLANG_TIDY_CONFIG}) add_custom_target(tidy ${CLANG_TIDY_ALL}) rocm_mark_as_analyzer(tidy) add_custom_target(tidy-base) add_custom_target(tidy-make-fixit-dir COMMAND ${CMAKE_COMMAND} -E make_directory ${CLANG_TIDY_FIXIT_DIR}) add_custom_target(tidy-rm-fixit-dir COMMAND ${CMAKE_COMMAND} -E remove_directory ${CLANG_TIDY_FIXIT_DIR}) add_dependencies(tidy-make-fixit-dir tidy-rm-fixit-dir) add_dependencies(tidy-base tidy-make-fixit-dir) if(CLANG_TIDY_CACHE_SIZE GREATER 0) add_custom_target(tidy-create-cache-dir COMMAND ${CMAKE_COMMAND} -E make_directory ${CLANG_TIDY_CACHE}) add_dependencies(tidy-base tidy-create-cache-dir) endif() endif() endmacro() function(rocm_clang_tidy_check TARGET) if(NOT ROCM_ENABLE_CLANG_TIDY) return() endif() get_target_property(SOURCES ${TARGET} SOURCES) # TODO: Use generator expressions instead COMMAND ${CLANG_TIDY_COMMAND} $ COMMAND # ${CLANG_TIDY_COMMAND} $, > add_custom_target(tidy-target-${TARGET}) foreach(SOURCE ${SOURCES}) if(NOT "${SOURCE}" MATCHES "(h|hpp|hxx)$") string(MAKE_C_IDENTIFIER "${SOURCE}" tidy_file) set(tidy_target tidy-target-${TARGET}-${tidy_file}) if(CLANG_TIDY_CACHE_SIZE GREATER 0) get_filename_component(SRC_ABS ${SOURCE} ABSOLUTE) string(FIND ${SRC_ABS} ${CMAKE_CURRENT_BINARY_DIR} BINARY_IDX) if(BINARY_IDX EQUAL -1) set(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) else() set(ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}) endif() get_filename_component(SRC_PATH ${SRC_ABS} DIRECTORY) file(RELATIVE_PATH REL_PATH ${ROOT_DIR} ${SRC_PATH}) get_filename_component(BASE_SOURCE_NAME ${SOURCE} NAME_WE) if(REL_PATH) set(BASE_SOURCE ${REL_PATH}/${BASE_SOURCE_NAME}) else() set(BASE_SOURCE ${BASE_SOURCE_NAME}) endif() file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${tidy_target}.cmake " set(CLANG_TIDY_COMMAND_LIST \"${CLANG_TIDY_COMMAND}\") set(GH_ANNOTATIONS ${ROCM_ENABLE_GH_ANNOTATIONS}) execute_process( COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target ${BASE_SOURCE}.i -- -e COLOR=OFF ERROR_QUIET OUTPUT_VARIABLE PP_OUT RESULT_VARIABLE RESULT1) if(NOT RESULT1 EQUAL 0) message(${CLANG_TIDY_DEV_WARNING_MODE} \"Could not preprocess ${SOURCE} -> ${BASE_SOURCE}.i\") execute_process( COMMAND \${CLANG_TIDY_COMMAND_LIST} ${SOURCE} \"-export-fixes=${CLANG_TIDY_FIXIT_DIR}/${TARGET}-${tidy_file}.yaml\" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE RESULT2) if(NOT RESULT2 EQUAL 0) message(FATAL_ERROR \"Clang tidy failed. \") endif() return() endif() string(REPLACE \"Preprocessing CXX source to \" \"\" PP_FILE \"\${PP_OUT}\") string(STRIP \"\${PP_FILE}\" PP_FILE) file(MD5 ${CMAKE_CURRENT_BINARY_DIR}/\${PP_FILE} PP_HASH) execute_process( COMMAND \${CLANG_TIDY_COMMAND_LIST} ${SOURCE} --dump-config WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE TIDY_CONFIG) string(MD5 CONFIG_HASH \" \${TIDY_CONFIG} ${CLANG_TIDY_EXTRA_ARGS} ${CLANG_TIDY_COMPILER_VERSION_OUTPUT}\") set(HASH \${PP_HASH}-\${CONFIG_HASH}) set(HASHES \${HASH}) set(HASH_FILE ${CLANG_TIDY_CACHE}/${TARGET}-${tidy_file}) set(RUN_TIDY On) if(EXISTS \${HASH_FILE}) file(STRINGS \${HASH_FILE} CACHED_HASHES) list(FIND CACHED_HASHES \${HASH} HASH_IDX) if(NOT HASH_IDX EQUAL -1) set(RUN_TIDY Off) list(REMOVE_AT CACHED_HASHES \${HASH_IDX}) endif() list(LENGTH CACHED_HASHES NHASHES) math(EXPR NHASHES \"\${NHASHES} - 1\") if(NHASHES GREATER_EQUAL ${CLANG_TIDY_CACHE_SIZE}) foreach(IDX RANGE ${CLANG_TIDY_CACHE_SIZE} \${NHASHES}) list(REMOVE_AT CACHED_HASHES \${IDX}) endforeach() endif() list(APPEND HASHES \${CACHED_HASHES}) endif() if(RUN_TIDY) execute_process( COMMAND \${CLANG_TIDY_COMMAND_LIST} ${SOURCE} \"-export-fixes=${CLANG_TIDY_FIXIT_DIR}/${TARGET}-${tidy_file}.yaml\" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE RESULT3 OUTPUT_VARIABLE TIDY_OUTPUT ERROR_VARIABLE TIDY_OUTPUT) if(GH_ANNOTATIONS) string(REGEX REPLACE \"(/[^:\\t\\r\\n]+):([0-9]+):([0-9]+): (error|warning): ([^]]+])\" \"::warning file=\\\\1,line=\\\\2,col=\\\\3::\\\\5\" TIDY_OUTPUT \"\${TIDY_OUTPUT}\") string(REPLACE \"${CMAKE_SOURCE_DIR}/\" \"\" TIDY_OUTPUT \"\${TIDY_OUTPUT}\") endif() message(\"\${TIDY_OUTPUT}\") if(RESULT3 EQUAL 0) string(REPLACE \";\" \"\\n\" HASH_LINES \"\${HASHES}\") file(WRITE \${HASH_FILE} \"\${HASH_LINES}\") else() message(FATAL_ERROR \"Clang tidy failed. \") endif() endif() ") add_custom_target( ${tidy_target} COMMAND ${CMAKE_COMMAND} ${CLANG_TIDY_DEV_WARNINGS_AS_ERRORS} -P ${CMAKE_CURRENT_BINARY_DIR}/${tidy_target}.cmake COMMENT "clang-tidy: Running clang-tidy on target ${SOURCE}...") else() add_custom_target( ${tidy_target} COMMAND ${CLANG_TIDY_COMMAND} ${SOURCE} "-export-fixes=${CLANG_TIDY_FIXIT_DIR}/${TARGET}-${tidy_file}.yaml" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "clang-tidy: Running clang-tidy on target ${SOURCE}...") endif() if(CLANG_TIDY_DEPEND_ON_TARGET) add_dependencies(${tidy_target} ${TARGET}) endif() add_dependencies(${tidy_target} tidy-base) add_dependencies(tidy-target-${TARGET} ${tidy_target}) add_dependencies(tidy ${tidy_target}) endif() endforeach() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMClients.cmake000066400000000000000000000027451473605615300260300ustar00rootroot00000000000000# ######################################################################## # Copyright 2016-2021 Advanced Micro Devices, Inc. # ######################################################################## include(ROCMInstallSymlinks) include(ROCMUtilities) macro(rocm_package_setup_client_component COMPONENT_NAME) set(options) set(oneValueArgs PACKAGE_NAME LIBRARY_NAME) set(multiValueArgs DEPENDS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(BUILD_SHARED_LIBS) if(DEFINED PARSE_DEPENDS) cmake_parse_arguments(DEPENDS "" "" "COMMON;RPM;DEB;COMPONENT" ${PARSE_DEPENDS}) set(_DEPENDS_ARG DEPENDS COMMON "${DEPENDS_COMMON}" RPM "${DEPENDS_RPM}" DEB "${DEPENDS_DEB}" COMPONENT "${DEPENDS_COMPONENT}" runtime ) else() set(_DEPENDS_ARG DEPENDS COMPONENT runtime) endif() elseif(DEFINED PARSE_DEPENDS) set(_DEPENDS_ARG DEPENDS "${PARSE_DEPENDS}") endif() if(DEFINED PARSE_PACKAGE_NAME) set(_PACKAGE_NAME_ARG "PACKAGE_NAME;${PARSE_PACKAGE_NAME}") endif() if(DEFINED LIBRARY_NAME) set(_LIBRARY_NAME_ARG "LIBRARY_NAME;${PARSE_LIBRARY_NAME}") endif() rocm_package_setup_component( ${COMPONENT_NAME} ${_PACKAGE_NAME_ARG} ${_LIBRARY_NAME_ARG} PARENT clients ${_DEPENDS_ARG} ) endmacro() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMCppCheck.cmake000077500000000000000000000113261473605615300261050ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### include(CMakeParseArguments) include(ProcessorCount) include(ROCMAnalyzers) find_program( CPPCHECK_EXE NAMES cppcheck PATHS /opt/rocm/bin) function(rocm_find_cppcheck_version VAR) execute_process(COMMAND ${CPPCHECK_EXE} --version OUTPUT_VARIABLE VERSION_OUTPUT) separate_arguments(VERSION_OUTPUT_LIST UNIX_COMMAND "${VERSION_OUTPUT}") list(LENGTH VERSION_OUTPUT_LIST VERSION_OUTPUT_LIST_LEN) if(VERSION_OUTPUT_LIST_LEN GREATER 1) list(GET VERSION_OUTPUT_LIST 1 VERSION) set(${VAR} ${VERSION} PARENT_SCOPE) else() set(${VAR} "0.0" PARENT_SCOPE) endif() endfunction() if(NOT CPPCHECK_EXE) message(STATUS "Cppcheck not found") set(CPPCHECK_VERSION "0.0") else() rocm_find_cppcheck_version(CPPCHECK_VERSION) message(STATUS "Cppcheck found: ${CPPCHECK_VERSION}") endif() processorcount(CPPCHECK_JOBS) set(CPPCHECK_BUILD_DIR ${CMAKE_BINARY_DIR}/cppcheck-build CACHE STRING "") file(MAKE_DIRECTORY ${CPPCHECK_BUILD_DIR}) set_property( DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${CPPCHECK_BUILD_DIR}) include(CMakeDependentOption) cmake_dependent_option(ROCM_ENABLE_CPPCHECK "Enable CppCheck" ON CPPCHECK_EXE OFF) macro(rocm_enable_cppcheck) if(ROCM_ENABLE_CPPCHECK) set(options FORCE INCONCLUSIVE) set(oneValueArgs RULE_FILE) set(multiValueArgs CHECKS SUPPRESS DEFINE UNDEFINE INCLUDE SOURCES ADDONS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(REPLACE ";" "," CPPCHECK_CHECKS "${PARSE_CHECKS}") string(REPLACE ";" "\n" CPPCHECK_SUPPRESS "${PARSE_SUPPRESS};*:/usr/*") file(WRITE ${CMAKE_BINARY_DIR}/cppcheck-supressions "${CPPCHECK_SUPPRESS}") set(CPPCHECK_DEFINES) foreach(DEF ${PARSE_DEFINE}) list(APPEND CPPCHECK_DEFINES "-D${DEF}") endforeach() set(CPPCHECK_UNDEFINES) foreach(DEF ${PARSE_UNDEFINE}) list(APPEND CPPCHECK_UNDEFINES "-U${DEF}") endforeach() set(CPPCHECK_INCLUDES) foreach(INC ${PARSE_INCLUDE}) list(APPEND CPPCHECK_INCLUDES "-I${INC}") endforeach() # set(CPPCHECK_FORCE) set(CPPCHECK_FORCE "--project=${CMAKE_BINARY_DIR}/compile_commands.json") if(PARSE_FORCE) set(CPPCHECK_FORCE --force) endif() set(CPPCHECK_INCONCLUSIVE "") if(PARSE_INCONCLUSIVE) set(CPPCHECK_INCONCLUSIVE --inconclusive) endif() if(${CPPCHECK_VERSION} VERSION_LESS "1.80") set(CPPCHECK_BUILD_DIR_FLAG) else() set(CPPCHECK_BUILD_DIR_FLAG "--cppcheck-build-dir=${CPPCHECK_BUILD_DIR}") endif() if(${CPPCHECK_VERSION} VERSION_LESS "1.80") set(CPPCHECK_PLATFORM_FLAG) else() set(CPPCHECK_PLATFORM_FLAG "--platform=native") endif() set(CPPCHECK_RULE_FILE_ARG) if(PARSE_RULE_FILE) set(CPPCHECK_RULE_FILE_ARG "--rule-file=${PARSE_RULE_FILE}") endif() set(CPPCHECK_ADDONS_ARG) foreach(ADDON ${PARSE_ADDONS}) list(APPEND CPPCHECK_ADDONS_ARG "--addon=${ADDON}") endforeach() set(CPPCHECK_TEMPLATE_ARG) if(ROCM_ENABLE_GH_ANNOTATIONS) # cmake-lint: disable=C0301 set(CPPCHECK_TEMPLATE_ARG "--template=::warning file={file},line={line},col={column}::{severity}: {inconclusive:inconclusive: }{message} [{id}]" "--template-location={file}:{line}:{column}: note: {info}\\\n{code}") endif() set(CPPCHECK_COMMAND ${CPPCHECK_EXE} -q # -v --report-progress ${CPPCHECK_FORCE} ${CPPCHECK_INCONCLUSIVE} ${CPPCHECK_BUILD_DIR_FLAG} ${CPPCHECK_PLATFORM_FLAG} ${CPPCHECK_RULE_FILE_ARG} ${CPPCHECK_TEMPLATE_ARG} ${CPPCHECK_ADDONS_ARG} --inline-suppr --error-exitcode=1 -j ${CPPCHECK_JOBS} ${CPPCHECK_DEFINES} ${CPPCHECK_UNDEFINES} ${CPPCHECK_INCLUDES} "--relative-paths=${CMAKE_SOURCE_DIR}" --enable=${CPPCHECK_CHECKS} --suppressions-list=${CMAKE_BINARY_DIR}/cppcheck-supressions) add_custom_target( cppcheck COMMAND ${CPPCHECK_COMMAND} ${PARSE_SOURCES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "cppcheck: Running cppcheck...") rocm_mark_as_analyzer(cppcheck) endif() endmacro() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake000077500000000000000000000577201473605615300271140ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017-2019 Advanced Micro Devices, Inc. # ###################################################################################################################### cmake_policy(SET CMP0057 NEW) set(ROCM_DISABLE_LDCONFIG OFF CACHE BOOL "") get_filename_component(REAL_ROCM "${CMAKE_INSTALL_PREFIX}" REALPATH) get_filename_component(REAL_ROCM_DIR "${ROCM_DIR}" REALPATH) if(REAL_ROCM MATCHES "rocm-([0-9]+(\\.[0-9]+)+)") set(ROCM_PLATFORM_VERSION "${CMAKE_MATCH_1}" CACHE STRING "The version of the ROCm platform.") elseif(REAL_ROCM_DIR MATCHES "rocm-([0-9]+(\\.[0-9]+)+)") set(ROCM_PLATFORM_VERSION "${CMAKE_MATCH_1}" CACHE STRING "The version of the ROCm platform.") endif() if(DEFINED ROCM_PLATFORM_VERSION AND ROCM_PLATFORM_VERSION VERSION_LESS 4.5.0) set(ROCM_DEP_ROCMCORE FALSE CACHE BOOL "Add dependency on rocm-core package") else() set(ROCM_DEP_ROCMCORE TRUE CACHE BOOL "Add dependency on rocm-core package") endif() # todo: consolidate with duplicate in ROCMInstallTargets.cmake # Default libdir to "lib", this skips GNUInstallDirs from trying to take a guess if it's unset: set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory") include(CMakeParseArguments) include(GNUInstallDirs) include(ROCMSetupVersion) include(ROCMUtilities) find_program(MAKE_NSIS_EXE makensis) find_program(RPMBUILD_EXE rpmbuild) find_program(DPKG_EXE dpkg) set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME runtime) set(ROCM_PACKAGE_CREATED FALSE CACHE INTERNAL "Track whether rocm_create_package has been called.") function(rocm_package_add_rpm_dependencies) set(options QUIET) set(oneValueArgs COMPONENT) set(multiValueArgs DEPENDS SHARED_DEPENDS STATIC_DEPENDS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(${ROCM_PACKAGE_CREATED} AND NOT PARSE_QUIET) message(AUTHOR_WARNING "rocm_package_add_rpm_dependencies called after rocm_create_package!") endif() if(DEFINED PARSE_COMPONENT) string(TOUPPER "${PARSE_COMPONENT}" COMPONENT_VAR) set(REQ_VAR "CPACK_RPM_${COMPONENT_VAR}_PACKAGE_REQUIRES") else() set(REQ_VAR "CPACK_RPM_PACKAGE_REQUIRES") endif() set(CURRENT_DEPENDS "${${REQ_VAR}}") if (DEFINED PARSE_DEPENDS) rocm_join_if_set(", " CURRENT_DEPENDS ${PARSE_DEPENDS}) endif() if(DEFINED PARSE_SHARED_DEPENDS AND BUILD_SHARED_LIBS) rocm_join_if_set(", " CURRENT_DEPENDS ${PARSE_SHARED_DEPENDS}) endif() if(DEFINED PARSE_STATIC_DEPENDS AND NOT BUILD_SHARED_LIBS) rocm_join_if_set(", " CURRENT_DEPENDS ${PARSE_STATIC_DEPENDS}) endif() set(${REQ_VAR} "${CURRENT_DEPENDS}" PARENT_SCOPE) endfunction() function(rocm_package_add_deb_dependencies) set(options QUIET) set(oneValueArgs COMPONENT) set(multiValueArgs DEPENDS SHARED_DEPENDS STATIC_DEPENDS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(${ROCM_PACKAGE_CREATED} AND NOT PARSE_QUIET) message(AUTHOR_WARNING "rocm_package_add_deb_dependencies called after rocm_create_package!") endif() if(DEFINED PARSE_COMPONENT) string(TOUPPER "CPACK_DEBIAN_${PARSE_COMPONENT}_PACKAGE_DEPENDS" REQ_VAR) else() set(REQ_VAR "CPACK_DEBIAN_PACKAGE_DEPENDS") endif() set(NEW_DEPENDS "") if(DEFINED PARSE_DEPENDS) list(APPEND NEW_DEPENDS ${PARSE_DEPENDS}) endif() if(DEFINED PARSE_SHARED_DEPENDS AND BUILD_SHARED_LIBS) list(APPEND NEW_DEPENDS "${PARSE_SHARED_DEPENDS}") endif() if(DEFINED PARSE_STATIC_DEPENDS AND NOT BUILD_SHARED_LIBS) list(APPEND NEW_DEPENDS "${PARSE_STATIC_DEPENDS}") endif() set(CURRENT_DEPENDS "${${REQ_VAR}}") foreach(DEP IN LISTS NEW_DEPENDS) string(REGEX REPLACE "^([a-zA-Z0-9][-a-zA-Z0-9+.]+)[ \t\n]+([<>]?=)[ \t\n]+(.*)$" "\\1 (\\2 \\3)" DEP_EQ "${DEP}") string(REGEX REPLACE "^([a-zA-Z0-9][-a-zA-Z0-9+.]+)[ \t\n]+([<>])[ \t\n]+(.*)$" "\\1 (\\2\\2 \\3)" DEP_ALL "${DEP_EQ}") rocm_join_if_set(", " CURRENT_DEPENDS "${DEP_ALL}") endforeach() set(${REQ_VAR} "${CURRENT_DEPENDS}" PARENT_SCOPE) endfunction() macro(rocm_package_add_dependencies) set(_list_var "${ARGN}") if ("QUIET" IN_LIST _list_var) rocm_package_add_deb_dependencies(${ARGN}) rocm_package_add_rpm_dependencies(${ARGN}) else() if(${ROCM_PACKAGE_CREATED}) message(AUTHOR_WARNING "rocm_package_add_dependencies called after rocm_create_package!") endif() rocm_package_add_deb_dependencies(QUIET ${ARGN}) rocm_package_add_rpm_dependencies(QUIET ${ARGN}) endif() endmacro() macro(rocm_package_add_rocm_core_dependency) # Optionally add depenency on rocm-core # This mainly empty package exists to allow all of rocm # to be removed in one step by removing rocm-core if(ROCM_DEP_ROCMCORE) if(ENABLE_ASAN_PACKAGING) # For ASAN packages, add dependency to rocm-core-asan set(_rocm_core_pkg "rocm-core-asan") else() set(_rocm_core_pkg "rocm-core") endif() rocm_join_if_set(", " CPACK_DEBIAN_PACKAGE_DEPENDS ${_rocm_core_pkg}) rocm_join_if_set(", " CPACK_RPM_PACKAGE_REQUIRES ${_rocm_core_pkg}) unset(_rocm_core_pkg) endif() endmacro() function(rocm_parse_python_syspath DIR_PATH PKG_NAME) set(PYTHON_SITE_PACKAGES "/usr/lib/python3/dist-packages;/usr/lib/python2.7/dist-packages" CACHE STRING "The site packages used for packaging") #Group the statements to function file(APPEND ${PROJECT_BINARY_DIR}/debian/postinst " set_libdir(){ ") # Remove the path configuration files (.pth) only during remove/uninstall # NOT during upgrade operation. # Since same prerm scriptlet is used for both DEB and RPM pkgs, adding both # conditions for rpm and deb scriptlets for remove case. # Arg value of the prerm script is saved in to a variable arg1 and used inside # the rm_libdir() function as $1 inside the function will be empty as its not called with arguments. file(APPEND ${PROJECT_BINARY_DIR}/debian/prerm " arg1=\"$1\" rm_libdir(){ if [ \"$arg1\" = \"remove\" ] || [ \"$arg1\" = \"0\" ]; then ") foreach(PYTHON_SITE ${PYTHON_SITE_PACKAGES}) file( APPEND ${PROJECT_BINARY_DIR}/debian/postinst " mkdir -p ${PYTHON_SITE} echo \"${DIR_PATH}\" > ${PYTHON_SITE}/${PKG_NAME}.pth ") file( APPEND ${PROJECT_BINARY_DIR}/debian/prerm " rm -f ${PYTHON_SITE}/${PKG_NAME}.pth ") endforeach() #end function and invoke the function file(APPEND ${PROJECT_BINARY_DIR}/debian/postinst " } set_libdir ") # Keep the function call "rm_libdir" at the end of the prerm script and # do not modify that line. # This function call line of the prerm script will be removed # during the versioned package rebuild using a sed command. file(APPEND ${PROJECT_BINARY_DIR}/debian/prerm " fi } rm_libdir ") endfunction() macro(rocm_set_cpack_gen) # If CPACK_GENERATOR value has been given, then just use it if(NOT CPACK_GENERATOR) # If there is a PKGTYPE, use that as the desired type if(DEFINED ENV{ROCM_PKGTYPE}) set(CPACK_GENERATOR "" ) # Create the variable if needed string(TOUPPER $ENV{ROCM_PKGTYPE} CPACK_GENERATOR) # PKGTYPE is typically lower case else() # Otherwise see what we can find set(CPACK_GENERATOR "TGZ;ZIP") if(EXISTS ${MAKE_NSIS_EXE}) list(APPEND CPACK_GENERATOR "NSIS") endif() if(EXISTS ${RPMBUILD_EXE}) list(APPEND CPACK_GENERATOR "RPM") endif() if(EXISTS ${DPKG_EXE}) list(APPEND CPACK_GENERATOR "DEB") endif() endif() endif() # Set up some additional variables depending on which generator we are going to use if (CPACK_GENERATOR MATCHES ".*RPM.*") if(PARSE_COMPONENTS) set(CPACK_RPM_COMPONENT_INSTALL ON) endif() endif() if (CPACK_GENERATOR MATCHES ".*DEB.*") if(EXISTS ${DPKG_EXE}) if(PARSE_COMPONENTS) set(CPACK_DEB_COMPONENT_INSTALL ON) execute_process( COMMAND dpkg --print-architecture RESULT_VARIABLE PROC_RESULT OUTPUT_VARIABLE COMMAND_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE) if(PROC_RESULT EQUAL "0" AND NOT COMMAND_OUTPUT STREQUAL "") set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${COMMAND_OUTPUT}") endif() endif() endif() endif() endmacro() macro(rocm_set_cpack_compression) # Default to xz unless otherwise specified. # The CPack default compression type is gzip, but xz packages are much smaller. # Native packages have defaulted to xz since at least Ubuntu 14.04. if(NOT CPACK_DEBIAN_COMPRESSION_TYPE) if(DEFINED ENV{ROCM_DEBIAN_COMPRESSION_TYPE}) set(CPACK_DEBIAN_COMPRESSION_TYPE "$ENV{ROCM_DEBIAN_COMPRESSION_TYPE}" CACHE STRING "") else() set(CPACK_DEBIAN_COMPRESSION_TYPE "xz" CACHE STRING "") endif() endif() # xz compression is slow, but can be parallelized with CMake 3.20 or later. # The compression ratio is marginally affected. The speedup is subject to # diminishing returns at higher thread counts. if(NOT CPACK_THREADS) if(DEFINED ENV{ROCM_PKGTHREADS}) set(CPACK_THREADS "$ENV{ROCM_PKGTHREADS}" CACHE STRING "") else() set(CPACK_THREADS "0" CACHE STRING "") endif() endif() endmacro() macro(rocm_create_package) set(options LDCONFIG PTH HEADER_ONLY) set(oneValueArgs NAME DESCRIPTION SECTION MAINTAINER LDCONFIG_DIR PREFIX SUFFIX) set(multiValueArgs DEPENDS COMPONENTS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(TOLOWER ${PARSE_NAME} _rocm_cpack_package_name) set(CPACK_PACKAGE_NAME ${_rocm_cpack_package_name}) set(CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PARSE_DESCRIPTION}) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) if(NOT CMAKE_HOST_WIN32) set(CPACK_SET_DESTDIR ON CACHE BOOL "Boolean toggle to make CPack use DESTDIR mechanism when packaging") if(${CPACK_SET_DESTDIR}) set(CPACK_PACKAGING_INSTALL_PREFIX "") endif() endif() rocm_get_patch_version(ROCM_VERSION_NUM) if(ROCM_VERSION_NUM) set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${ROCM_VERSION_NUM}") endif() set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${PARSE_MAINTAINER}) set(CPACK_DEBIAN_PACKAGE_SECTION "devel") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_NSIS_MODIFY_PATH On) set(CPACK_NSIS_PACKAGE_NAME ${PARSE_NAME}) set(CPACK_RPM_PACKAGE_RELOCATABLE Off) set(CPACK_RPM_PACKAGE_AUTOREQPROV Off CACHE BOOL "turns off rpm autoreqprov field; packages explicity list dependencies") set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") if(DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE}) set(DEBIAN_VERSION $ENV{CPACK_DEBIAN_PACKAGE_RELEASE}) elseif(PROJECT_VERSION_TWEAK) # Sanitize tweak version for debian string(REGEX REPLACE "[^A-Za-z0-9.+~]" "~" DEBIAN_VERSION ${PROJECT_VERSION_TWEAK}) endif() if(DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE}) set(RPM_RELEASE $ENV{CPACK_RPM_PACKAGE_RELEASE}) elseif(PROJECT_VERSION_TWEAK) # Sanitize tweak version for rpm string(REPLACE "-" "_" RPM_RELEASE ${PROJECT_VERSION_TWEAK}) endif() if (ROCM_USE_DEV_COMPONENT) rocm_compute_component_package_name(devel "${CPACK_PACKAGE_NAME}" "${PARSE_SUFFIX}" "${PARSE_HEADER_ONLY}") list(APPEND PARSE_COMPONENTS devel) rocm_join_if_set(", " CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${CPACK_DEBIAN_DEVEL_PACKAGE_NAME} (>=${CPACK_PACKAGE_VERSION})") rocm_find_program_version(rpmbuild GREATER_EQUAL 4.12.0 QUIET) if(rpmbuild_VERSION_OK) rocm_join_if_set(", " CPACK_RPM_RUNTIME_PACKAGE_SUGGESTS "${CPACK_RPM_DEVEL_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}" ) endif() if(PARSE_HEADER_ONLY OR NOT BUILD_SHARED_LIBS) if(DEFINED CPACK_DEBIAN_DEVEL_PACKAGE_PROVIDES) rocm_join_if_set(", " CPACK_DEBIAN_DEVEL_PACKAGE_PROVIDES "${CPACK_PACKAGE_NAME} (= ${CPACK_PACKAGE_VERSION})" ) else() rocm_join_if_set(", " CPACK_DEBIAN_DEVEL_PACKAGE_PROVIDES "${CPACK_DEBIAN_PACKAGE_PROVIDES}" "${CPACK_PACKAGE_NAME} (= ${CPACK_PACKAGE_VERSION})") endif() if(DEFINED CPACK_RPM_DEVEL_PACKAGE_PROVIDES) rocm_join_if_set(", " CPACK_RPM_DEVEL_PACKAGE_PROVIDES "${CPACK_PACKAGE_NAME}" ) else() rocm_join_if_set(", " CPACK_RPM_DEVEL_PACKAGE_PROVIDES "${CPACK_RPM_PACKAGE_PROVIDES}" "${CPACK_PACKAGE_NAME}") endif() else() rocm_package_add_dependencies(COMPONENT devel DEPENDS "${CPACK_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}") endif() endif() if(ROCM_PACKAGE_COMPONENTS) list(APPEND PARSE_COMPONENTS ${ROCM_PACKAGE_COMPONENTS}) endif() rocm_set_cpack_gen() # Set CPACK_GENERATOR if not already set rocm_set_cpack_compression() if(CPACK_GENERATOR MATCHES ".*RPM.*") # '%{?dist}' breaks manual builds on debian systems due to empty Provides execute_process( COMMAND rpm --eval %{?dist} RESULT_VARIABLE PROC_RESULT OUTPUT_VARIABLE EVAL_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE) if(PROC_RESULT EQUAL "0" AND NOT EVAL_RESULT STREQUAL "") string(APPEND RPM_RELEASE "%{?dist}") endif() endif() set(CPACK_DEBIAN_PACKAGE_RELEASE ${DEBIAN_VERSION}) set(CPACK_RPM_PACKAGE_RELEASE ${RPM_RELEASE}) if(PARSE_DEPENDS) rocm_package_add_dependencies(DEPENDS ${PARSE_DEPENDS}) endif() rocm_package_add_rocm_core_dependency() set(LIB_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) if(PARSE_PREFIX) set(LIB_DIR ${CMAKE_INSTALL_PREFIX}/${PARSE_PREFIX}/${CMAKE_INSTALL_LIBDIR}) endif() file(WRITE ${PROJECT_BINARY_DIR}/debian/postinst "") file(WRITE ${PROJECT_BINARY_DIR}/debian/prerm "") set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian/postinst;${PROJECT_BINARY_DIR}/debian/prerm") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${PROJECT_BINARY_DIR}/debian/postinst") set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${PROJECT_BINARY_DIR}/debian/prerm") if(PARSE_LDCONFIG AND NOT ${ROCM_DISABLE_LDCONFIG}) set(LDCONFIG_DIR ${LIB_DIR}) if(PARSE_LDCONFIG_DIR) set(LDCONFIG_DIR ${PARSE_LDCONFIG_DIR}) endif() file( APPEND ${PROJECT_BINARY_DIR}/debian/postinst " echo \"${LDCONFIG_DIR}\" > /etc/ld.so.conf.d/${PARSE_NAME}.conf ldconfig ") file( APPEND ${PROJECT_BINARY_DIR}/debian/prerm " rm /etc/ld.so.conf.d/${PARSE_NAME}.conf ldconfig ") endif() if(PARSE_PTH) rocm_parse_python_syspath(${LIB_DIR} ${PARSE_NAME}) endif() rocm_setup_license(${PARSE_HEADER_ONLY}) if(PARSE_COMPONENTS) rocm_set_comp_cpackvar(PARSE_HEADER_ONLY "${PARSE_SUFFIX}" "${PARSE_COMPONENTS}") endif() include(CPack) set(ROCM_PACKAGE_CREATED TRUE CACHE INTERNAL "Track whether rocm_create_package has been called.") endmacro() macro(rocm_setup_license HEADER_ONLY) if(NOT CPACK_RESOURCE_FILE_LICENSE) file(GLOB _license_files LIST_DIRECTORIES FALSE "${CMAKE_SOURCE_DIR}/LICENSE*") set(_detected_license_files) foreach(_license_file IN LISTS _license_files) if(_license_file MATCHES "LICENSE(\\.(md|txt))?$") list(APPEND _detected_license_files "${_license_file}") endif() endforeach() list(LENGTH _detected_license_files _num_licenses) if(_num_licenses GREATER 1) message(AUTHOR_WARNING "rocm-cmake warning: Multiple license files found, " "please specify one using CPACK_RESOURCE_FILE_LICENSE." ) elseif(_num_licenses EQUAL 0) message(AUTHOR_WARNING "rocm-cmake warning: Could not find a license file, " "please specify one using CPACK_RESOURCE_FILE_LICENSE." ) else() list(GET _detected_license_files 0 CPACK_RESOURCE_FILE_LICENSE) message(STATUS "rocm-cmake: Set license file to ${CPACK_RESOURCE_FILE_LICENSE}.") endif() endif() if(CPACK_RESOURCE_FILE_LICENSE) if(ENABLE_ASAN_PACKAGING) install( FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${_rocm_cpack_package_name}-asan ) elseif((ROCM_USE_DEV_COMPONENT AND ${HEADER_ONLY}) OR NOT BUILD_SHARED_LIBS) install( FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${_rocm_cpack_package_name} COMPONENT devel ) else() install( FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${_rocm_cpack_package_name} ) endif() endif() endmacro() macro(rocm_compute_component_package_name COMPONENT_NAME BASE_NAME NAME_SUFFIX HEADER_ONLY) # both the fully upper and lowercased names of the components will be needed string(TOLOWER ${COMPONENT_NAME} _component_name_lower) string(TOUPPER ${COMPONENT_NAME} _component_name_upper) # determine the package name suffix due to specific build conditions if(${NAME_SUFFIX}) string(TOLOWER ${NAME_SUFFIX} _component_suffix) else() if(ENABLE_ASAN_PACKAGING) set(_component_suffix asan) elseif(NOT ${BUILD_SHARED_LIBS}) set(_component_suffix static) endif() endif() if(_component_suffix) set(_component_suffix "-${_component_suffix}") endif() # determine the package name component if(_component_name_lower STREQUAL "runtime") set(_rpm_component_partial "") set(_deb_component_partial "") elseif(_component_name_lower STREQUAL "devel") set(_rpm_component_partial "-devel") set(_deb_component_partial "-dev") else() set(_rpm_component_partial "-${_component_name_lower}") set(_deb_component_partial "-${_component_name_lower}") endif() # set the package names if(NOT DEFINED CPACK_RPM_${_component_name_upper}_PACKAGE_NAME OR CPACK_RPM_${_component_name_upper}_PACKAGE_NAME STREQUAL "" ) set(CPACK_RPM_${_component_name_upper}_PACKAGE_NAME "${BASE_NAME}${_component_suffix}${_rpm_component_partial}") endif() if(NOT DEFINED CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME OR CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME STREQUAL "" ) set(CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME "${BASE_NAME}${_component_suffix}${_deb_component_partial}") endif() # clean up temporary variables unset(_deb_component_partial) unset(_rpm_component_partial) unset(_component_suffix) unset(_component_name_upper) unset(_component_name_lower) endmacro(rocm_compute_component_package_name) macro(rocm_set_comp_cpackvar HEADER_ONLY NAME_SUFFIX components) # Setting component specific variables set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) if(NOT ROCM_USE_DEV_COMPONENT OR NOT ${HEADER_ONLY}) rocm_compute_component_package_name("runtime" "${CPACK_PACKAGE_NAME}" "${NAME_SUFFIX}" ${HEADER_ONLY}) if (NOT ENABLE_ASAN_PACKAGING) set(CPACK_DEBIAN_RUNTIME_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${DEBIAN_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") else() set(CPACK_RPM_RUNTIME_FILE_NAME "RPM-DEFAULT") set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT") endif() if (NOT ${HEADER_ONLY} AND BUILD_SHARED_LIBS) if (NOT ENABLE_ASAN_PACKAGING) set(CPACK_RPM_MAIN_COMPONENT "runtime") endif() list(APPEND CPACK_COMPONENTS_ALL runtime) endif() endif() if(ENABLE_ASAN_PACKAGING) set(_rocm_components) else() set(_rocm_components ${components}) endif() foreach(COMPONENT ${_rocm_components}) list(APPEND CPACK_COMPONENTS_ALL "${COMPONENT}") string(TOUPPER "${COMPONENT}" COMPONENT_UC) set(CPACK_RPM_${COMPONENT_UC}_FILE_NAME "RPM-DEFAULT") set(CPACK_DEBIAN_${COMPONENT_UC}_FILE_NAME "DEB-DEFAULT") rocm_compute_component_package_name("${COMPONENT}" "${CPACK_PACKAGE_NAME}" "${NAME_SUFFIX}" "${HEADER_ONLY}") string(REGEX REPLACE "" "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME "${CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME}") string(REGEX REPLACE "" "${CPACK_PACKAGE_NAME}" CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME "${CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME}") endforeach() if(ROCM_PACKAGE_COMPONENT_DEPENDENCIES) foreach(COMP_DEP IN LISTS ROCM_PACKAGE_COMPONENT_DEPENDENCIES) string(REGEX REPLACE "^(.*)->.*$" "\\1" _downstream "${COMP_DEP}") string(REGEX REPLACE "^.*->(.*)$" "\\1" _upstream "${COMP_DEP}") string(TOUPPER "${_upstream}" _upstream_uc) rocm_package_add_rpm_dependencies(COMPONENT "${_downstream}" DEPENDS "${CPACK_RPM_${_upstream_uc}_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}") rocm_package_add_deb_dependencies(COMPONENT "${_downstream}" DEPENDS "${CPACK_DEBIAN_${_upstream_uc}_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}") endforeach() endif() endmacro() macro(rocm_package_setup_component COMPONENT_NAME) set(options) set(oneValueArgs PACKAGE_NAME LIBRARY_NAME PARENT) set(multiValueArgs DEPENDS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) list(APPEND ROCM_PACKAGE_COMPONENTS ${COMPONENT_NAME}) if(DEFINED PARSE_PACKAGE_NAME) if(NOT DEFINED PARSE_LIBRARY_NAME) set(PARSE_LIBRARY_NAME "") endif() string(TOUPPER "${COMPONENT_NAME}" COMPONENT_GNAME) set(CPACK_DEBIAN_${COMPONENT_GNAME}_PACKAGE_NAME "${PARSE_LIBRARY_NAME}-${PARSE_PACKAGE_NAME}") set(CPACK_RPM_${COMPONENT_GNAME}_PACKAGE_NAME "${PARSE_LIBRARY_NAME}-${PARSE_PACKAGE_NAME}") endif() if(DEFINED PARSE_PARENT) list(APPEND ROCM_PACKAGE_COMPONENT_DEPENDENCIES "${PARSE_PARENT}->${COMPONENT_NAME}") endif() if(DEFINED PARSE_DEPENDS) cmake_parse_arguments(DEPENDS "" "" "COMMON;DEB;RPM;COMPONENT" ${PARSE_DEPENDS}) rocm_package_add_deb_dependencies(COMPONENT ${COMPONENT_NAME} DEPENDS ${DEPENDS_COMMON} ${DEPENDS_DEB}) rocm_package_add_rpm_dependencies(COMPONENT ${COMPONENT_NAME} DEPENDS ${DEPENDS_COMMON} ${DEPENDS_RPM}) foreach(DEP_COMP IN LISTS DEPENDS_COMPONENT) list(APPEND ROCM_PACKAGE_COMPONENT_DEPENDENCIES "${COMPONENT_NAME}->${DEP_COMP}") endforeach() endif() endmacro() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMDocs.cmake000077500000000000000000000011261473605615300253120ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### include_guard(GLOBAL) if(NOT TARGET doc) add_custom_target(doc) endif() function(rocm_mark_as_doc) add_dependencies(doc ${ARGN}) endfunction() function(rocm_clean_doc_output DIR) set_property( DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${DIR}") endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMDoxygenDoc.cmake000077500000000000000000000171071473605615300264730ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2021 Advanced Micro Devices, Inc. # ###################################################################################################################### include(CMakeParseArguments) include(ROCMDocs) find_program( DOXYGEN_EXECUTABLE NAMES doxygen PATH_SUFFIXES bin DOC "Doxygen documentation generator") mark_as_advanced(DOXYGEN_EXECUTABLE) find_path( DOT_EXECUTABLE NAMES dot PATH_SUFFIXES bin DOC "Graphviz") mark_as_advanced(DOT_EXECUTABLE) set(DOXYGEN_ARGS ABBREVIATE_BRIEF ALIASES ALLEXTERNALS ALLOW_UNICODE_NAMES ALPHABETICAL_INDEX ALWAYS_DETAILED_SEC AUTOLINK_SUPPORT BINARY_TOC BRIEF_MEMBER_DESC BUILTIN_STL_SUPPORT CALLER_GRAPH CALL_GRAPH CASE_SENSE_NAMES CHM_FILE CHM_INDEX_ENCODING CITE_BIB_FILES CLANG_ASSISTED_PARSING CLANG_OPTIONS CLASS_DIAGRAMS CLASS_GRAPH COLLABORATION_GRAPH COLS_IN_ALPHA_INDEX COMPACT_LATEX COMPACT_RTF CPP_CLI_SUPPORT CREATE_SUBDIRS DIAFILE_DIRS DIA_PATH DIRECTORY_GRAPH DISABLE_INDEX DISTRIBUTE_GROUP_DOC DOCBOOK_OUTPUT DOCBOOK_PROGRAMLISTING DOCSET_BUNDLE_ID DOCSET_FEEDNAME DOCSET_PUBLISHER_ID DOCSET_PUBLISHER_NAME DOTFILE_DIRS DOT_CLEANUP DOT_FONTNAME DOT_FONTPATH DOT_FONTSIZE DOT_GRAPH_MAX_NODES DOT_IMAGE_FORMAT DOT_MULTI_TARGETS DOT_NUM_THREADS # DOT_PATH DOT_TRANSPARENT DOXYFILE_ENCODING ECLIPSE_DOC_ID ENABLED_SECTIONS ENABLE_PREPROCESSING ENUM_VALUES_PER_LINE EXAMPLE_PATH EXAMPLE_PATTERNS EXAMPLE_RECURSIVE EXCLUDE EXCLUDE_PATTERNS EXCLUDE_SYMBOLS EXCLUDE_SYMLINKS EXPAND_AS_DEFINED EXPAND_ONLY_PREDEF EXTENSION_MAPPING EXTERNAL_GROUPS EXTERNAL_PAGES EXTERNAL_SEARCH EXTERNAL_SEARCH_ID EXTRACT_ALL EXTRACT_ANON_NSPACES EXTRACT_LOCAL_CLASSES EXTRACT_LOCAL_METHODS EXTRACT_PACKAGE EXTRACT_PRIVATE EXTRACT_STATIC EXTRA_PACKAGES EXTRA_SEARCH_MAPPINGS EXT_LINKS_IN_WINDOW FILE_PATTERNS FILE_VERSION_FILTER FILTER_PATTERNS FILTER_SOURCE_FILES FILTER_SOURCE_PATTERNS FORCE_LOCAL_INCLUDES FORMULA_FONTSIZE FORMULA_TRANSPARENT FULL_PATH_NAMES GENERATE_AUTOGEN_DEF GENERATE_BUGLIST GENERATE_CHI GENERATE_DEPRECATEDLIST GENERATE_DOCBOOK GENERATE_DOCSET GENERATE_ECLIPSEHELP GENERATE_HTML GENERATE_HTMLHELP GENERATE_LATEX GENERATE_LEGEND GENERATE_MAN GENERATE_PERLMOD GENERATE_QHP GENERATE_RTF GENERATE_TAGFILE GENERATE_TESTLIST GENERATE_TODOLIST GENERATE_TREEVIEW GENERATE_XML GRAPHICAL_HIERARCHY GROUP_GRAPHS GROUP_NESTED_COMPOUNDS # HAVE_DOT HHC_LOCATION HIDE_COMPOUND_REFERENCE HIDE_FRIEND_COMPOUNDS HIDE_IN_BODY_DOCS HIDE_SCOPE_NAMES HIDE_UNDOC_CLASSES HIDE_UNDOC_MEMBERS HIDE_UNDOC_RELATIONS HTML_COLORSTYLE_GAMMA HTML_COLORSTYLE_HUE HTML_COLORSTYLE_SAT HTML_DYNAMIC_SECTIONS HTML_EXTRA_FILES HTML_EXTRA_STYLESHEET HTML_FILE_EXTENSION HTML_FOOTER HTML_HEADER HTML_INDEX_NUM_ENTRIES HTML_OUTPUT HTML_STYLESHEET HTML_TIMESTAMP IDL_PROPERTY_SUPPORT IGNORE_PREFIX IMAGE_PATH INCLUDED_BY_GRAPH INCLUDE_FILE_PATTERNS INCLUDE_GRAPH INCLUDE_PATH INHERIT_DOCS INLINE_GROUPED_CLASSES INLINE_INFO INLINE_INHERITED_MEMB INLINE_SIMPLE_STRUCTS INLINE_SOURCES INPUT INPUT_ENCODING INPUT_FILTER INTERACTIVE_SVG INTERNAL_DOCS JAVADOC_AUTOBRIEF LATEX_BATCHMODE LATEX_BIB_STYLE LATEX_CMD_NAME LATEX_EXTRA_FILES LATEX_EXTRA_STYLESHEET LATEX_FOOTER LATEX_HEADER LATEX_HIDE_INDICES LATEX_OUTPUT LATEX_SOURCE_CODE LATEX_TIMESTAMP LAYOUT_FILE LOOKUP_CACHE_SIZE MACRO_EXPANSION MAKEINDEX_CMD_NAME MAN_EXTENSION MAN_LINKS MAN_OUTPUT MAN_SUBDIR MARKDOWN_SUPPORT MATHJAX_CODEFILE MATHJAX_EXTENSIONS MATHJAX_FORMAT MATHJAX_RELPATH MAX_DOT_GRAPH_DEPTH MAX_INITIALIZER_LINES MSCFILE_DIRS MSCGEN_PATH MULTILINE_CPP_IS_BRIEF OPTIMIZE_FOR_FORTRAN OPTIMIZE_OUTPUT_FOR_C OPTIMIZE_OUTPUT_JAVA OPTIMIZE_OUTPUT_VHDL OUTPUT_DIRECTORY OUTPUT_LANGUAGE PAPER_TYPE PDF_HYPERLINKS PERLMOD_LATEX PERLMOD_MAKEVAR_PREFIX PERLMOD_PRETTY PERL_PATH PLANTUML_CFG_FILE PLANTUML_INCLUDE_PATH PLANTUML_JAR_PATH PREDEFINED PROJECT_BRIEF PROJECT_LOGO PROJECT_NAME PROJECT_NUMBER QCH_FILE QHG_LOCATION QHP_CUST_FILTER_ATTRS QHP_CUST_FILTER_NAME QHP_NAMESPACE QHP_SECT_FILTER_ATTRS QHP_VIRTUAL_FOLDER QT_AUTOBRIEF QUIET RECURSIVE REFERENCED_BY_RELATION REFERENCES_LINK_SOURCE REFERENCES_RELATION REPEAT_BRIEF RTF_EXTENSIONS_FILE RTF_HYPERLINKS RTF_OUTPUT RTF_SOURCE_CODE RTF_STYLESHEET_FILE SEARCHDATA_FILE SEARCHENGINE SEARCHENGINE_URL SEARCH_INCLUDES SEPARATE_MEMBER_PAGES SERVER_BASED_SEARCH SHORT_NAMES SHOW_FILES SHOW_GROUPED_MEMB_INC SHOW_INCLUDE_FILES SHOW_NAMESPACES SHOW_USED_FILES SIP_SUPPORT SKIP_FUNCTION_MACROS SORT_BRIEF_DOCS SORT_BY_SCOPE_NAME SORT_GROUP_NAMES SORT_MEMBERS_CTORS_1ST SORT_MEMBER_DOCS SOURCE_BROWSER SOURCE_TOOLTIPS STRICT_PROTO_MATCHING STRIP_CODE_COMMENTS STRIP_FROM_INC_PATH STRIP_FROM_PATH SUBGROUPING TAB_SIZE TAGFILES TCL_SUBST TEMPLATE_RELATIONS TOC_EXPAND TOC_INCLUDE_HEADINGS TREEVIEW_WIDTH TYPEDEF_HIDES_STRUCT UML_LIMIT_NUM_FIELDS UML_LOOK USE_HTAGS USE_MATHJAX USE_MDFILE_AS_MAINPAGE USE_PDFLATEX VERBATIM_HEADERS WARNINGS WARN_AS_ERROR WARN_FORMAT WARN_IF_DOC_ERROR WARN_IF_UNDOCUMENTED WARN_LOGFILE WARN_NO_PARAMDOC XML_OUTPUT XML_PROGRAMLISTING) set(DOXYGEN_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/doxygen/doxygen.conf" CACHE PATH "Path to generated doxygen configuration file") function(rocm_add_doxygen_doc) set(options) set(oneValueArgs) set(multiValueArgs DEPENDS ${DOXYGEN_ARGS}) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) file(WRITE ${DOXYGEN_CONFIG_FILE} "# Auto-generated doxygen configuration file\n") if(NOT PARSE_STRIP_FROM_PATH) set(PARSE_STRIP_FROM_PATH ${CMAKE_SOURCE_DIR}) endif() foreach(ARG ${DOXYGEN_ARGS}) if(PARSE_${ARG}) string(REPLACE ";" " " ARG_VALUE "${PARSE_${ARG}}") file(APPEND ${DOXYGEN_CONFIG_FILE} "\n${ARG} = ${ARG_VALUE}\n") endif() endforeach() if(PARSE_OUTPUT_DIRECTORY) if(NOT EXISTS ${PARSE_OUTPUT_DIRECTORY}) file(MAKE_DIRECTORY ${PARSE_OUTPUT_DIRECTORY}) endif() endif() if(DOT_EXECUTABLE) file(APPEND ${DOXYGEN_CONFIG_FILE} "\nDOT_PATH = \"${DOT_EXECUTABLE}\"\n") file(APPEND ${DOXYGEN_CONFIG_FILE} "\nHAVE_DOT = YES\n") else() file(APPEND ${DOXYGEN_CONFIG_FILE} "\nHAVE_DOT = NO\n") endif() add_custom_target( doxygen ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIG_FILE} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Building documentation with doxygen") if(PARSE_OUTPUT_DIRECTORY) rocm_clean_doc_output(${PARSE_OUTPUT_DIRECTORY}) endif() rocm_mark_as_doc(doxygen) if(PARSE_DEPENDS) add_dependencies(doxygen ${PARSE_DEPENDS}) endif() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMHeaderWrapper.cmake000066400000000000000000000156271473605615300271630ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2022 Advanced Micro Devices, Inc. # ###################################################################################################################### set(ROCM_WRAPPER_TEMPLATE_HEADER "${CMAKE_CURRENT_LIST_DIR}/header_template.h.in" CACHE INTERNAL "Path to wrapper header file template.") function(rocm_wrap_header_dir DIRECTORY) set(options ) set(oneValueArgs HEADER_LOCATION INCLUDE_LOCATION) set(multiValueArgs PATTERNS GUARDS WRAPPER_LOCATIONS OUTPUT_LOCATIONS ORIGINAL_FILES) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT PARSE_HEADER_LOCATION) set(PARSE_HEADER_LOCATION "include/${CMAKE_PROJECT_NAME}") endif() if(NOT PARSE_INCLUDE_LOCATION) set(PARSE_INCLUDE_LOCATION "include") endif() if(NOT PARSE_PATTERNS) set(PARSE_PATTERNS "*.h;*.hpp;*.hh;*.hxx;*.inl") endif() if(NOT DEFINED PARSE_ORIGINAL_FILES) set(PARSE_ORIGINAL_FILES) endif() foreach(PATTERN IN LISTS PARSE_PATTERNS) list(APPEND QUALIFIED_PATTERNS "${DIRECTORY}/${PATTERN}") endforeach() file (GLOB_RECURSE include_files RELATIVE "${DIRECTORY}" ${QUALIFIED_PATTERNS}) foreach (include_file ${include_files}) rocm_wrap_header_file( ${include_file} GUARDS ${PARSE_GUARDS} HEADER_LOCATION ${PARSE_HEADER_LOCATION} INCLUDE_LOCATION ${PARSE_INCLUDE_LOCATION} WRAPPER_LOCATIONS ${PARSE_WRAPPER_LOCATIONS} OUTPUT_LOCATIONS ${PARSE_OUTPUT_LOCATIONS} ORIGINAL_FILES ${PARSE_ORIGINAL_FILES} ) endforeach() endfunction() function(rocm_wrap_header_file) set(options ) set(oneValueArgs HEADER_LOCATION INCLUDE_LOCATION) set(multiValueArgs GUARDS WRAPPER_LOCATIONS OUTPUT_LOCATIONS HEADERS ORIGINAL_FILES) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(PARSE_HEADERS ${PARSE_HEADERS} ${PARSE_UNPARSED_ARGUMENTS}) if(NOT PARSE_HEADER_LOCATION) set(PARSE_HEADER_LOCATION "include/${CMAKE_PROJECT_NAME}") endif() if(NOT PARSE_INCLUDE_LOCATION) set(PARSE_INCLUDE_LOCATION "include") endif() if(NOT DEFINED PARSE_ORIGINAL_FILES) set(PARSE_ORIGINAL_FILES) endif() foreach(INCLUDE_FILE IN LISTS PARSE_HEADERS) get_filename_component(INCLUDE_FILE_NAME "${INCLUDE_FILE}" NAME) set(original_contents "") foreach(ORIGINAL_FILE IN LISTS PARSE_ORIGINAL_FILES) get_filename_component(ORIGINAL_FILE_NAME "${ORIGINAL_FILE}" NAME) if(INCLUDE_FILE_NAME STREQUAL ORIGINAL_FILE_NAME) file(READ ${ORIGINAL_FILE} file_contents) set(original_contents_section "#if 0 /* The following is a copy of the original file for the benefit of build systems which grep for values * in this file rather than preprocess it. This is just for backward compatibility */ ${file_contents} #endif") endif() endforeach() set(GUARD_LIST ${PARSE_GUARDS}) set(WRAPPER_LOC_LIST ${PARSE_WRAPPER_LOCATIONS}) set(OUTPUT_LOC_LIST ${PARSE_OUTPUT_LOCATIONS}) if(CPACK_PACKAGING_INSTALL_PREFIX) set(HEADER_INSTALL_PREFIX "${CPACK_PACKAGING_INSTALL_PREFIX}") elseif(CMAKE_INSTALL_PREFIX) set(HEADER_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") else() if(NOT WIN32) set(HEADER_INSTALL_PREFIX "/usr/local") else() set(HEADER_INSTALL_PREFIX "c:/Program Files/${PROJECT_NAME}") endif() endif() get_filename_component(header_location "${PARSE_HEADER_LOCATION}/${INCLUDE_FILE}" ABSOLUTE BASE_DIR "${HEADER_INSTALL_PREFIX}") get_filename_component(file_name ${INCLUDE_FILE} NAME) get_filename_component(file_path ${INCLUDE_FILE} DIRECTORY) file(RELATIVE_PATH correct_include "${HEADER_INSTALL_PREFIX}/${PARSE_INCLUDE_LOCATION}" "${header_location}") string(REPLACE "/" ";" path_dirs "${file_path}") if (NOT DEFINED ROCM_HEADER_WRAPPER_WERROR) if (DEFINED ENV{ROCM_HEADER_WRAPPER_WERROR}) set(ROCM_HEADER_WRAPPER_WERROR "$ENV{ROCM_HEADER_WRAPPER_WERROR}" CACHE STRING "Wrapper header files emit error instead of warning.") else() set(ROCM_HEADER_WRAPPER_WERROR "OFF" CACHE STRING "Wrapper header files emit error instead of warning.") endif() endif() if (ROCM_HEADER_WRAPPER_WERROR) set(deprecated_error 1) else() set(deprecated_error 0) endif() set(guard_common "") foreach(subdir IN LISTS path_dirs) if(NOT (subdir STREQUAL '' OR subdir STREQUAL '.')) string(TOUPPER ${subdir} subdir_uc) set(guard_common "${guard_common}_${subdir_uc}") endif() endforeach() string(REGEX REPLACE "[^A-Za-z0-9_]" "_" guard_common "${guard_common}_${file_name}") string(TOUPPER ${guard_common} guard_common) # do-while set(first_time true) while(first_time OR GUARD_LIST OR WRAPPER_LOC_LIST OR OUTPUT_LOC_LIST) rocm_wrap_header_get_info(ITEM GUARD_LIST WRAPPER_LOC_LIST OUTPUT_LOC_LIST) set(include_guard "ROCM_${ITEM_GUARD}${guard_common}") set(wrapper_location "${ITEM_WRAPPER_LOCATION}/${file_path}") file(RELATIVE_PATH file_rel_path "${wrapper_location}" "${header_location}") configure_file( "${ROCM_WRAPPER_TEMPLATE_HEADER}" "${ITEM_OUTPUT_LOCATION}/${INCLUDE_FILE}" ) set(first_time false) endwhile() endforeach() endfunction() # internal macro(rocm_wrap_header_get_info OUTPUT_PREFIX GUARDS_LIST WRAPPER_LOC_LIST OUTPUT_LOC_LIST) if(${GUARDS_LIST}) list(GET ${GUARDS_LIST} 0 ${OUTPUT_PREFIX}_GUARD) list(REMOVE_AT ${GUARDS_LIST} 0) else() set(${OUTPUT_PREFIX}_GUARD WRAPPER) endif() if(${WRAPPER_LOC_LIST}) list(GET ${WRAPPER_LOC_LIST} 0 ${OUTPUT_PREFIX}_WRAPPER_LOCATION) list(REMOVE_AT ${WRAPPER_LOC_LIST} 0) else() set(${OUTPUT_PREFIX}_WRAPPER_LOCATION "${CMAKE_PROJECT_NAME}/include") endif() if(${OUTPUT_LOC_LIST}) list(GET ${OUTPUT_LOC_LIST} 0 ${OUTPUT_PREFIX}_OUTPUT_LOCATION) list(REMOVE_AT ${OUTPUT_LOC_LIST} 0) else() set(${OUTPUT_PREFIX}_OUTPUT_LOCATION ${CMAKE_BINARY_DIR}/${${OUTPUT_PREFIX}_WRAPPER_LOCATION}) endif() get_filename_component(${OUTPUT_PREFIX}_WRAPPER_LOCATION "${${OUTPUT_PREFIX}_WRAPPER_LOCATION}" ABSOLUTE BASE_DIR "${HEADER_INSTALL_PREFIX}") get_filename_component(${OUTPUT_PREFIX}_OUTPUT_LOCATION "${${OUTPUT_PREFIX}_OUTPUT_LOCATION}" ABSOLUTE BASE_DIR "${PROJECT_BINARY_DIR}") endmacro() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMInstallSymlinks.cmake000066400000000000000000000026111473605615300275570ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### function(rocm_install_symlink_subdir SUBDIR) # TODO: Check if SUBDIR is relative path Copy instead of symlink on windows if(CMAKE_HOST_WIN32) set(SYMLINK_CMD "file(COPY \${SRC} DESTINATION \${DEST_DIR})") else() set(SYMLINK_CMD "execute_process(COMMAND ln -sf \${SRC_REL} \${DEST})") endif() set(INSTALL_CMD " set(SUBDIR \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${SUBDIR}) file(GLOB_RECURSE FILES RELATIVE \${SUBDIR} \${SUBDIR}/*) foreach(FILE \${FILES}) set(SRC \${SUBDIR}/\${FILE}) set(DEST \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${FILE}) get_filename_component(DEST_DIR \${DEST} DIRECTORY) file(MAKE_DIRECTORY \${DEST_DIR}) file(RELATIVE_PATH SRC_REL \${DEST_DIR} \${SRC}) message(STATUS \"symlink: \${SRC_REL} -> \${DEST}\") ${SYMLINK_CMD} endforeach() ") if(ARGC GREATER 1) rocm_install(CODE "${INSTALL_CMD}" COMPONENT "${ARGV1}") else() install(CODE "${INSTALL_CMD}") rocm_install(CODE "${INSTALL_CMD}") endif() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake000066400000000000000000000444011473605615300273620ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### cmake_policy(SET CMP0057 NEW) # todo: consolidate with duplicate in ROCMCreatePackage.cmake # Default libdir to "lib", this skips GNUInstallDirs from trying to take a guess if it's unset: set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory") include(CMakeParseArguments) include(GNUInstallDirs) include(ROCMPackageConfigHelpers) include(ROCMProperty) set(ROCM_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) set(ROCM_USE_DEV_COMPONENT ON CACHE BOOL "Generate a devel package?") rocm_define_property(TARGET "ROCM_INSTALL_DIR" "Install dir for target") function(rocm_set_install_dir_property) set(options) set(oneValueArgs DESTINATION RUNTIME_DESTINATION ARCHIVE_DESTINATION LIBRARY_DESTINATION) set(multiValueArgs TARGETS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message( FATAL_ERROR "Unknown keywords given to rocm_set_install_dir_property(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() set(RUNTIME_DESTINATION ${PARSE_DESTINATION}) if(PARSE_RUNTIME_DESTINATION) set(RUNTIME_DESTINATION ${PARSE_RUNTIME_DESTINATION}) endif() set(ARCHIVE_DESTINATION ${PARSE_DESTINATION}) if(PARSE_ARCHIVE_DESTINATION) set(ARCHIVE_DESTINATION ${PARSE_ARCHIVE_DESTINATION}) endif() set(LIBRARY_DESTINATION ${PARSE_DESTINATION}) if(PARSE_LIBRARY_DESTINATION) set(LIBRARY_DESTINATION ${PARSE_LIBRARY_DESTINATION}) endif() foreach(TARGET ${PARSE_TARGETS}) get_target_property(TARGET_TYPE ${TARGET} TYPE) set(DESTINATION ${PARSE_DESTINATION}) if(TARGET_TYPE STREQUAL "EXECUTABLE") set(DESTINATION ${RUNTIME_DESTINATION}) elseif(TARGET_TYPE STREQUAL "STATIC_LIBRARY") set(DESTINATION ${ARCHIVE_DESTINATION}) elseif(TARGET_TYPE MATCHES "LIBRARY") set(DESTINATION ${PARSE_LIBRARY_DESTINATION}) endif() # Interface targets dont have an install dir if(NOT TARGET_TYPE STREQUAL "INTERFACE_LIBRARY") if(DESTINATION MATCHES "^/|$") set_target_properties(${TARGET} PROPERTIES ROCM_INSTALL_DIR ${DESTINATION}) else() set_target_properties(${TARGET} PROPERTIES ROCM_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${DESTINATION}) endif() endif() endforeach() endfunction() function(rocm_install) if(ARGV0 STREQUAL "TARGETS") # rocm_install_targets deals with the component in its own fashion. rocm_install_targets("${ARGN}") elseif(NOT ROCM_USE_DEV_COMPONENT) # If we want legacy behaviour, directly call install with no meddling. install(${ARGN}) else() # We want to define the COMPONENT argument in the correct position, only if the user did not define # the COMPONENT argument. Therefore, capture the component argument and any arguments which can # legally follow it, so we can place those after the inserted COMPONENT argument. set(options OPTIONAL EXCLUDE_FROM_ALL) set(oneValueArgs COMPONENT RENAME) # Specifying all valid first arguments as multiValueArgs captures all arguments between the first argument # and the COMPONENT argument (or any argument which can follow COMPONENT) in order. set(multiValueArgs FILES PROGRAMS DIRECTORY CODE SCRIPT EXPORT FILES_MATCHING) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_COMPONENT) # The user specified the component, so don't do anything. install(${ARGN}) return() endif() set(INSTALL_ARGS "${ARGV0};" "${PARSE_FILES}" "${PARSE_PROGRAMS}" "${PARSE_DIRECTORY}" "${PARSE_CODE}" "${PARSE_SCRIPT}" "${PARSE_EXPORT}") set(RUNTIME_MODES "PROGRAMS") if(PARSE_COMPONENT) list(APPEND INSTALL_ARGS COMPONENT "${PARSE_COMPONENT}") elseif(NOT ARGV0 IN_LIST RUNTIME_MODES) list(APPEND INSTALL_ARGS COMPONENT devel) endif() if(PARSE_RENAME) list(APPEND INSTALL_ARGS RENAME "${PARSE_RENAME}") endif() if(PARSE_OPTIONAL) list(APPEND INSTALL_ARGS OPTIONAL) endif() if(PARSE_EXCLUDE_FROM_ALL) list(APPEND INSTALL_ARGS EXCLUDE_FROM_ALL) endif() if(PARSE_FILES_MATCHING) list(APPEND INSTALL_ARGS FILES_MATCHING "${PARSE_FILES_MATCHING}") endif() install(${INSTALL_ARGS}) endif() endfunction() option(ROCM_SYMLINK_LIBS "Create backwards compatibility symlink for library files." OFF) function(rocm_install_targets) set(options PRIVATE) set(oneValueArgs PREFIX EXPORT COMPONENT) set(multiValueArgs TARGETS INCLUDE) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) set(EXPORT_FILE ${PROJECT_NAME_LOWER}-targets) if(PARSE_EXPORT) set(EXPORT_FILE ${PARSE_EXPORT}) endif() if(PARSE_PREFIX) set(PREFIX_DIR ${PARSE_PREFIX}) if(PARSE_PRIVATE) set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/bin) set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/lib) set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/include) else() set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_BINDIR}) set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}) set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) endif() elseif(ENABLE_ASAN_PACKAGING) if(PARSE_PRIVATE) set(BIN_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/bin) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/lib) set(INCLUDE_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/include) else() set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/asan) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan) set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) endif() else() if(PARSE_PRIVATE) set(BIN_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/bin) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/lib) set(INCLUDE_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/include) else() set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}) set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) endif() endif() foreach(TARGET ${PARSE_TARGETS}) foreach(INCLUDE ${PARSE_INCLUDE}) get_filename_component(INCLUDE_PATH ${INCLUDE} ABSOLUTE) target_include_directories(${TARGET} INTERFACE $) get_target_property(TARGET_TYPE ${TARGET} TYPE) if(NOT "${TARGET_TYPE}" STREQUAL "INTERFACE_LIBRARY") target_include_directories(${TARGET} PRIVATE ${INCLUDE_PATH}) endif() endforeach() target_include_directories(${TARGET} INTERFACE $/include>) endforeach() set(runtime "runtime") set(development "runtime") if(PARSE_COMPONENT) set(runtime "${PARSE_COMPONENT}") set(development "${PARSE_COMPONENT}") elseif(ROCM_USE_DEV_COMPONENT) set(development "devel") endif() foreach(INCLUDE ${PARSE_INCLUDE}) install( DIRECTORY ${INCLUDE}/ DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT ${development} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.hh" PATTERN "*.hxx" PATTERN "*.inl") endforeach() foreach(TARGET IN LISTS PARSE_TARGETS) get_target_property(T_TYPE ${TARGET} TYPE) if(NOT T_TYPE STREQUAL "INTERFACE_LIBRARY") set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib") if(PARSE_PRIVATE) # Adding RPATH to private binaries to point to public libraries. set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../") else() # Adding RPATH to public binaries to point to private libraries. set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib/${PROJECT_NAME}/lib") endif() endif() set(export_arg EXPORT ${EXPORT_FILE}) if(T_TYPE STREQUAL "EXECUTABLE") unset(export_arg) endif() install( TARGETS ${TARGET} ${export_arg} RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT ${runtime} LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${runtime} NAMELINK_SKIP ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${development} ) rocm_set_install_dir_property( TARGETS ${TARGET} RUNTIME_DESTINATION ${BIN_INSTALL_DIR} LIBRARY_DESTINATION ${LIB_INSTALL_DIR} ARCHIVE_DESTINATION ${LIB_INSTALL_DIR} ) if(T_TYPE STREQUAL "SHARED_LIBRARY") install( TARGETS ${TARGET} EXPORT ${EXPORT_FILE} LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT ${development} NAMELINK_ONLY ) endif() if(ROCM_SYMLINK_LIBS AND PARSE_PRIVATE) message(WARNING "ROCM_SYMLINK_LIBS is not supported with PRIVATE.") endif() if(ROCM_SYMLINK_LIBS AND NOT PARSE_PRIVATE AND NOT WIN32 AND T_TYPE MATCHES ".*_LIBRARY" AND NOT T_TYPE STREQUAL "INTERFACE_LIBRARY") string(TOLOWER "${PROJECT_NAME}" LINK_SUBDIR) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_symlink.cmake CONTENT " set(SRC_DIR \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}) set(LINK_DIR \${SRC_DIR}/${LINK_SUBDIR}) if(NOT EXISTS \${LINK_DIR}/${ROCM_INSTALL_LIBDIR}) file(MAKE_DIRECTORY \${LINK_DIR}/${ROCM_INSTALL_LIBDIR}) endif() file(RELATIVE_PATH LINK_PATH \${LINK_DIR}/${ROCM_INSTALL_LIBDIR} \${SRC_DIR}/${ROCM_INSTALL_LIBDIR}) if(NOT EXISTS \${LINK_DIR}/${ROCM_INSTALL_LIBDIR}/$) execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink \${LINK_PATH}/$ \${LINK_DIR}/${ROCM_INSTALL_LIBDIR}/$ ) endif() ") rocm_install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_symlink.cmake") endif() endforeach() endfunction() set(_rocm_tmp_list_marker "@@__rocm_tmp_list_marker__@@") function(rocm_list_split LIST ELEMENT OUTPUT_LIST) string(REPLACE ";" ${_rocm_tmp_list_marker} TMPLIST "${${LIST}}") string(REPLACE "${_rocm_tmp_list_marker}${ELEMENT}${_rocm_tmp_list_marker}" ";" TMPLIST "${TMPLIST}") string(REPLACE "${ELEMENT}${_rocm_tmp_list_marker}" "" TMPLIST "${TMPLIST}") string(REPLACE "${_rocm_tmp_list_marker}${ELEMENT}" "" TMPLIST "${TMPLIST}") set(LIST_PREFIX _rocm_list_split_${OUTPUT_LIST}_SUBLIST) set(count 0) set(result) foreach(SUBLIST ${TMPLIST}) string(REPLACE ${_rocm_tmp_list_marker} ";" TMPSUBLIST "${SUBLIST}") math(EXPR count "${count}+1") set(list_var ${LIST_PREFIX}_${count}) set(${list_var} "${TMPSUBLIST}" PARENT_SCOPE) list(APPEND result ${LIST_PREFIX}_${count}) endforeach() set(${OUTPUT_LIST} "${result}" PARENT_SCOPE) endfunction() function(rocm_write_package_template_function FILENAME NAME) string(REPLACE ";" " " ARGS "${ARGN}") file( APPEND ${FILENAME} " ${NAME}(${ARGS}) ") endfunction() function(rocm_write_package_deps CONFIG_TEMPLATE) set(DEPENDS ${ARGN}) rocm_list_split(DEPENDS PACKAGE DEPENDS_LIST) foreach(DEPEND ${DEPENDS_LIST}) rocm_write_package_template_function(${CONFIG_TEMPLATE} find_dependency ${${DEPEND}}) endforeach() endfunction() function(rocm_export_targets) set(options) set(oneValueArgs NAMESPACE EXPORT NAME COMPATIBILITY PREFIX) set(multiValueArgs TARGETS DEPENDS INCLUDE STATIC_DEPENDS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(PACKAGE_NAME ${PROJECT_NAME}) if(PARSE_NAME) set(PACKAGE_NAME ${PARSE_NAME}) endif() string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) string(TOLOWER ${PACKAGE_NAME} PACKAGE_NAME_LOWER) set(TARGET_FILE ${PACKAGE_NAME_LOWER}-targets) if(PARSE_EXPORT) set(TARGET_FILE ${PARSE_EXPORT}) endif() set(CONFIG_NAME ${PACKAGE_NAME_LOWER}-config) set(TARGET_VERSION ${PROJECT_VERSION}) if(PARSE_PREFIX) set(PREFIX_DIR ${PARSE_PREFIX}) set(PREFIX_ARG PREFIX ${PREFIX_DIR}) set(BIN_INSTALL_DIR ${PREFIX_DIR}/${CMAKE_INSTALL_BINDIR}) set(LIB_INSTALL_DIR ${PREFIX_DIR}/${ROCM_INSTALL_LIBDIR}) set(INCLUDE_INSTALL_DIR ${PREFIX_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) else() set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}) set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) endif() set(CONFIG_PACKAGE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/${PACKAGE_NAME_LOWER}) set(CONFIG_TEMPLATE "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME_LOWER}-config.cmake.in") set(INCLUDED_FILES "") file( WRITE ${CONFIG_TEMPLATE} " @PACKAGE_INIT@ ") foreach(NAME ${PACKAGE_NAME} ${PACKAGE_NAME_UPPER} ${PACKAGE_NAME_LOWER}) rocm_write_package_template_function(${CONFIG_TEMPLATE} set_and_check ${NAME}_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") rocm_write_package_template_function(${CONFIG_TEMPLATE} set_and_check ${NAME}_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@") endforeach() rocm_write_package_template_function(${CONFIG_TEMPLATE} set_and_check ${PACKAGE_NAME}_TARGET_FILE "@PACKAGE_CONFIG_PACKAGE_INSTALL_DIR@/${TARGET_FILE}.cmake") if(PARSE_DEPENDS) rocm_write_package_deps(${CONFIG_TEMPLATE} ${PARSE_DEPENDS}) endif() if(PARSE_STATIC_DEPENDS AND NOT BUILD_SHARED_LIBS) rocm_write_package_deps(${CONFIG_TEMPLATE} ${PARSE_STATIC_DEPENDS}) endif() foreach(INCLUDE ${PARSE_INCLUDE}) rocm_install(FILES ${INCLUDE} DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR}) get_filename_component(INCLUDE_BASE ${INCLUDE} NAME) list(APPEND INCLUDED_FILES ${INCLUDE_BASE}) rocm_write_package_template_function(${CONFIG_TEMPLATE} include "\${CMAKE_CURRENT_LIST_DIR}/${INCLUDE_BASE}") endforeach() if(PARSE_TARGETS) rocm_write_package_template_function(${CONFIG_TEMPLATE} include "\${${PACKAGE_NAME}_TARGET_FILE}") foreach(NAME ${PACKAGE_NAME} ${PACKAGE_NAME_UPPER} ${PACKAGE_NAME_LOWER}) rocm_write_package_template_function(${CONFIG_TEMPLATE} set ${NAME}_LIBRARIES ${PARSE_TARGETS}) rocm_write_package_template_function(${CONFIG_TEMPLATE} set ${NAME}_LIBRARY ${PARSE_TARGETS}) endforeach() endif() rocm_configure_package_config_file( ${CONFIG_TEMPLATE} ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}.cmake INSTALL_DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR} ${PREFIX_ARG} PATH_VARS LIB_INSTALL_DIR INCLUDE_INSTALL_DIR CONFIG_PACKAGE_INSTALL_DIR) set(COMPATIBILITY_ARG SameMajorVersion) if(PARSE_COMPATIBILITY) set(COMPATIBILITY_ARG ${PARSE_COMPATIBILITY}) endif() write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}-version.cmake VERSION ${TARGET_VERSION} COMPATIBILITY ${COMPATIBILITY_ARG}) set(NAMESPACE_ARG) if(PARSE_NAMESPACE) set(NAMESPACE_ARG "NAMESPACE;${PARSE_NAMESPACE}") endif() rocm_install( EXPORT ${TARGET_FILE} DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR} ${NAMESPACE_ARG}) rocm_install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}-version.cmake DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR}) if(ROCM_SYMLINK_LIBS AND NOT WIN32) string(TOLOWER "${PROJECT_NAME}" LINK_SUBDIR) file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmake_symlink.cmake" CONTENT " set(SRC_DIR \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CONFIG_PACKAGE_INSTALL_DIR}) set(LINK_DIR \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${LINK_SUBDIR}/${ROCM_INSTALL_LIBDIR}/cmake) set(INCLUDED_FILES \"${INCLUDED_FILES}\") if(NOT EXISTS \${LINK_DIR}) file(MAKE_DIRECTORY \${LINK_DIR}) endif() file(GLOB TARGET_FILES LIST_DIRECTORIES false RELATIVE \${SRC_DIR} \${SRC_DIR}/${TARGET_FILE}*.cmake ) foreach(filename ${CONFIG_NAME}.cmake ${CONFIG_NAME}-version.cmake \${TARGET_FILES} \${INCLUDED_FILES}) file(RELATIVE_PATH LINK_PATH \${LINK_DIR} \${SRC_DIR}/\${filename}) if(NOT EXISTS \${LINK_DIR}/\${filename}) execute_process(COMMAND \${CMAKE_COMMAND} -E create_symlink \${LINK_PATH} \${LINK_DIR}/\${filename} ) endif() endforeach() ") rocm_install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/cmake_symlink.cmake") endif() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMPackageConfigHelpers.cmake000066400000000000000000000124021473605615300304220ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### include(CMakePackageConfigHelpers) function(rocm_configure_package_config_file INPUT_FILE OUTPUT_FILE) set(options) set(oneValueArgs INSTALL_DESTINATION PREFIX) set(multiValueArgs PATH_VARS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message( FATAL_ERROR "Unknown keywords given to rocm_configure_package_config_file(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() if(NOT PARSE_INSTALL_DESTINATION) message(FATAL_ERROR "INSTALL_DESTINATION is required for rocm_configure_package_config_file()") endif() if(IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}") set(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") else() get_filename_component(INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) endif() if(IS_ABSOLUTE "${PARSE_INSTALL_DESTINATION}") set(ABSOLUTE_INSTALL_DIR "${PARSE_INSTALL_DESTINATION}") else() set(ABSOLUTE_INSTALL_DIR "${INSTALL_PREFIX}/${PARSE_INSTALL_DESTINATION}") endif() file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${ABSOLUTE_INSTALL_DIR}" "${INSTALL_PREFIX}") file(RELATIVE_PATH PACKAGE_INSTALL_RELATIVE_DIR "${INSTALL_PREFIX}" "${ABSOLUTE_INSTALL_DIR}") set(CHECK_PREFIX) if(PARSE_PREFIX) # On windows there is no symlinks if(WIN32) set(CHECK_PREFIX " if(NOT \"\${PACKAGE_PREFIX_DIR}/${PACKAGE_INSTALL_RELATIVE_DIR}\" EQUAL \"\${CMAKE_CURRENT_LIST_DIR}\") set(PACKAGE_PREFIX_DIR ${INSTALL_PREFIX}) endif() ") endif() endif() foreach(_var ${PARSE_PATH_VARS}) if(NOT DEFINED ${_var}) message(FATAL_ERROR "Undefined path variable: ${_var}") endif() if(IS_ABSOLUTE "${${_var}}") string(REPLACE "${INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" PACKAGE_${_var} "${${_var}}") else() set(PACKAGE_${_var} "\${PACKAGE_PREFIX_DIR}/${${_var}}") endif() endforeach() get_filename_component(INPUT_NAME "${INPUT_FILE}" NAME) set(PACKAGE_INIT " #################################################################################### # Auto generated @PACKAGE_INIT@ by rocm_configure_package_config_file() # from ${INPUT_NAME} # Any changes to this file will be overwritten by the next CMake run #################################################################################### get_filename_component(_ROCM_CMAKE_CURRENT_LIST_FILE_REAL \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH) get_filename_component(_ROCM_CMAKE_CURRENT_LIST_DIR_REAL \"\${_ROCM_CMAKE_CURRENT_LIST_FILE_REAL}\" DIRECTORY) get_filename_component(PACKAGE_PREFIX_DIR \"\${_ROCM_CMAKE_CURRENT_LIST_DIR_REAL}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE) ${CHECK_PREFIX} macro(set_and_check _var _file) set(\${_var} \"\${_file}\") if(NOT EXISTS \"\${_file}\") message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\") endif() endmacro() include(CMakeFindDependencyMacro OPTIONAL RESULT_VARIABLE _ROCMCMakeFindDependencyMacro_FOUND) if (NOT _ROCMCMakeFindDependencyMacro_FOUND) macro(find_dependency dep) if (NOT \${dep}_FOUND) set(rocm_fd_version) if (\${ARGC} GREATER 1) set(rocm_fd_version \${ARGV1}) endif() set(rocm_fd_exact_arg) if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT) set(rocm_fd_exact_arg EXACT) endif() set(rocm_fd_quiet_arg) if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY) set(rocm_fd_quiet_arg QUIET) endif() set(rocm_fd_required_arg) if(\${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED) set(rocm_fd_required_arg REQUIRED) endif() find_package(\${dep} \${rocm_fd_version} \${rocm_fd_exact_arg} \${rocm_fd_quiet_arg} \${rocm_fd_required_arg} ) string(TOUPPER \${dep} cmake_dep_upper) if (NOT \${dep}_FOUND AND NOT \${cmake_dep_upper}_FOUND) set(\${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE \"\${CMAKE_FIND_PACKAGE_NAME} could not be found because dependency \${dep} could not be found.\") set(\${CMAKE_FIND_PACKAGE_NAME}_FOUND False) return() endif() set(rocm_fd_version) set(rocm_fd_required_arg) set(rocm_fd_quiet_arg) set(rocm_fd_exact_arg) endif() endmacro() endif() macro(check_required_components _NAME) foreach(comp \${\${_NAME}_FIND_COMPONENTS}) if(NOT \${_NAME}_\${comp}_FOUND) if(\${_NAME}_FIND_REQUIRED_\${comp}) set(\${_NAME}_FOUND FALSE) endif() endif() endforeach() endmacro() #################################################################################### ") configure_file("${INPUT_FILE}" "${OUTPUT_FILE}" @ONLY) endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMProperty.cmake000066400000000000000000000007541473605615300262510ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### function(rocm_define_property SCOPE NAME DOC) if(NOT CMAKE_SCRIPT_MODE_FILE) define_property(${SCOPE} PROPERTY "${NAME}" BRIEF_DOCS "${DOC}" FULL_DOCS "${DOC}") endif() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMSetupVersion.cmake000066400000000000000000000132571473605615300270750ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### macro(rocm_set_parent VAR) set(${VAR} ${ARGN} PARENT_SCOPE) set(${VAR} ${ARGN}) endmacro() find_program(GIT NAMES git) function(rocm_get_rev_count OUTPUT_COUNT) set(options) set(oneValueArgs DIRECTORY) set(multiValueArgs REV) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) if(PARSE_DIRECTORY) set(DIRECTORY ${PARSE_DIRECTORY}) endif() set(_count 0) if(GIT) execute_process( COMMAND git rev-list --count ${PARSE_REV} WORKING_DIRECTORY ${DIRECTORY} OUTPUT_VARIABLE REV_COUNT OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE RESULT ERROR_QUIET) if(${RESULT} EQUAL 0) set(_count ${REV_COUNT}) endif() endif() rocm_set_parent(${OUTPUT_COUNT} ${_count}) endfunction() function(rocm_get_commit_count OUTPUT_COUNT) set(options) set(oneValueArgs PARENT DIRECTORY) set(multiValueArgs) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) if(PARSE_DIRECTORY) set(DIRECTORY ${PARSE_DIRECTORY}) endif() rocm_get_rev_count( ALL_COUNT DIRECTORY ${DIRECTORY} REV HEAD) set(_count ${ALL_COUNT}) if(PARSE_PARENT) rocm_get_rev_count( PARENT_COUNT DIRECTORY ${DIRECTORY} REV HEAD ^${PARSE_PARENT}) set(_count ${PARENT_COUNT}) endif() rocm_set_parent(${OUTPUT_COUNT} ${_count}) endfunction() function(rocm_get_build_info OUTPUT DELIM) set(_info) if(DEFINED ENV{ROCM_BUILD_ID}) set(_info ${_info}${DELIM}$ENV{ROCM_BUILD_ID}) endif() rocm_set_parent(${OUTPUT} ${_info}) endfunction() function(rocm_version_regex_parse REGEX OUTPUT_VARIABLE INPUT) string(REGEX REPLACE ${REGEX} "\\1" OUTPUT "${INPUT}") if("${OUTPUT}" STREQUAL "${INPUT}") rocm_set_parent(${OUTPUT_VARIABLE} 0) else() rocm_set_parent(${OUTPUT_VARIABLE} ${OUTPUT}) endif() endfunction() function(rocm_get_git_commit_tag OUTPUT_VERSION) set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) if(GIT) set(GIT_COMMAND ${GIT} describe --dirty --long --match [0-9]*) execute_process( COMMAND ${GIT_COMMAND} WORKING_DIRECTORY ${DIRECTORY} OUTPUT_VARIABLE GIT_TAG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE RESULT ERROR_QUIET) if(${RESULT} EQUAL 0) set(_output ${GIT_TAG_VERSION}) else() execute_process( COMMAND ${GIT_COMMAND} --always WORKING_DIRECTORY ${DIRECTORY} OUTPUT_VARIABLE GIT_TAG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE RESULT ERROR_QUIET) if(${RESULT} EQUAL 0) set(_output ${GIT_TAG_VERSION}) endif() endif() else() set(_output "") endif() rocm_set_parent(${OUTPUT_VERSION} ${_output}) endfunction() function(rocm_setup_version) set(options NO_GIT_TAG_VERSION) set(oneValueArgs VERSION PARENT) set(multiValueArgs) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_VERSION) # Compensate for missing patch version if(PARSE_VERSION MATCHES "^[0-9]+\\.[0-9]+$") set(PARSE_VERSION ${PARSE_VERSION}.0) endif() rocm_set_parent(PROJECT_VERSION ${PARSE_VERSION}) rocm_set_parent(${PROJECT_NAME}_VERSION ${PROJECT_VERSION}) rocm_version_regex_parse("^([0-9]+).*" _version_MAJOR "${PROJECT_VERSION}") rocm_version_regex_parse("^[0-9]+\\.([0-9]+).*" _version_MINOR "${PROJECT_VERSION}") rocm_version_regex_parse("^[0-9]+\\.[0-9]+\\.([0-9]+).*" _version_PATCH "${PROJECT_VERSION}") foreach(level MAJOR MINOR PATCH) rocm_set_parent(${PROJECT_NAME}_VERSION_${level} ${_version_${level}}) rocm_set_parent(PROJECT_VERSION_${level} ${_version_${level}}) endforeach() set(ROCM_GIT_TAG_HASH "") if(NOT PARSE_NO_GIT_TAG_VERSION) rocm_get_git_commit_tag(ROCM_GIT_TAG_HASH) endif() rocm_set_parent(PROJECT_VERSION_TWEAK ${ROCM_GIT_TAG_HASH}) rocm_set_parent(${PROJECT_NAME}_VERSION_TWEAK ${ROCM_GIT_TAG_HASH}) endif() endfunction() function(rocm_get_patch_version OUTPUT) set(_patch "") if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) set(_patch $ENV{ROCM_LIBPATCH_VERSION}) endif() rocm_set_parent(${OUTPUT} ${_patch}) endfunction() function(rocm_set_soversion LIBRARY_TARGET SOVERSION) if(NOT WIN32 AND NOT APPLE) rocm_version_regex_parse("^([0-9]+).*" LIB_VERSION_MAJOR "${SOVERSION}") rocm_version_regex_parse("^[0-9]+\\.(.*)" LIB_VERSION_MINOR "${SOVERSION}") set(LIB_VERSION_STRING "${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}") rocm_get_patch_version(LIB_VERSION_PATCH) if(NOT ${LIB_VERSION_PATCH} EQUAL "") set(LIB_VERSION_STRING "${LIB_VERSION_STRING}.${LIB_VERSION_PATCH}") endif() set_target_properties(${LIBRARY_TARGET} PROPERTIES SOVERSION ${LIB_VERSION_MAJOR}) set_target_properties(${LIBRARY_TARGET} PROPERTIES VERSION ${LIB_VERSION_STRING}) endif() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMSphinxDoc.cmake000077500000000000000000000065331473605615300263300ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### include_guard(GLOBAL) include(CMakeParseArguments) include(ROCMDocs) find_program( SPHINX_EXECUTABLE NAMES sphinx-build HINTS "$ENV{SPHINX_DIR}" PATH_SUFFIXES bin DOC "Sphinx documentation generator") find_program( DOXYGEN_EXECUTABLE NAMES doxygen HINTS "$ENV{DOXYGEN_DIR}" PATH_SUFFIXES bin DOC "Doxygen documentation generator") mark_as_advanced(SPHINX_EXECUTABLE) mark_as_advanced(DOXYGEN_EXECUTABLE) function(rocm_add_sphinx_doc SRC_DIR) set(options USE_DOXYGEN) set(oneValueArgs BUILDER CONFIG_DIR OUTPUT_DIR) set(multiValueArgs DEPENDS VARS TEMPLATE_VARS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) get_filename_component(SRC_DIR "${SRC_DIR}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") if(NOT PARSE_CONFIG_DIR AND NOT EXISTS "${SRC_DIR}/conf.py") message(FATAL_ERROR "rocm_add_sphinx_doc cannot find ${SRC_DIR}/conf.py") endif() if(PARSE_BUILDER) string(TOUPPER ${PARSE_BUILDER} BUILDER) else() message(FATAL_ERROR "rocm_add_sphinx_doc requires providing a BUILDER to use.") endif() if(PARSE_OUTPUT_DIR) get_filename_component(OUTPUT_DIR "${PARSE_OUTPUT_DIR}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}") else() if(DEFINED ROCM_CMAKE_DOCS_DIR) set(OUTPUT_DIR "${ROCM_CMAKE_DOCS_DIR}") else() set(OUTPUT_DIR "sphinx/${PARSE_BUILDER}") endif() endif() if(PARSE_CONFIG_DIR) if(NOT EXISTS "${PARSE_CONFIG_DIR}/conf.py") message(FATAL_ERROR "rocm_add_sphinx_doc cannot find ${PARSE_CONFIG_DIR}/conf.py") endif() get_filename_component(CONFIG_DIR "${PARSE_CONFIG_DIR}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(CONFIG_DIR_ARG -c "${CONFIG_DIR}") else() set(CONFIG_DIR_ARG) endif() set(VARS) foreach(VAR IN LISTS PARSE_VARS) list(APPEND VARS -D "${VAR}") endforeach() foreach(VAR IN LISTS PARSE_TEMPLATE_VARS) list(APPEND VARS -A "${VAR}") endforeach() if(PARSE_USE_DOXYGEN) set(USE_DOXYGEN -D "doxygen_executable=${DOXYGEN_EXECUTABLE}") else() set(USE_DOXYGEN) endif() if(NOT TARGET sphinx-${BUILDER}) add_custom_target(sphinx-${BUILDER}) endif() add_custom_target( ${PROJECT_NAME}-sphinx-${BUILDER} COMMAND "${SPHINX_EXECUTABLE}" ${CONFIG_DIR_ARG} -b ${PARSE_BUILDER} -d "${CMAKE_CURRENT_BINARY_DIR}/doctrees" ${USE_DOXYGEN} ${VARS} "${SRC_DIR}" "${OUTPUT_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMENT "Building ${PARSE_BUILDER} documentation with Sphinx") add_dependencies(sphinx-${BUILDER} ${PROJECT_NAME}-sphinx-${BUILDER}) rocm_clean_doc_output("${OUTPUT_DIR}/html") rocm_clean_doc_output("${OUTPUT_DIR}/doctrees") rocm_mark_as_doc(sphinx-${BUILDER}) if(PARSE_DEPENDS) add_dependencies(sphinx-${BUILDER} ${PARSE_DEPENDS}) endif() endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMTest.cmake000066400000000000000000000262271473605615300253470ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2023 Advanced Micro Devices, Inc. # ###################################################################################################################### include(ROCMCreatePackage) include(ROCMInstallTargets) include(CTest) find_package(Threads REQUIRED) include(ProcessorCount) processorcount(_rocm_ctest_parallel_level) set(CTEST_PARALLEL_LEVEL ${_rocm_ctest_parallel_level} CACHE STRING "CTest parallel level") set(CTEST_TIMEOUT 5000 CACHE STRING "CTest timeout") add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout ${CTEST_TIMEOUT}) add_custom_target(tests COMMENT "Build all tests.") add_dependencies(check tests) add_custom_target(install-tests COMMAND ${CMAKE_COMMAND} -DCOMPONENT=tests -P ${CMAKE_BINARY_DIR}/cmake_install.cmake) add_dependencies(install-tests tests) rocm_define_property(TARGET "ROCM_TEST_INSTALLDIR" "Install dir for tests") macro(rocm_enable_test_package NAME) message(STATUS "Enable test package ${NAME}") set_target_properties(tests PROPERTIES ROCM_TEST_INSTALLDIR ${CMAKE_INSTALL_PREFIX}/libexec/installed-tests/${NAME}) rocm_package_setup_component(tests DEPENDS COMPONENT runtime) rocm_defer(rocm_test_install_ctest) endmacro() if(POLICY CMP0079) cmake_policy(SET CMP0079 OLD) endif() add_library(rocm_test_dependencies INTERFACE) function(rocm_test_link_libraries) target_link_libraries(rocm_test_dependencies INTERFACE ${ARGN}) endfunction() function(rocm_test_include_directories) target_include_directories(rocm_test_dependencies INTERFACE ${ARGN}) endfunction() find_program(ROCM_GDB gdb) if(ROCM_GDB) set(ROCM_TEST_GDB On CACHE BOOL "") else() set(ROCM_TEST_GDB Off CACHE BOOL "") endif() set(_rocm_test_config_content "") set(_rocm_test_package_dir ${CMAKE_BINARY_DIR}/rocm-test-package) set(_rocm_test_config_file ${_rocm_test_package_dir}/CTestTestfile.cmake) set(_rocm_test_run_save_tests ${_rocm_test_package_dir}/run-save-tests.cmake) file(MAKE_DIRECTORY ${_rocm_test_package_dir}) file(WRITE ${_rocm_test_run_save_tests} "") if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") set(_rocm_test_genex_eval "GENEX_EVAL") else() set(_rocm_test_genex_eval "1") endif() if(POLICY CMP0095) cmake_policy(SET CMP0095 NEW) endif() function(rocm_save_test) set(options) set(oneValueArgs NAME) set(multiValueArgs COMMAND) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to rocm_save_test(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() if(NOT PARSE_NAME) message(FATAL_ERROR "Missing NAME in rocm_save_test()") endif() if(NOT PARSE_COMMAND) message(FATAL_ERROR "Missing COMMAND in rocm_save_test()") endif() set(COMMAND "") foreach(ARG ${PARSE_COMMAND}) if(TARGET ${ARG}) set(INSTALL_PREFIX "$<${_rocm_test_genex_eval}:$>") string(APPEND COMMAND " \"${INSTALL_PREFIX}/$\"") else() string(APPEND COMMAND " \"${ARG}\"") endif() endforeach() file(APPEND ${_rocm_test_config_file}.in "add_test(${PARSE_NAME} ${COMMAND})\n") set(PROP_NAMES ATTACHED_FILES ATTACHED_FILES_ON_FAIL COST DEPENDS DISABLED ENVIRONMENT ENVIRONMENT_MODIFICATION FAIL_REGULAR_EXPRESSION FIXTURES_CLEANUP FIXTURES_REQUIRED FIXTURES_SETUP LABELS MEASUREMENT PASS_REGULAR_EXPRESSION PROCESSOR_AFFINITY PROCESSORS REQUIRED_FILES RESOURCE_GROUPS RESOURCE_LOCK RUN_SERIAL SKIP_REGULAR_EXPRESSION SKIP_RETURN_CODE TIMEOUT TIMEOUT_AFTER_MATCH WILL_FAIL WORKING_DIRECTORY) set(PROPS "") foreach(PROPERTY ${PROP_NAMES}) get_test_property(${PARSE_NAME} ${PROPERTY} VALUE) if(VALUE) string(APPEND PROPS " ${PROPERTY} \"${VALUE}\"") endif() endforeach() if(PROPS) file(APPEND ${_rocm_test_config_file}.in "set_tests_properties(${PARSE_NAME} PROPERTIES ${PROPS})\n") endif() endfunction() function(rocm_add_test) set(options) set(oneValueArgs NAME) set(multiValueArgs COMMAND) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to rocm_add_test(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() if(NOT PARSE_NAME) message(FATAL_ERROR "Missing NAME in rocm_add_test()") endif() if(NOT PARSE_COMMAND) message(FATAL_ERROR "Missing COMMAND in rocm_add_test()") endif() file(APPEND ${_rocm_test_run_save_tests} "rocm_save_test(NAME ${PARSE_NAME} COMMAND ${PARSE_COMMAND})\n") set(COMMAND ${PARSE_COMMAND}) list(GET COMMAND 0 COMMAND_EXE) set(COMMAND_ARGS ${COMMAND}) list(REMOVE_AT COMMAND_ARGS 0) if(ROCM_TEST_GDB AND TARGET ${COMMAND_EXE}) set(TEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/gdb/test_${PARSE_NAME}) file(MAKE_DIRECTORY ${TEST_DIR}) if(NOT EXISTS ${TEST_DIR}) message(FATAL_ERROR "Failed to create test directory: ${TEST_DIR}") endif() file( GENERATE OUTPUT "${TEST_DIR}/run.cmake" CONTENT " # Remove previous core dump file(REMOVE ${TEST_DIR}/core) execute_process( COMMAND $ ${COMMAND_ARGS} WORKING_DIRECTORY ${TEST_DIR} RESULT_VARIABLE RESULT ) if(NOT RESULT EQUAL 0) # TODO: check for core files based on pid when setting /proc/sys/kernel/core_uses_pid if(EXISTS ${TEST_DIR}/core) set(\$ENV{UBSAN_OPTIONS} print_stacktrace=1) set(\$ENV{ASAN_OPTIONS} print_stacktrace=1) execute_process(COMMAND ${ROCM_GDB} $ ${TEST_DIR}/core -batch -ex bt) endif() message(FATAL_ERROR \"Test failed\") endif() ") set(COMMAND ${CMAKE_COMMAND} -P "${TEST_DIR}/run.cmake") endif() add_test(NAME ${PARSE_NAME} COMMAND ${COMMAND}) set_tests_properties(${PARSE_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") endfunction() function(rocm_mark_as_test) foreach(TEST_TARGET ${ARGN}) add_dependencies(tests ${TEST_TARGET}) endforeach() endfunction() function(rocm_link_test_dependencies) foreach(TEST_TARGET ${ARGN}) get_target_property(TEST_TARGET_TYPE ${TEST_TARGET} TYPE) # We can only use target_link_libraries on build targets if(NOT "${TEST_TARGET_TYPE}" STREQUAL "INTERFACE_LIBRARY") target_link_libraries(${TEST_TARGET} rocm_test_dependencies) endif() endforeach() endfunction() function(rocm_install_test) set(options) set(oneValueArgs DESTINATION) set(multiValueArgs TARGETS FILES) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to rocm_install_test(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() set(INSTALL_PREFIX "$") if(PARSE_TARGETS) foreach(TARGET ${PARSE_TARGETS}) set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib") # Adding RPATH to public tests to point to private libraries. set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib/${PROJECT_NAME}/lib") endforeach() install( TARGETS ${PARSE_TARGETS} COMPONENT tests DESTINATION ${INSTALL_PREFIX}/bin EXCLUDE_FROM_ALL) rocm_set_install_dir_property(TARGETS ${PARSE_TARGETS} DESTINATION ${INSTALL_PREFIX}/bin) get_target_property(INSTALLDIR ${PARSE_TARGETS} ROCM_INSTALL_DIR) endif() if(PARSE_FILES) install( FILES ${PARSE_FILES} COMPONENT tests DESTINATION ${INSTALL_PREFIX}/${PARSE_DESTINATION} EXCLUDE_FROM_ALL) endif() endfunction() function(rocm_add_test_executable EXE) add_executable(${EXE} ${ARGN}) target_link_libraries(${EXE} ${CMAKE_THREAD_LIBS_INIT}) # Cmake does not add flags correctly for gcc if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") set_target_properties(${EXE} PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread) endif() rocm_mark_as_test(${EXE}) rocm_link_test_dependencies(${EXE}) rocm_add_test(NAME ${EXE} COMMAND ${EXE}) rocm_install_test(TARGETS ${EXE}) endfunction() function(rocm_test_header NAME HEADER) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/header-main-include-${NAME}.cpp "#include <${HEADER}>\nint main() {}\n") file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/header-static-include-${NAME}.cpp "#include <${HEADER}>\n") rocm_add_test_executable(${NAME} ${CMAKE_CURRENT_BINARY_DIR}/header-main-include-${NAME}.cpp ${CMAKE_CURRENT_BINARY_DIR}/header-static-include-${NAME}.cpp) endfunction() function(rocm_test_headers) set(options) set(oneValueArgs PREFIX) set(multiValueArgs HEADERS DEPENDS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(PARSE_UNPARSED_ARGUMENTS) message(FATAL_ERROR "Unknown keywords given to rocm_test_headers(): \"${PARSE_UNPARSED_ARGUMENTS}\"") endif() file(GLOB HEADERS CONFIGURE_DEPENDS ${PARSE_HEADERS}) foreach(HEADER ${HEADERS}) file(RELATIVE_PATH HEADER_REL ${CMAKE_SOURCE_DIR} ${HEADER}) string(MAKE_C_IDENTIFIER ${HEADER_REL} TEST_NAME) get_filename_component(BASE_NAME ${HEADER} NAME) if(PARSE_PREFIX) rocm_test_header(header_${TEST_NAME} ${PARSE_PREFIX}/${BASE_NAME}) else() rocm_test_header(header_${TEST_NAME} ${BASE_NAME}) endif() if(PARSE_DEPENDS) target_link_libraries(header_${TEST_NAME} ${PARSE_DEPENDS}) endif() endforeach() endfunction() function(rocm_test_install_ctest) file(WRITE ${_rocm_test_config_file}.in "") include(${_rocm_test_run_save_tests}) message(STATUS "Generate ctest file") if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") file( GENERATE OUTPUT ${_rocm_test_config_file} INPUT ${_rocm_test_config_file}.in) else() # Multi-pass generate to workaround missing `GENEX_EVAL` file( GENERATE OUTPUT ${_rocm_test_config_file}.in2 INPUT ${_rocm_test_config_file}.in) file( GENERATE OUTPUT ${_rocm_test_config_file} INPUT ${_rocm_test_config_file}.in2) endif() rocm_install_test(FILES ${_rocm_test_config_file}) endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCMUtilities.cmake000066400000000000000000000104701473605615300263740ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2021 Advanced Micro Devices, Inc. # ###################################################################################################################### if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12.0") # pretty much just a wrapper around string JOIN function(rocm_join_if_set glue inout_variable) string(JOIN "${glue}" to_set_parent ${${inout_variable}} ${ARGN}) set(${inout_variable} "${to_set_parent}" PARENT_SCOPE) endfunction() else() # cmake < 3.12 doesn't have string JOIN function(rocm_join_if_set glue inout_variable) set(accumulator "${${inout_variable}}") set(tglue ${glue}) if(accumulator STREQUAL "") set(tglue "") # No glue needed if initially unset endif() foreach(ITEM IN LISTS ARGN) string(CONCAT accumulator "${accumulator}" "${tglue}" "${ITEM}") set(tglue ${glue}) # Always need glue after the first concatenate endforeach() set(${inout_variable} "${accumulator}" PARENT_SCOPE) endfunction() endif() if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0") macro(rocm_eval_code CODE) cmake_language(EVAL CODE "${CODE}") endmacro() else() macro(rocm_eval_code CODE) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/rocm_eval.cmake "${CODE}") include(${CMAKE_CURRENT_BINARY_DIR}/rocm_eval.cmake) file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/rocm_eval.cmake) endmacro() endif() if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0") macro(rocm_defer FNAME) cmake_language(DEFER DIRECTORY ${CMAKE_SOURCE_DIR} CALL ${FNAME}()) endmacro() else() macro(rocm_defer FNAME) function(rocm_defer_private_${FNAME}_hook VARIABLE ACCESS CURRENT_LIST_FILE STACK) if (NOT STACK) rocm_eval_code("${FNAME}()") endif() endfunction() variable_watch(CMAKE_BACKWARDS_COMPATIBILITY rocm_defer_private_${FNAME}_hook) endmacro() endif() function(rocm_find_program_version PROGRAM) set(options QUIET REQUIRED) set(oneValueArgs GREATER GREATER_EQUAL LESS LESS_EQUAL EQUAL OUTPUT_VARIABLE) set(multiValueArgs) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT DEFINED PARSE_OUTPUT_VARIABLE) set(PARSE_OUTPUT_VARIABLE "${PROGRAM}_VERSION") endif() execute_process( COMMAND ${PROGRAM} --version RESULT_VARIABLE PROC_RESULT OUTPUT_VARIABLE EVAL_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE ) if(NOT PROC_RESULT EQUAL "0") set(${PARSE_OUTPUT_VARIABLE} "0.0.0" PARENT_SCOPE) set(${PARSE_OUTPUT_VARIABLE}_OK FALSE PARENT_SCOPE) if(PARSE_REQUIRED) message(FATAL_ERROR "Could not determine the version of required program ${PROGRAM}.") elseif(NOT PARSE_QUIET) message(WARNING "Could not determine the version of program ${PROGRAM}.") endif() else() string(REGEX MATCH "[0-9]+(\\.[^ \t\r\n]+)*" PROGRAM_VERSION "${EVAL_RESULT}") set(${PARSE_OUTPUT_VARIABLE} "${PROGRAM_VERSION}" PARENT_SCOPE) set(${PARSE_OUTPUT_VARIABLE}_OK TRUE PARENT_SCOPE) foreach(COMP GREATER GREATER_EQUAL LESS LESS_EQUAL EQUAL) if(DEFINED PARSE_${COMP} AND NOT PROGRAM_VERSION VERSION_${COMP} PARSE_${COMP}) set(${PARSE_OUTPUT_VARIABLE}_OK FALSE PARENT_SCOPE) endif() endforeach() endif() endfunction() function(rocm_set_os_id OS_ID) set(_os_id "unknown") if(EXISTS "/etc/os-release") rocm_read_os_release(_os_id "ID") endif() set(${OS_ID} ${_os_id} PARENT_SCOPE) set(os_id_out ${OS_ID}_${_os_id}) set(${os_id_out} TRUE PARENT_SCOPE) endfunction() function(rocm_read_os_release OUTPUT KEYVALUE) # finds the line with the keyvalue if(EXISTS "/etc/os-release") file(STRINGS /etc/os-release _keyvalue_line REGEX "^${KEYVALUE}=") endif() # remove keyvalue= string(REGEX REPLACE "^${KEYVALUE}=\"?(.*)" "\\1" _output "${_keyvalue_line}") # remove trailing quote string(REGEX REPLACE "\"$" "" _output "${_output}") set(${OUTPUT} ${_output} PARENT_SCOPE) endfunction() rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/ROCmCMakeBuildToolsConfig.cmake000066400000000000000000000005621473605615300305710ustar00rootroot00000000000000# ###################################################################################################################### # Copyright (C) 2017 Advanced Micro Devices, Inc. # ###################################################################################################################### list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) include(ROCMChecks) rocm-cmake-rocm-6.3.2/share/rocmcmakebuildtools/cmake/header_template.h.in000066400000000000000000000023171473605615300266400ustar00rootroot00000000000000/* Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. */ #ifndef @include_guard@ #define @include_guard@ #if defined(ROCM_NO_WRAPPER_HEADER_WARNING) || defined(ROCM_@ITEM_GUARD@_GAVE_WARNING) /* include file */ #include "@file_rel_path@" #else #ifndef ROCM_HEADER_WRAPPER_WERROR #define ROCM_HEADER_WRAPPER_WERROR @deprecated_error@ #endif #if ROCM_HEADER_WRAPPER_WERROR /* ROCM_HEADER_WRAPPER_WERROR 1 */ #error "This file is deprecated. Use the header file from @header_location@ by using #include <@correct_include@>" #else /* ROCM_HEADER_WRAPPER_WERROR 0 */ /* give warning */ #if defined(_MSC_VER) #pragma message(": warning:This file is deprecated. Use the header file from @header_location@ by using #include <@correct_include@>") #elif defined(__GNUC__) #warning "This file is deprecated. Use the header file from @header_location@ by using #include <@correct_include@>" #endif #endif /* ROCM_HEADER_WRAPPER_WERROR */ /* include file */ #define ROCM_@ITEM_GUARD@_GAVE_WARNING #include "@file_rel_path@" #undef ROCM_@ITEM_GUARD@_GAVE_WARNING #endif /* defined(ROCM_NO_WRAPPER_HEADER_WARNING) || defined(ROCM_@ITEM_GUARD@_GAVE_WARNING) */ #endif /* @include_guard@ */ @original_contents_section@ rocm-cmake-rocm-6.3.2/test/000077500000000000000000000000001473605615300154675ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/test/CMakeLists.txt000066400000000000000000000044661473605615300202410ustar00rootroot00000000000000################################################################################ # Copyright (C) 2023 Advanced Micro Devices, Inc. ################################################################################ macro(rocm_cmake_add_test_argument CMAKE_VAR VAR_TYPE DOC_STRING) set(ROCM_${CMAKE_VAR} "${${CMAKE_VAR}}" CACHE ${VAR_TYPE} "${DOC_STRING}") if(DEFINED ${CMAKE_VAR}) string(REPLACE ";" "|" ROCM_${CMAKE_VAR} "${ROCM_${CMAKE_VAR}}") # Some variables, such as CMAKE_GENERATOR_INSTANCE will be INTERNAL empty vars # and relaying/setting them as empty vars explicitly will conflict with makefile # generators if(NOT "${${CMAKE_VAR}}" STREQUAL "") list(APPEND TEST_ARGUMENTS -D "ROCM_${CMAKE_VAR}:${VAR_TYPE}=${ROCM_${CMAKE_VAR}}") endif() endif() endmacro() rocm_cmake_add_test_argument(CMAKE_MAKE_PROGRAM FILEPATH "Make program to relay to test projects") rocm_cmake_add_test_argument(CMAKE_GENERATOR STRING "Generator to relay to test projects") rocm_cmake_add_test_argument(CMAKE_GENERATOR_INSTANCE STRING "Generator instance to relay to test projects") rocm_cmake_add_test_argument(CMAKE_GENERATOR_PLATFORM STRING "Generator platform to relay to test projects") rocm_cmake_add_test_argument(CMAKE_GENERATOR_TOOLSET STRING "Generator toolset to relay to test projects") rocm_cmake_add_test_argument(CMAKE_PREFIX_PATH PATH "Prefix path to relay to test projects") rocm_cmake_add_test_argument(CMAKE_PROGRAM_PATH PATH "Program path to relay to test projects") function(rocm_cmake_create_test NAME TEST) add_custom_target(${NAME} COMMAND ${CMAKE_COMMAND} ${TEST_ARGUMENTS} -P ${CMAKE_CURRENT_SOURCE_DIR}/test.cmake ${TEST} ${CMAKE_CURRENT_BINARY_DIR}/tmp/${NAME}) add_test(NAME ${NAME} COMMAND ${CMAKE_COMMAND} ${TEST_ARGUMENTS} -P ${CMAKE_CURRENT_SOURCE_DIR}/test.cmake ${TEST} ${CMAKE_CURRENT_BINARY_DIR}/tmp/${NAME} COMMAND_EXPAND_LISTS) endfunction() file(GLOB PASS_TESTS pass/*.cmake) foreach(TEST ${PASS_TESTS}) get_filename_component(NAME ${TEST} NAME_WE) rocm_cmake_create_test(pass-${NAME} ${TEST}) endforeach() file(GLOB FAIL_TESTS fail/*.cmake) foreach(TEST ${FAIL_TESTS}) get_filename_component(NAME ${TEST} NAME_WE) rocm_cmake_create_test(fail-${NAME} ${TEST}) set_tests_properties(fail-${NAME} PROPERTIES WILL_FAIL On) endforeach() rocm-cmake-rocm-6.3.2/test/analyze/000077500000000000000000000000001473605615300171325ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/test/analyze/CMakeLists.txt000077500000000000000000000020711473605615300216750ustar00rootroot00000000000000################################################################################ # Copyright (C) 2017 Advanced Micro Devices, Inc. ################################################################################ cmake_minimum_required (VERSION 3.5) project(simple LANGUAGES CXX) find_package(ROCmCMakeBuildTools) include(ROCMInstallTargets) include(ROCMAnalyzers) include(ROCMSetupVersion) include(ROCMClangTidy) rocm_enable_clang_tidy( DEV_WARNINGS_AS_ERRORS CHECKS * -llvmlibc-* ERRORS * HEADER_FILTER "hpp$" ) include(ROCMCppCheck) rocm_enable_cppcheck( INCONCLUSIVE CHECKS warning FORCE SUPPRESS unmatchedSuppression SOURCES simple.cpp INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/include ADDONS findcasts threadsafety ) rocm_setup_version(VERSION 1.0.0) configure_file(simple2.cpp.in simple2.cpp) add_library(simple simple.cpp ${CMAKE_CURRENT_BINARY_DIR}/simple2.cpp) rocm_install_targets(TARGETS simple INCLUDE include) rocm_clang_tidy_check(simple) rocm-cmake-rocm-6.3.2/test/analyze/include/000077500000000000000000000000001473605615300205555ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/test/analyze/include/simple.h000066400000000000000000000004361473605615300222220ustar00rootroot00000000000000/******************************************************************************* * Copyright (C) 2017 Advanced Micro Devices, Inc. ******************************************************************************/ #ifndef GUARD_SIMPLE_H #define GUARD_SIMPLE_H void simple(); #endif rocm-cmake-rocm-6.3.2/test/analyze/simple.cpp000066400000000000000000000003501473605615300211250ustar00rootroot00000000000000/******************************************************************************* * Copyright (C) 2017 Advanced Micro Devices, Inc. ******************************************************************************/ void simple() {} rocm-cmake-rocm-6.3.2/test/analyze/simple2.cpp.in000066400000000000000000000003511473605615300216150ustar00rootroot00000000000000/******************************************************************************* * Copyright (C) 2020 Advanced Micro Devices, Inc. ******************************************************************************/ void simple2() {} rocm-cmake-rocm-6.3.2/test/docsphinx/000077500000000000000000000000001473605615300174665ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/test/docsphinx/CMakeLists.txt000066400000000000000000000013721473605615300222310ustar00rootroot00000000000000################################################################################ # Copyright (C) 2023 Advanced Micro Devices, Inc. ################################################################################ cmake_minimum_required (VERSION 3.5) project(useful LANGUAGES CXX) # Ideally should be NONE, but GNUInstallDirs detects platform arch using try_compile # https://stackoverflow.com/questions/43379311/why-does-project-affect-cmakes-opinion-on-cmake-sizeof-void-p find_package(ROCmCMakeBuildTools) include(ROCMSphinxDoc) include(GNUInstallDirs) rocm_add_sphinx_doc( "${CMAKE_CURRENT_SOURCE_DIR}/docs" BUILDER html OUTPUT_DIR html USE_DOXYGEN ) install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION ${CMAKE_INSTALL_DOCDIR} ) rocm-cmake-rocm-6.3.2/test/docsphinx/docs/000077500000000000000000000000001473605615300204165ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/test/docsphinx/docs/.doxygen/000077500000000000000000000000001473605615300221515ustar00rootroot00000000000000rocm-cmake-rocm-6.3.2/test/docsphinx/docs/.doxygen/Doxyfile000066400000000000000000003175721473605615300236760ustar00rootroot00000000000000# Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = useful # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = docBin # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = YES # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = skip_doxy_start="\{" ALIASES += skip_doxy_end="\}" # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = mainpage.dox \ ../../include/useful # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, # *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = detail::* # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = NO # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NONE # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /