# Copyright 2016, Raffi Enficiaud.
#
# The cmake-pip module SHOULD be found here: the extension declares
# cmake_install_component, and cmake-pip only injects
# -Dcmakepip_DIR=<cmake_pip>/cmake_modules when cmake_install or
# cmake_install_component is set (cmake_extension.py:222).
#
# Both branches below raise on purpose -- pip discards the build tree, so
# failing the configure is how this fixture reports its result to the test.

cmake_minimum_required(VERSION 3.21)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

enable_testing()

project(TestCMakePIPExt)

# Python libraries, required
find_package(Python3 COMPONENTS Interpreter REQUIRED)

find_package(cmakepip)
if(COMMAND python_package_add_target)
  message(FATAL_ERROR "python_package_add_target found")
else()
  message(FATAL_ERROR "python_package_add_target not found")
endif()