CMakeLists.txt 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. if(CMake_TEST_FindPython)
  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.Python3.LOCATION COMMAND
  45. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  46. --build-and-test
  47. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
  48. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.LOCATION"
  49. ${build_generator_args}
  50. --build-project TestPython3
  51. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  52. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  53. )
  54. add_test(NAME FindPython.Python3.VERSION COMMAND
  55. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  56. --build-and-test
  57. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
  58. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VERSION"
  59. ${build_generator_args}
  60. --build-project TestPython3
  61. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  62. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  63. )
  64. add_test(NAME FindPython.Python3.Development.Module COMMAND
  65. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  66. --build-and-test
  67. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Module"
  68. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Module"
  69. ${build_generator_args}
  70. --build-project TestPython3Module
  71. --build-options ${build_options}
  72. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  73. )
  74. add_test(NAME FindPython.Python3Fail COMMAND
  75. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  76. --build-and-test
  77. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
  78. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
  79. ${build_generator_args}
  80. --build-project TestPython3Fail
  81. --build-options ${build_options}
  82. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  83. )
  84. set_tests_properties(FindPython.Python3Fail PROPERTIES
  85. PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")
  86. add_test(NAME FindPython.Python.LOCATION COMMAND
  87. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  88. --build-and-test
  89. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  90. "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION"
  91. ${build_generator_args}
  92. --build-project TestPython
  93. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  94. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  95. )
  96. add_test(NAME FindPython.Python.VERSION COMMAND
  97. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  98. --build-and-test
  99. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  100. "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION"
  101. ${build_generator_args}
  102. --build-project TestPython
  103. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  104. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  105. )
  106. add_test(NAME FindPython.Python.V2.LOCATION COMMAND
  107. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  108. --build-and-test
  109. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  110. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.LOCATION"
  111. ${build_generator_args}
  112. --build-project TestPython
  113. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  114. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  115. )
  116. add_test(NAME FindPython.Python.V2.VERSION COMMAND
  117. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  118. --build-and-test
  119. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  120. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VERSION"
  121. ${build_generator_args}
  122. --build-project TestPython
  123. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  124. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  125. )
  126. add_test(NAME FindPython.Python.V3.LOCATION COMMAND
  127. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  128. --build-and-test
  129. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  130. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.LOCATION"
  131. ${build_generator_args}
  132. --build-project TestPython
  133. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  134. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  135. )
  136. add_test(NAME FindPython.Python.V3.VERSION COMMAND
  137. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  138. --build-and-test
  139. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  140. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VERSION"
  141. ${build_generator_args}
  142. --build-project TestPython
  143. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  144. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  145. )
  146. add_test(NAME FindPython.Python2.ExactVersion.LOCATION COMMAND
  147. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  148. --build-and-test
  149. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  150. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.LOCATION"
  151. ${build_generator_args}
  152. --build-project TestExactVersion
  153. --build-options ${build_options} -DPython_MAJOR_VERSION=2
  154. -DPython_REQUESTED_VERSION=2.1.2
  155. -DPython2_FIND_STRATEGY=LOCATION
  156. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  157. )
  158. add_test(NAME FindPython.Python2.ExactVersion.VERSION COMMAND
  159. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  160. --build-and-test
  161. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  162. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.ExactVersion.VERSION"
  163. ${build_generator_args}
  164. --build-project TestExactVersion
  165. --build-options ${build_options} -DPython_MAJOR_VERSION=2
  166. -DPython_REQUESTED_VERSION=2.1.2
  167. -DPython2_FIND_STRATEGY=VERSION
  168. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  169. )
  170. add_test(NAME FindPython.Python3.ExactVersion.LOCATION COMMAND
  171. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  172. --build-and-test
  173. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  174. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.LOCATION"
  175. ${build_generator_args}
  176. --build-project TestExactVersion
  177. --build-options ${build_options} -DPython_MAJOR_VERSION=3
  178. -DPython_REQUESTED_VERSION=3.1.2
  179. -DPython3_FIND_STRATEGY=LOCATION
  180. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  181. )
  182. add_test(NAME FindPython.Python3.ExactVersion.VERSION COMMAND
  183. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  184. --build-and-test
  185. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  186. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.VERSION"
  187. ${build_generator_args}
  188. --build-project TestExactVersion
  189. --build-options ${build_options} -DPython_MAJOR_VERSION=3
  190. -DPython_REQUESTED_VERSION=3.1.2
  191. -DPython3_FIND_STRATEGY=VERSION
  192. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  193. )
  194. add_test(NAME FindPython.Python.V2.ExactVersion.LOCATION COMMAND
  195. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  196. --build-and-test
  197. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  198. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.LOCATION"
  199. ${build_generator_args}
  200. --build-project TestExactVersion
  201. --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2
  202. -DPython_FIND_STRATEGY=LOCATION
  203. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  204. )
  205. add_test(NAME FindPython.Python.V2.ExactVersion.VERSION COMMAND
  206. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  207. --build-and-test
  208. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  209. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.ExactVersion.VERSION"
  210. ${build_generator_args}
  211. --build-project TestExactVersion
  212. --build-options ${build_options} -DPython_REQUESTED_VERSION=2.1.2
  213. -DPython_FIND_STRATEGY=VERSION
  214. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  215. )
  216. add_test(NAME FindPython.Python.V3.ExactVersion.LOCATION COMMAND
  217. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  218. --build-and-test
  219. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  220. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.LOCATION"
  221. ${build_generator_args}
  222. --build-project TestExactVersion
  223. --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
  224. -DPython_FIND_STRATEGY=LOCATION
  225. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  226. )
  227. add_test(NAME FindPython.Python.V3.ExactVersion.VERSION COMMAND
  228. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  229. --build-and-test
  230. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  231. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.VERSION"
  232. ${build_generator_args}
  233. --build-project TestExactVersion
  234. --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
  235. -DPython_FIND_STRATEGY=VERSION
  236. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  237. )
  238. add_test(NAME FindPython.Python3.VersionRange.LOCATION COMMAND
  239. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  240. --build-and-test
  241. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  242. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.LOCATION"
  243. ${build_generator_args}
  244. --build-project TestVersionRange
  245. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  246. -DPython3_FIND_STRATEGY=LOCATION
  247. )
  248. add_test(NAME FindPython.Python3.VersionRange.VERSION COMMAND
  249. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  250. --build-and-test
  251. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  252. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.VERSION"
  253. ${build_generator_args}
  254. --build-project TestVersionRange
  255. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  256. -DPython3_FIND_STRATEGY=VERSION
  257. )
  258. add_test(NAME FindPython.Python2.VersionRange.LOCATION COMMAND
  259. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  260. --build-and-test
  261. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  262. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.LOCATION"
  263. ${build_generator_args}
  264. --build-project TestVersionRange
  265. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  266. -DPython2_FIND_STRATEGY=LOCATION
  267. )
  268. add_test(NAME FindPython.Python2.VersionRange.VERSION COMMAND
  269. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  270. --build-and-test
  271. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  272. "${CMake_BINARY_DIR}/Tests/FindPython/Python2.VersionRange.VERSION"
  273. ${build_generator_args}
  274. --build-project TestVersionRange
  275. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  276. -DPython2_FIND_STRATEGY=VERSION
  277. )
  278. add_test(NAME FindPython.Python.V2.VersionRange.LOCATION COMMAND
  279. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  280. --build-and-test
  281. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  282. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.LOCATION"
  283. ${build_generator_args}
  284. --build-project TestVersionRange
  285. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
  286. -DPython_FIND_STRATEGY=LOCATION
  287. )
  288. add_test(NAME FindPython.Python.V2.VersionRange.VERSION COMMAND
  289. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  290. --build-and-test
  291. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  292. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V2.VersionRange.VERSION"
  293. ${build_generator_args}
  294. --build-project TestVersionRange
  295. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=2
  296. -DPython_FIND_STRATEGY=VERSION
  297. )
  298. add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND
  299. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  300. --build-and-test
  301. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  302. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.LOCATION"
  303. ${build_generator_args}
  304. --build-project TestVersionRange
  305. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
  306. -DPython_FIND_STRATEGY=LOCATION
  307. )
  308. add_test(NAME FindPython.Python.V3.VersionRange.VERSION COMMAND
  309. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  310. --build-and-test
  311. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  312. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.VERSION"
  313. ${build_generator_args}
  314. --build-project TestVersionRange
  315. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
  316. -DPython_FIND_STRATEGY=VERSION
  317. )
  318. add_test(NAME FindPython.MultiplePackages COMMAND
  319. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  320. --build-and-test
  321. "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages"
  322. "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages"
  323. ${build_generator_args}
  324. --build-project TestMultiplePackages
  325. --build-options ${build_options}
  326. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  327. )
  328. add_test(NAME FindPython.VirtualEnv COMMAND
  329. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  330. --build-and-test
  331. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnv"
  332. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnv"
  333. ${build_generator_args}
  334. --build-project TestVirtualEnv
  335. --build-options ${build_options}
  336. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  337. )
  338. add_test(NAME FindPython.Python2Embedded COMMAND
  339. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  340. --build-and-test
  341. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Embedded"
  342. "${CMake_BINARY_DIR}/Tests/FindPython/Python2Embedded"
  343. ${build_generator_args}
  344. --build-project TestPython2Embedded
  345. --build-options ${build_options}
  346. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  347. )
  348. add_test(NAME FindPython.Python3Embedded COMMAND
  349. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  350. --build-and-test
  351. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Embedded"
  352. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Embedded"
  353. ${build_generator_args}
  354. --build-project TestPython3Embedded
  355. --build-options ${build_options}
  356. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  357. )
  358. add_test(NAME FindPython.RequiredArtifacts COMMAND
  359. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  360. --build-and-test
  361. "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts"
  362. "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts"
  363. ${build_generator_args}
  364. --build-project TestRequiredArtifacts
  365. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  366. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  367. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  368. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  369. )
  370. add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND
  371. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  372. --build-and-test
  373. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
  374. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON"
  375. ${build_generator_args}
  376. --build-project TestArtifactsScope
  377. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  378. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  379. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  380. "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
  381. "-DPython3_ARTIFACTS_INTERACTIVE=ON"
  382. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  383. )
  384. add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND
  385. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  386. --build-and-test
  387. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
  388. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF"
  389. ${build_generator_args}
  390. --build-project TestArtifactsScope
  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. "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
  395. "-DPython3_ARTIFACTS_INTERACTIVE=OFF"
  396. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  397. )
  398. add_test(NAME FindPython.CustomFailureMessage COMMAND
  399. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  400. --build-and-test
  401. "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
  402. "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
  403. ${build_generator_args}
  404. --build-project TestCustomFailureMessage
  405. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  406. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  407. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  408. "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
  409. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  410. )
  411. add_test(NAME FindPython.DifferentComponents COMMAND
  412. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  413. --build-and-test
  414. "${CMake_SOURCE_DIR}/Tests/FindPython/DifferentComponents"
  415. "${CMake_BINARY_DIR}/Tests/FindPython/DifferentComponents"
  416. ${build_generator_args}
  417. --build-project DifferentComponents
  418. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  419. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  420. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  421. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  422. )
  423. if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
  424. add_test(NAME FindPython.Interpreter.SOABI COMMAND
  425. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  426. --build-and-test
  427. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  428. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
  429. ${build_generator_args}
  430. --build-project TestSOABI
  431. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  432. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  433. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  434. "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
  435. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  436. )
  437. add_test(NAME FindPython.Development.SOABI COMMAND
  438. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  439. --build-and-test
  440. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  441. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
  442. ${build_generator_args}
  443. --build-project TestSOABI
  444. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  445. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  446. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  447. "-DCMake_TEST_FindPython_COMPONENT=Development"
  448. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  449. )
  450. endif()
  451. if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
  452. add_test(NAME FindPython.UnversionedNames COMMAND
  453. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  454. --build-and-test
  455. "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames"
  456. "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames"
  457. ${build_generator_args}
  458. --build-project UnversionedNames
  459. --build-options ${build_options}
  460. )
  461. endif()
  462. endif()
  463. if(CMake_TEST_FindPython_NumPy)
  464. add_test(NAME FindPython.NumPy COMMAND
  465. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  466. --build-and-test
  467. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
  468. "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
  469. ${build_generator_args}
  470. --build-project TestNumPy
  471. --build-options ${build_options}
  472. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  473. )
  474. add_test(NAME FindPython.NumPyOnly COMMAND
  475. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  476. --build-and-test
  477. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
  478. "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
  479. ${build_generator_args}
  480. --build-project TestNumPyOnly
  481. --build-options ${build_options}
  482. )
  483. endif()
  484. if(CMake_TEST_FindPython_Conda)
  485. add_test(NAME FindPython.VirtualEnvConda COMMAND
  486. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  487. --build-and-test
  488. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
  489. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
  490. ${build_generator_args}
  491. --build-project TestVirtualEnvConda
  492. --build-options ${build_options}
  493. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  494. )
  495. endif()
  496. if (CMake_TEST_FindPython AND CMake_TEST_FindPython_IronPython)
  497. add_test(NAME FindPython.Implementation.CPython COMMAND
  498. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  499. --build-and-test
  500. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  501. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython"
  502. ${build_generator_args}
  503. --build-project TestImplementationCPython
  504. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  505. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  506. )
  507. add_test(NAME FindPython.Implementation.IronPython COMMAND
  508. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  509. --build-and-test
  510. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  511. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython"
  512. ${build_generator_args}
  513. --build-project TestImplementationIronPython
  514. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  515. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  516. )
  517. endif()
  518. if(CMake_TEST_FindPython_IronPython)
  519. add_test(NAME FindPython.IronPython2.LOCATION COMMAND
  520. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  521. --build-and-test
  522. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  523. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION"
  524. ${build_generator_args}
  525. --build-project TestIronPython2
  526. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  527. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  528. )
  529. add_test(NAME FindPython.IronPython2.VERSION COMMAND
  530. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  531. --build-and-test
  532. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  533. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION"
  534. ${build_generator_args}
  535. --build-project TestIronPython2
  536. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  537. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  538. )
  539. add_test(NAME FindPython.IronPython.LOCATION COMMAND
  540. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  541. --build-and-test
  542. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  543. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION"
  544. ${build_generator_args}
  545. --build-project TestIronPython
  546. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  547. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  548. )
  549. add_test(NAME FindPython.IronPython.VERSION COMMAND
  550. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  551. --build-and-test
  552. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  553. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION"
  554. ${build_generator_args}
  555. --build-project TestIronPython
  556. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  557. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  558. )
  559. add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND
  560. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  561. --build-and-test
  562. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  563. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.LOCATION"
  564. ${build_generator_args}
  565. --build-project TestIronPython
  566. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  567. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  568. )
  569. add_test(NAME FindPython.IronPython.V2.VERSION COMMAND
  570. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  571. --build-and-test
  572. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  573. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.VERSION"
  574. ${build_generator_args}
  575. --build-project TestIronPython
  576. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  577. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  578. )
  579. add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
  580. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  581. --build-and-test
  582. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  583. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
  584. ${build_generator_args}
  585. --build-project TestVersionRange
  586. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  587. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  588. -DPython2_FIND_STRATEGY=LOCATION
  589. )
  590. add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
  591. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  592. --build-and-test
  593. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  594. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
  595. ${build_generator_args}
  596. --build-project TestVersionRange
  597. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  598. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  599. -DPython2_FIND_STRATEGY=VERSION
  600. )
  601. endif()
  602. if(CMake_TEST_FindPython_PyPy)
  603. add_test(NAME FindPython.PyPy2.LOCATION COMMAND
  604. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  605. --build-and-test
  606. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  607. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
  608. ${build_generator_args}
  609. --build-project TestPyPy2
  610. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  611. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  612. )
  613. add_test(NAME FindPython.PyPy2.VERSION COMMAND
  614. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  615. --build-and-test
  616. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  617. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
  618. ${build_generator_args}
  619. --build-project TestPyPy2
  620. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  621. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  622. )
  623. add_test(NAME FindPython.PyPy3.LOCATION COMMAND
  624. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  625. --build-and-test
  626. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  627. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
  628. ${build_generator_args}
  629. --build-project TestPyPy3
  630. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  631. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  632. )
  633. add_test(NAME FindPython.PyPy3.VERSION COMMAND
  634. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  635. --build-and-test
  636. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  637. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
  638. ${build_generator_args}
  639. --build-project TestPyPy3
  640. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  641. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  642. )
  643. add_test(NAME FindPython.PyPy.LOCATION COMMAND
  644. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  645. --build-and-test
  646. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  647. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
  648. ${build_generator_args}
  649. --build-project TestPyPy
  650. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  651. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  652. )
  653. add_test(NAME FindPython.PyPy.VERSION COMMAND
  654. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  655. --build-and-test
  656. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  657. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
  658. ${build_generator_args}
  659. --build-project TestPyPy
  660. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  661. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  662. )
  663. add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
  664. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  665. --build-and-test
  666. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  667. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
  668. ${build_generator_args}
  669. --build-project TestPyPy
  670. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  671. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  672. )
  673. add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
  674. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  675. --build-and-test
  676. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  677. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
  678. ${build_generator_args}
  679. --build-project TestPyPy
  680. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  681. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  682. )
  683. add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
  684. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  685. --build-and-test
  686. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  687. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
  688. ${build_generator_args}
  689. --build-project TestPyPy
  690. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  691. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  692. )
  693. add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
  694. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  695. --build-and-test
  696. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  697. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
  698. ${build_generator_args}
  699. --build-project TestPyPy
  700. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  701. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  702. )
  703. endif()