| 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 |
include_guard() |
| 11 |
|
| 12 |
include(CMakeBuildTypesList) |
| 13 |
|
| 14 |
|
| 15 |
# Return the value of the target property IMPORTED_LOCATION_<CONFIG> for every |
| 16 |
# known <CONFIG> and returns the fist non-null value. Otherwise, returns |
| 17 |
# empty. |
| 18 |
# |
| 19 |
function(tribits_get_imported_location_property targetName importedLocationOut) |
| 20 |
|
| 21 |
set(importedLocation "") |
| 22 |
foreach (cmakeBuildType IN LISTS CMAKE_CONFIG_FILE_BUILD_TYPES_LIST) |
| 23 |
string(TOUPPER ${cmakeBuildType} cmakeBuildTypeUpper) |
| 24 |
get_target_property(importedLoc ${targetName} |
| 25 |
IMPORTED_LOCATION_${cmakeBuildTypeUpper}) |
| 26 |
if (importedLoc) |
| 27 |
set(importedLocation "${importedLoc}") |
| 28 |
break() |
| 29 |
endif() |
| 30 |
endforeach() |
| 31 |
set(${importedLocationOut} ${importedLocation} PARENT_SCOPE) |
| 32 |
endfunction() |