Debian Codegraph @

cmake/tribits/core/package_arch/TribitsProject.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 # Projects that change the location of the source need to consider this in
11 # their top-level CMakeLists.txt file
12 set(${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/tribits"
13 CACHE PATH
14 "The base directory pointing to the TriBITS system. If provided as a relative path (formatted as STRING) then will be set to '${CMAKE_CURRENT_SOURCE_DIR}/'. NOTE: If you leave off the STRING datatype, and it is a relative path, then it will be interpreted as relative to the build directory!"
15 )
16 mark_as_advanced(${PROJECT_NAME}_TRIBITS_DIR)
17
18 if (NOT IS_ABSOLUTE "${${PROJECT_NAME}_TRIBITS_DIR}")
19 if (${PROJECT_NAME}_VERBOSE_CONFIGURE)
20 message("NOTE: ${PROJECT_NAME}_TRIBITS_DIR = '${${PROJECT_NAME}_TRIBITS_DIR}' provided as a relative directory so making this relative to '${CMAKE_CURRENT_SOURCE_DIR}'!")
21 endif()
22 set(${PROJECT_NAME}_TRIBITS_DIR
23 "${CMAKE_CURRENT_SOURCE_DIR}/${${PROJECT_NAME}_TRIBITS_DIR}")
24 endif()
25
26 if (${PROJECT_NAME}_VERBOSE_CONFIGURE)
27 message("${PROJECT_NAME}_TRIBITS_DIR='${${PROJECT_NAME}_TRIBITS_DIR}'")
28 endif()
29
30 set(CMAKE_MODULE_PATH
31 ${${PROJECT_NAME}_TRIBITS_DIR}/core/package_arch
32 )
33
34 if (${PROJECT_NAME}_VERBOSE_CONFIGURE)
35 message("CMAKE_MODULE_PATH='${CMAKE_MODULE_PATH}'")
36 endif()
37
38 # Overrides that we have for CMake functions
39 include("${CMAKE_CURRENT_LIST_DIR}/../common/TribitsCMakePolicies.cmake" NO_POLICY_SCOPE)
40 include(TribitsProjectImpl)
41
42
43 # @MACRO: tribits_project()
44 #
45 # Processes a `TriBITS Project`_'s files and configures its software which is
46 # called from the project's top-level `<projectDir>/CMakeLists.txt`_ file.
47 #
48 # Usage::
49 #
50 # tribits_project()
51 #
52 # This macro requires that the variable `PROJECT_NAME`_ be defined before
53 # calling this macro. All default values for project settings should be set
54 # before calling this macro (see `TriBITS Global Project Settings`_). Also,
55 # the variable `${PROJECT_NAME}_TRIBITS_DIR`_ must be set as well.
56 #
57 # This macro then adds all of the necessary paths to ``CMAKE_MODULE_PATH`` and
58 # then performs all processing of the TriBITS project files (see `Full TriBITS
59 # Project Configuration`_).
60 #
61 macro(tribits_project)
62 tribits_project_impl(${ARGN})
63 endmacro()
64
65 # Note, this is just a shell of a macro that calls the real implementation
66 # tribits_project_impl(). This allows someone to set
67 # ${PROJECT_NAME}_TRIBITS_DIR in the env and point to a different Tribits
68 # implementation to test before snapshoting.