summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/ArtifactsInteractive
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-03-02 16:45:25 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-03-05 15:44:48 (GMT)
commite5b4c742385b7bcddb9b667cad37795b0aef3f32 (patch)
treee4f12be194969b1d0a66be736082929b763fc1a2 /Tests/FindPython/ArtifactsInteractive
parent07a7bc0e3fc370eaa5593cffcd07c0ea739cfc9c (diff)
downloadCMake-e5b4c742385b7bcddb9b667cad37795b0aef3f32.zip
CMake-e5b4c742385b7bcddb9b667cad37795b0aef3f32.tar.gz
CMake-e5b4c742385b7bcddb9b667cad37795b0aef3f32.tar.bz2
FindPython: Add possibility to control scope of artifacts.
Fixes: #20362
Diffstat (limited to 'Tests/FindPython/ArtifactsInteractive')
-rw-r--r--Tests/FindPython/ArtifactsInteractive/CMakeLists.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt
new file mode 100644
index 0000000..524be92
--- /dev/null
+++ b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestArtifactsInteractive LANGUAGES C)
+
+set (components Interpreter Development)
+if (CMake_TEST_FindPython_NumPy)
+ list (APPEND components NumPy)
+endif()
+
+find_package(Python3 REQUIRED COMPONENTS ${components})
+
+if (Python3_ARTIFACTS_INTERACTIVE)
+ if (NOT DEFINED CACHE{Python3_EXECUTABLE}
+ OR NOT DEFINED CACHE{Python3_LIBRARY} OR NOT DEFINED CACHE{Python3_INCLUDE_DIR}
+ OR (CMake_TEST_FindPython_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR}))
+ message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=ON Failed.")
+ endif()
+else()
+ if (DEFINED CACHE{Python3_EXECUTABLE}
+ OR DEFINED CACHE{Python3_LIBRARY} OR DEFINED CACHE{Python3_INCLUDE_DIR}
+ OR (CMake_TEST_FindPython_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR}))
+ message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=OFF Failed.")
+ endif()
+endif()