# Copyright 2020 The Pigweed Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations under # the License. include_guard(GLOBAL) cmake_minimum_required(VERSION 3.19) # The PW_ROOT environment variable should be set in bootstrap. If it is not set, # set it to the root of the Pigweed repository. if("$ENV{PW_ROOT}" STREQUAL "") get_filename_component(pw_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) message("The PW_ROOT environment variable is not set; " "using ${pw_root} within CMake") set(ENV{PW_ROOT} "${pw_root}") endif() # TOOD(ewout, hepler): Remove this legacy include once all users pull in # pw_unit_test/test.cmake for test functions and variables instead of relying # on them to be provided by pw_build/pigweed.cmake. include("$ENV{PW_ROOT}/pw_unit_test/test.cmake") # Wrapper around cmake_parse_arguments that fails with an error if any arguments # remained unparsed or a required argument was not provided. # # All parsed arguments are prefixed with "arg_". This helper can only be used # by functions, not macros. # # Required Arguments: # # NUM_POSITIONAL_ARGS - PARSE_ARGV arguments for # cmake_parse_arguments # # Optional Args: # # OPTION_ARGS -