summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/CMakeLists.txt
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-09-21 17:31:43 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-09-30 12:30:23 (GMT)
commite4b7049230afabd7f2cc0186f26176b103682100 (patch)
tree57c99c4d31e0a903df80701e7526e728db1697db /Tests/FindPython/CMakeLists.txt
parentf002c1cfc7f66edb9c9821524671574c23f92cd2 (diff)
downloadCMake-e4b7049230afabd7f2cc0186f26176b103682100.zip
CMake-e4b7049230afabd7f2cc0186f26176b103682100.tar.gz
CMake-e4b7049230afabd7f2cc0186f26176b103682100.tar.bz2
FindPython: Add version range support
Fixes: #21107
Diffstat (limited to 'Tests/FindPython/CMakeLists.txt')
-rw-r--r--Tests/FindPython/CMakeLists.txt104
1 files changed, 104 insertions, 0 deletions
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index fdfa36e..44484c3 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -243,6 +243,87 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.Python3.VersionRange.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.LOCATION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
+ -DPython3_FIND_STRATEGY=LOCATION
+ )
+ add_test(NAME FindPython.Python3.VersionRange.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.VERSION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
+ -DPython3_FIND_STRATEGY=VERSION
+ )
+ add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_STRATEGY=LOCATION
+ )
+ add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_STRATEGY=VERSION
+ )
+ add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
+ -DPython_FIND_STRATEGY=LOCATION
+ )
+ add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
+ -DPython_FIND_STRATEGY=VERSION
+ )
+ add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.LOCATION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
+ -DPython_FIND_STRATEGY=LOCATION
+ )
+ add_test(NAME FindPython.Python.V3.VersionRange.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.VERSION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
+ -DPython_FIND_STRATEGY=VERSION
+ )
+
add_test(NAME FindPython.MultiplePackages COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
@@ -492,6 +573,29 @@ if(CMake_TEST_FindPython_IronPython)
--build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+
+ add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython
+ -DPython2_FIND_STRATEGY=LOCATION
+ )
+ add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
+ "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
+ ${build_generator_args}
+ --build-project TestVersionRange
+ --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
+ -DPython2_FIND_IMPLEMENTATIONS=IronPython
+ -DPython2_FIND_STRATEGY=VERSION
+ )
endif()
if(CMake_TEST_FindPython_PyPy)