| 1 |
# @HEADER |
| 2 |
# ***************************************************************************** |
| 3 |
# TriBITS: Tribal Build, Integrate, and Test System |
| 4 |
# |
| 5 |
# Copyright 2013-2016 NTESS and the TriBITS contributors. |
| 6 |
# SPDX-License-Identifier: BSD-3-Clause |
| 7 |
# ***************************************************************************** |
| 8 |
# @HEADER |
| 9 |
|
| 10 |
|
| 11 |
# @FUNCTION: tribits_extpkg_append_tribits_compliant_package_config_vars_str() |
| 12 |
# |
| 13 |
# Append the standard TriBITS-compliant external package variables |
| 14 |
# |
| 15 |
function(tribits_extpkg_append_tribits_compliant_package_config_vars_str packageName |
| 16 |
packageConfigCodeStrVarInOut |
| 17 |
) |
| 18 |
set(packageConfigCodeStr "${${packageConfigCodeStrVarInOut}}") |
| 19 |
string(APPEND packageConfigCodeStr |
| 20 |
"\n# Standard TriBITS-compliant external package variables\n" |
| 21 |
"set(${packageName}_IS_TRIBITS_COMPLIANT TRUE)\n" |
| 22 |
"set(${packageName}_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE \"\${CMAKE_CURRENT_LIST_FILE}\")\n" |
| 23 |
"set(${packageName}_TRIBITS_COMPLIANT_PACKAGE_CONFIG_FILE_DIR \"\${CMAKE_CURRENT_LIST_DIR}\")\n" |
| 24 |
) |
| 25 |
set(${packageConfigCodeStrVarInOut} "${packageConfigCodeStr}" PARENT_SCOPE) |
| 26 |
endfunction() |
| 27 |
|
| 28 |
|
| 29 |
function(tribits_extpkg_write_package_config_file_from_str tplName configFileStr) |
| 30 |
set(buildDirExternalPkgsDir |
| 31 |
"${${PROJECT_NAME}_BINARY_DIR}/${${PROJECT_NAME}_BUILD_DIR_EXTERNAL_PKGS_DIR}") |
| 32 |
set(tplConfigFile |
| 33 |
"${buildDirExternalPkgsDir}/${tplName}/${tplName}Config.cmake") |
| 34 |
file(WRITE "${tplConfigFile}" "${configFileStr}") |
| 35 |
endfunction() |