Debian Codegraph @

cmake/tribits/core/package_arch/TribitsLibIsTestOnly.cmake

raw
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
13 # @FUNCTION: tribits_set_lib_is_testonly()
14 #
15 # See if a library is a TESTONLY library
16 #
17 # Usage::
18 #
19 # tribits_set_lib_is_testonly(<libName>)
20 #
21 # This sets the ``TRIBITS_TESTONLY_LIB`` on the library target ``<libName>``.
22 #
23 function(tribits_set_lib_is_testonly libName)
24 set_target_properties(${libName} PROPERTIES TRIBITS_TESTONLY_LIB TRUE)
25 endfunction()
26
27
28 # @FUNCTION: tribits_lib_is_testonly()
29 #
30 # See if a library is a TESTONLY library
31 #
32 # Usage::
33 #
34 # tribits_lib_is_testonly(<libName> <libIsTestOnlyOut>)
35 #
36 # This will only return ``TRUE`` in `` <libIsTestOnlyOut>`` if ``<libName>``
37 # is a target and the target property ``TRIBITS_TESTONLY_LIB`` is set to
38 # ``TRUE``.
39 #
40 function(tribits_lib_is_testonly libName libIsTestOnlyOut)
41 if (TARGET ${libName})
42 get_target_property(libIsTestOnly ${libName} TRIBITS_TESTONLY_LIB)
43 else()
44 set(libIsTestOnly FALSE)
45 endif()
46 set(${libIsTestOnlyOut} ${libIsTestOnly} PARENT_SCOPE)
47 endfunction()