CMakeLists.txt 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. if(CMake_TEST_FindPython2)
  2. add_test(NAME FindPython.Python2.LOCATION COMMAND
  3. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  4. --build-and-test
  5. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
  6. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.LOCATION"
  7. ${build_generator_args}
  8. --build-project TestPython2
  9. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  10. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  11. )
  12. add_test(NAME FindPython.Python2.VERSION COMMAND
  13. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  14. --build-and-test
  15. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
  16. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VERSION"
  17. ${build_generator_args}
  18. --build-project TestPython2
  19. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  20. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  21. )
  22. add_test(NAME FindPython.Python2.Development.Module COMMAND
  23. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  24. --build-and-test
  25. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Module"
  26. "${CMake_BINARY_DIR}/Tests/FindPython/Python2Module"
  27. ${build_generator_args}
  28. --build-project TestPython2Module
  29. --build-options ${build_options}
  30. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  31. )
  32. add_test(NAME FindPython.Python2Fail COMMAND
  33. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  34. --build-and-test
  35. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Fail"
  36. "${CMake_BINARY_DIR}/Tests/FindPython/Python2Fail"
  37. ${build_generator_args}
  38. --build-project TestPython2Fail
  39. --build-options ${build_options}
  40. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  41. )
  42. set_tests_properties(FindPython.Python2Fail PROPERTIES
  43. PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)")
  44. add_test(NAME FindPython.Python.V2.LOCATION COMMAND
  45. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  46. --build-and-test
  47. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  48. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION"
  49. ${build_generator_args}
  50. --build-project TestPython
  51. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  52. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  53. )
  54. add_test(NAME FindPython.Python.V2.VERSION COMMAND
  55. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  56. --build-and-test
  57. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  58. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION"
  59. ${build_generator_args}
  60. --build-project TestPython
  61. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  62. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  63. )
  64. add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND
  65. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  66. --build-and-test
  67. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  68. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION"
  69. ${build_generator_args}
  70. --build-project TestExactVersion
  71. --build-options ${build_options} -DPython_MAJOR_VERSION=2
  72. -DPython_REQUESTED_VERSION=2.1.2
  73. -DPython2_FIND_STRATEGY=LOCATION
  74. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  75. )
  76. add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND
  77. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  78. --build-and-test
  79. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  80. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION"
  81. ${build_generator_args}
  82. --build-project TestExactVersion
  83. --build-options ${build_options} -DPython_MAJOR_VERSION=2
  84. -DPython_REQUESTED_VERSION=2.1.2
  85. -DPython2_FIND_STRATEGY=VERSION
  86. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  87. )
  88. add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND
  89. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  90. --build-and-test
  91. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  92. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION"
  93. ${build_generator_args}
  94. --build-project TestExactVersion
  95. --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2
  96. -DPython_FIND_STRATEGY=LOCATION
  97. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  98. )
  99. add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND
  100. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  101. --build-and-test
  102. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  103. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION"
  104. ${build_generator_args}
  105. --build-project TestExactVersion
  106. --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2
  107. -DPython_FIND_STRATEGY=VERSION
  108. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  109. )
  110. add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND
  111. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  112. --build-and-test
  113. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  114. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION"
  115. ${build_generator_args}
  116. --build-project TestVersionRange
  117. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  118. -DPython2_FIND_STRATEGY=LOCATION
  119. )
  120. add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND
  121. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  122. --build-and-test
  123. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  124. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION"
  125. ${build_generator_args}
  126. --build-project TestVersionRange
  127. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  128. -DPython2_FIND_STRATEGY=VERSION
  129. )
  130. add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND
  131. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  132. --build-and-test
  133. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  134. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION"
  135. ${build_generator_args}
  136. --build-project TestVersionRange
  137. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
  138. -DPython_FIND_STRATEGY=LOCATION
  139. )
  140. add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND
  141. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  142. --build-and-test
  143. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  144. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION"
  145. ${build_generator_args}
  146. --build-project TestVersionRange
  147. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
  148. -DPython_FIND_STRATEGY=VERSION
  149. )
  150. add_test(NAME FindPython.Python2Embedded COMMAND
  151. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  152. --build-and-test
  153. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded"
  154. "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded"
  155. ${build_generator_args}
  156. --build-project TestPython2Embedded
  157. --build-options ${build_options}
  158. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  159. )
  160. endif()
  161. if(CMake_TEST_FindPython3)
  162. add_test(NAME FindPython.Python3.LOCATION COMMAND
  163. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  164. --build-and-test
  165. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
  166. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.LOCATION"
  167. ${build_generator_args}
  168. --build-project TestPython3
  169. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  170. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  171. )
  172. add_test(NAME FindPython.Python3.VERSION COMMAND
  173. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  174. --build-and-test
  175. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
  176. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VERSION"
  177. ${build_generator_args}
  178. --build-project TestPython3
  179. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  180. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  181. )
  182. add_test(NAME FindPython.Python3.Development.Module COMMAND
  183. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  184. --build-and-test
  185. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Module"
  186. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Module"
  187. ${build_generator_args}
  188. --build-project TestPython3Module
  189. --build-options ${build_options}
  190. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  191. )
  192. add_test(NAME FindPython.Python3Fail COMMAND
  193. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  194. --build-and-test
  195. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
  196. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
  197. ${build_generator_args}
  198. --build-project TestPython3Fail
  199. --build-options ${build_options}
  200. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  201. )
  202. set_tests_properties(FindPython.Python3Fail PROPERTIES
  203. PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")
  204. add_test(NAME FindPython.Python.V3.LOCATION COMMAND
  205. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  206. --build-and-test
  207. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  208. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.LOCATION"
  209. ${build_generator_args}
  210. --build-project TestPython
  211. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  212. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  213. )
  214. add_test(NAME FindPython.Python.V3.VERSION COMMAND
  215. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  216. --build-and-test
  217. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  218. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VERSION"
  219. ${build_generator_args}
  220. --build-project TestPython
  221. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  222. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  223. )
  224. add_test(NAME FindPython.Python3.ExactVersion.LOCATION COMMAND
  225. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  226. --build-and-test
  227. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  228. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.LOCATION"
  229. ${build_generator_args}
  230. --build-project TestExactVersion
  231. --build-options ${build_options} -DPython_MAJOR_VERSION=3
  232. -DPython_REQUESTED_VERSION=3.1.2
  233. -DPython3_FIND_STRATEGY=LOCATION
  234. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  235. )
  236. add_test(NAME FindPython.Python3.ExactVersion.VERSION COMMAND
  237. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  238. --build-and-test
  239. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  240. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.VERSION"
  241. ${build_generator_args}
  242. --build-project TestExactVersion
  243. --build-options ${build_options} -DPython_MAJOR_VERSION=3
  244. -DPython_REQUESTED_VERSION=3.1.2
  245. -DPython3_FIND_STRATEGY=VERSION
  246. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  247. )
  248. add_test(NAME FindPython.Python.V3.ExactVersion.LOCATION COMMAND
  249. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  250. --build-and-test
  251. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  252. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.LOCATION"
  253. ${build_generator_args}
  254. --build-project TestExactVersion
  255. --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
  256. -DPython_FIND_STRATEGY=LOCATION
  257. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  258. )
  259. add_test(NAME FindPython.Python.V3.ExactVersion.VERSION COMMAND
  260. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  261. --build-and-test
  262. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  263. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.VERSION"
  264. ${build_generator_args}
  265. --build-project TestExactVersion
  266. --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
  267. -DPython_FIND_STRATEGY=VERSION
  268. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  269. )
  270. add_test(NAME FindPython.Python3.VersionRange.LOCATION COMMAND
  271. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  272. --build-and-test
  273. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  274. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.LOCATION"
  275. ${build_generator_args}
  276. --build-project TestVersionRange
  277. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  278. -DPython3_FIND_STRATEGY=LOCATION
  279. )
  280. add_test(NAME FindPython.Python3.VersionRange.VERSION COMMAND
  281. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  282. --build-and-test
  283. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  284. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.VERSION"
  285. ${build_generator_args}
  286. --build-project TestVersionRange
  287. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  288. -DPython3_FIND_STRATEGY=VERSION
  289. )
  290. add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND
  291. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  292. --build-and-test
  293. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  294. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.LOCATION"
  295. ${build_generator_args}
  296. --build-project TestVersionRange
  297. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
  298. -DPython_FIND_STRATEGY=LOCATION
  299. )
  300. add_test(NAME FindPython.Python.V3.VersionRange.VERSION COMMAND
  301. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  302. --build-and-test
  303. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  304. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.VERSION"
  305. ${build_generator_args}
  306. --build-project TestVersionRange
  307. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
  308. -DPython_FIND_STRATEGY=VERSION
  309. )
  310. add_test(NAME FindPython.VirtualEnv COMMAND
  311. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  312. --build-and-test
  313. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnv"
  314. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnv"
  315. ${build_generator_args}
  316. --build-project TestVirtualEnv
  317. --build-options ${build_options}
  318. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  319. )
  320. add_test(NAME FindPython.Python3Embedded COMMAND
  321. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  322. --build-and-test
  323. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Embedded"
  324. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Embedded"
  325. ${build_generator_args}
  326. --build-project TestPython3Embedded
  327. --build-options ${build_options}
  328. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  329. )
  330. add_test(NAME FindPython.RequiredArtifacts COMMAND
  331. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  332. --build-and-test
  333. "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts"
  334. "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts"
  335. ${build_generator_args}
  336. --build-project TestRequiredArtifacts
  337. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  338. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  339. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  340. "-DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}"
  341. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  342. )
  343. add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND
  344. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  345. --build-and-test
  346. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
  347. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON"
  348. ${build_generator_args}
  349. --build-project TestArtifactsScope
  350. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  351. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  352. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  353. "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
  354. "-DPython3_ARTIFACTS_INTERACTIVE=ON"
  355. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  356. )
  357. add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND
  358. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  359. --build-and-test
  360. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
  361. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF"
  362. ${build_generator_args}
  363. --build-project TestArtifactsScope
  364. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  365. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  366. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  367. "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
  368. "-DPython3_ARTIFACTS_INTERACTIVE=OFF"
  369. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  370. )
  371. add_test(NAME FindPython.CustomFailureMessage COMMAND
  372. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  373. --build-and-test
  374. "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
  375. "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
  376. ${build_generator_args}
  377. --build-project TestCustomFailureMessage
  378. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  379. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  380. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  381. "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
  382. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  383. )
  384. add_test(NAME FindPython.DifferentComponents COMMAND
  385. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  386. --build-and-test
  387. "${CMake_SOURCE_DIR}/Tests/FindPython/DifferentComponents"
  388. "${CMake_BINARY_DIR}/Tests/FindPython/DifferentComponents"
  389. ${build_generator_args}
  390. --build-project DifferentComponents
  391. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  392. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  393. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  394. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  395. )
  396. if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
  397. add_test(NAME FindPython.UnversionedNames COMMAND
  398. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  399. --build-and-test
  400. "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames"
  401. "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames"
  402. ${build_generator_args}
  403. --build-project UnversionedNames
  404. --build-options ${build_options}
  405. )
  406. endif()
  407. endif()
  408. if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3)
  409. add_test(NAME FindPython.Python.LOCATION COMMAND
  410. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  411. --build-and-test
  412. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  413. "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION"
  414. ${build_generator_args}
  415. --build-project TestPython
  416. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  417. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  418. )
  419. add_test(NAME FindPython.Python.VERSION COMMAND
  420. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  421. --build-and-test
  422. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  423. "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION"
  424. ${build_generator_args}
  425. --build-project TestPython
  426. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  427. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  428. )
  429. if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
  430. add_test(NAME FindPython.Interpreter.SOABI COMMAND
  431. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  432. --build-and-test
  433. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  434. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
  435. ${build_generator_args}
  436. --build-project TestSOABI
  437. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  438. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  439. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  440. "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
  441. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  442. )
  443. add_test(NAME FindPython.Development.SOABI COMMAND
  444. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  445. --build-and-test
  446. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  447. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
  448. ${build_generator_args}
  449. --build-project TestSOABI
  450. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  451. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  452. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  453. "-DCMake_TEST_FindPython_COMPONENT=Development"
  454. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  455. )
  456. endif()
  457. add_test(NAME FindPython.MultiplePackages COMMAND
  458. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  459. --build-and-test
  460. "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages"
  461. "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages"
  462. ${build_generator_args}
  463. --build-project TestMultiplePackages
  464. --build-options ${build_options}
  465. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  466. )
  467. endif()
  468. if(CMake_TEST_FindPython2_SABIModule)
  469. add_test(NAME FindPython.Python2.Development.SABIModule COMMAND
  470. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  471. --build-and-test
  472. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2SABIModule"
  473. "${CMake_BINARY_DIR}/Tests/FindPython/Python2SABIModule"
  474. ${build_generator_args}
  475. --build-project TestPython2SABIModule
  476. --build-options ${build_options}
  477. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  478. )
  479. set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES
  480. PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule")
  481. endif()
  482. if(CMake_TEST_FindPython3_SABIModule)
  483. # Use exclusively Release configuration because Debug is, on Windows with MSVC,
  484. # unusable with SABI: Python force link with debug version of full versioned library rather than
  485. # the stable ABI one.
  486. add_test(NAME FindPython.Python3.Development.SABIModule COMMAND
  487. ${CMAKE_CTEST_COMMAND} -C Release
  488. --build-and-test
  489. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3SABIModule"
  490. "${CMake_BINARY_DIR}/Tests/FindPython/Python3SABIModule"
  491. ${build_generator_args}
  492. --build-project TestPython3SABIModule
  493. --build-options ${build_options}
  494. --test-command ${CMAKE_CTEST_COMMAND} -V -C Release
  495. )
  496. endif()
  497. if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy)
  498. add_test(NAME FindPython.NumPy COMMAND
  499. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  500. --build-and-test
  501. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
  502. "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
  503. ${build_generator_args}
  504. --build-project TestNumPy
  505. --build-options ${build_options}
  506. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  507. )
  508. add_test(NAME FindPython.NumPyOnly COMMAND
  509. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  510. --build-and-test
  511. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
  512. "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
  513. ${build_generator_args}
  514. --build-project TestNumPyOnly
  515. --build-options ${build_options}
  516. )
  517. endif()
  518. if(CMake_TEST_FindPython3_Conda)
  519. add_test(NAME FindPython.VirtualEnvConda COMMAND
  520. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  521. --build-and-test
  522. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
  523. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
  524. ${build_generator_args}
  525. --build-project TestVirtualEnvConda
  526. --build-options ${build_options}
  527. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  528. )
  529. endif()
  530. if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython)
  531. add_test(NAME FindPython.Implementation.CPython2 COMMAND
  532. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  533. --build-and-test
  534. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  535. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython2"
  536. ${build_generator_args}
  537. --build-project TestImplementationCPython
  538. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  539. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  540. )
  541. add_test(NAME FindPython.Implementation.IronPython2 COMMAND
  542. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  543. --build-and-test
  544. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  545. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython2"
  546. ${build_generator_args}
  547. --build-project TestImplementationIronPython
  548. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  549. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  550. )
  551. endif()
  552. if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython)
  553. add_test(NAME FindPython.Implementation.CPython3 COMMAND
  554. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  555. --build-and-test
  556. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  557. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython3"
  558. ${build_generator_args}
  559. --build-project TestImplementationCPython
  560. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  561. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  562. )
  563. add_test(NAME FindPython.Implementation.IronPython3 COMMAND
  564. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  565. --build-and-test
  566. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  567. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython3"
  568. ${build_generator_args}
  569. --build-project TestImplementationIronPython
  570. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  571. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  572. )
  573. endif()
  574. if(CMake_TEST_FindPython2_IronPython)
  575. add_test(NAME FindPython.IronPython2.LOCATION COMMAND
  576. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  577. --build-and-test
  578. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  579. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION"
  580. ${build_generator_args}
  581. --build-project TestIronPython2
  582. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  583. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  584. )
  585. add_test(NAME FindPython.IronPython2.VERSION COMMAND
  586. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  587. --build-and-test
  588. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  589. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION"
  590. ${build_generator_args}
  591. --build-project TestIronPython2
  592. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  593. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  594. )
  595. add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND
  596. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  597. --build-and-test
  598. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  599. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.LOCATION"
  600. ${build_generator_args}
  601. --build-project TestIronPython
  602. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  603. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  604. )
  605. add_test(NAME FindPython.IronPython.V2.VERSION COMMAND
  606. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  607. --build-and-test
  608. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  609. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.VERSION"
  610. ${build_generator_args}
  611. --build-project TestIronPython
  612. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  613. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  614. )
  615. add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
  616. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  617. --build-and-test
  618. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  619. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
  620. ${build_generator_args}
  621. --build-project TestVersionRange
  622. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  623. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  624. -DPython2_FIND_STRATEGY=LOCATION
  625. )
  626. add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
  627. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  628. --build-and-test
  629. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  630. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
  631. ${build_generator_args}
  632. --build-project TestVersionRange
  633. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  634. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  635. -DPython2_FIND_STRATEGY=VERSION
  636. )
  637. endif()
  638. if(CMake_TEST_FindPython3_IronPython)
  639. add_test(NAME FindPython.IronPython3.LOCATION COMMAND
  640. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  641. --build-and-test
  642. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
  643. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.LOCATION"
  644. ${build_generator_args}
  645. --build-project TestIronPython3
  646. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  647. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  648. )
  649. add_test(NAME FindPython.IronPython3.VERSION COMMAND
  650. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  651. --build-and-test
  652. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
  653. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VERSION"
  654. ${build_generator_args}
  655. --build-project TestIronPython3
  656. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  657. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  658. )
  659. add_test(NAME FindPython.IronPython.V3.LOCATION COMMAND
  660. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  661. --build-and-test
  662. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  663. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.LOCATION"
  664. ${build_generator_args}
  665. --build-project TestIronPython
  666. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  667. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  668. )
  669. add_test(NAME FindPython.IronPython.V3.VERSION COMMAND
  670. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  671. --build-and-test
  672. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  673. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.VERSION"
  674. ${build_generator_args}
  675. --build-project TestIronPython
  676. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  677. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  678. )
  679. add_test(NAME FindPython.IronPython3.VersionRange.LOCATION COMMAND
  680. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  681. --build-and-test
  682. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  683. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.LOCATION"
  684. ${build_generator_args}
  685. --build-project TestVersionRange
  686. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  687. -DPython3_FIND_IMPLEMENTATIONS=IronPython
  688. -DPython3_FIND_STRATEGY=LOCATION
  689. )
  690. add_test(NAME FindPython.IronPython3.VersionRange.VERSION COMMAND
  691. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  692. --build-and-test
  693. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  694. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.VERSION"
  695. ${build_generator_args}
  696. --build-project TestVersionRange
  697. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  698. -DPython3_FIND_IMPLEMENTATIONS=IronPython
  699. -DPython3_FIND_STRATEGY=VERSION
  700. )
  701. endif()
  702. if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython)
  703. add_test(NAME FindPython.IronPython.LOCATION COMMAND
  704. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  705. --build-and-test
  706. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  707. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION"
  708. ${build_generator_args}
  709. --build-project TestIronPython
  710. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  711. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  712. )
  713. add_test(NAME FindPython.IronPython.VERSION COMMAND
  714. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  715. --build-and-test
  716. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  717. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION"
  718. ${build_generator_args}
  719. --build-project TestIronPython
  720. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  721. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  722. )
  723. endif()
  724. if(CMake_TEST_FindPython2_PyPy)
  725. add_test(NAME FindPython.PyPy2.LOCATION COMMAND
  726. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  727. --build-and-test
  728. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  729. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
  730. ${build_generator_args}
  731. --build-project TestPyPy2
  732. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  733. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  734. )
  735. add_test(NAME FindPython.PyPy2.VERSION COMMAND
  736. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  737. --build-and-test
  738. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  739. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
  740. ${build_generator_args}
  741. --build-project TestPyPy2
  742. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  743. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  744. )
  745. add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
  746. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  747. --build-and-test
  748. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  749. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
  750. ${build_generator_args}
  751. --build-project TestPyPy
  752. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  753. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  754. )
  755. add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
  756. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  757. --build-and-test
  758. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  759. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
  760. ${build_generator_args}
  761. --build-project TestPyPy
  762. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  763. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  764. )
  765. endif()
  766. if(CMake_TEST_FindPython3_PyPy)
  767. add_test(NAME FindPython.PyPy3.LOCATION COMMAND
  768. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  769. --build-and-test
  770. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  771. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
  772. ${build_generator_args}
  773. --build-project TestPyPy3
  774. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  775. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  776. )
  777. add_test(NAME FindPython.PyPy3.VERSION COMMAND
  778. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  779. --build-and-test
  780. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  781. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
  782. ${build_generator_args}
  783. --build-project TestPyPy3
  784. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  785. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  786. )
  787. add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
  788. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  789. --build-and-test
  790. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  791. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
  792. ${build_generator_args}
  793. --build-project TestPyPy
  794. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  795. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  796. )
  797. add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
  798. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  799. --build-and-test
  800. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  801. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
  802. ${build_generator_args}
  803. --build-project TestPyPy
  804. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  805. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  806. )
  807. endif()
  808. if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy)
  809. add_test(NAME FindPython.PyPy.LOCATION COMMAND
  810. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  811. --build-and-test
  812. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  813. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
  814. ${build_generator_args}
  815. --build-project TestPyPy
  816. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  817. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  818. )
  819. add_test(NAME FindPython.PyPy.VERSION COMMAND
  820. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  821. --build-and-test
  822. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  823. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
  824. ${build_generator_args}
  825. --build-project TestPyPy
  826. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  827. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  828. )
  829. endif()