CMakeLists.txt 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704
  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. if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
  412. add_test(NAME FindPython.Interpreter.SOABI COMMAND
  413. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  414. --build-and-test
  415. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  416. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
  417. ${build_generator_args}
  418. --build-project TestSOABI
  419. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  420. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  421. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  422. "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
  423. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  424. )
  425. add_test(NAME FindPython.Development.SOABI COMMAND
  426. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  427. --build-and-test
  428. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  429. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
  430. ${build_generator_args}
  431. --build-project TestSOABI
  432. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  433. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  434. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  435. "-DCMake_TEST_FindPython_COMPONENT=Development"
  436. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  437. )
  438. endif()
  439. endif()
  440. if(CMake_TEST_FindPython_NumPy)
  441. add_test(NAME FindPython.NumPy COMMAND
  442. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  443. --build-and-test
  444. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
  445. "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
  446. ${build_generator_args}
  447. --build-project TestNumPy
  448. --build-options ${build_options}
  449. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  450. )
  451. add_test(NAME FindPython.NumPyOnly COMMAND
  452. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  453. --build-and-test
  454. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
  455. "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
  456. ${build_generator_args}
  457. --build-project TestNumPyOnly
  458. --build-options ${build_options}
  459. )
  460. endif()
  461. if(CMake_TEST_FindPython_Conda)
  462. add_test(NAME FindPython.VirtualEnvConda COMMAND
  463. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  464. --build-and-test
  465. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
  466. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
  467. ${build_generator_args}
  468. --build-project TestVirtualEnvConda
  469. --build-options ${build_options}
  470. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  471. )
  472. endif()
  473. if (CMake_TEST_FindPython AND CMake_TEST_FindPython_IronPython)
  474. add_test(NAME FindPython.Implementation.CPython COMMAND
  475. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  476. --build-and-test
  477. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  478. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython"
  479. ${build_generator_args}
  480. --build-project TestImplementationCPython
  481. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  482. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  483. )
  484. add_test(NAME FindPython.Implementation.IronPython COMMAND
  485. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  486. --build-and-test
  487. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  488. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython"
  489. ${build_generator_args}
  490. --build-project TestImplementationIronPython
  491. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  492. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  493. )
  494. endif()
  495. if(CMake_TEST_FindPython_IronPython)
  496. add_test(NAME FindPython.IronPython2.LOCATION COMMAND
  497. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  498. --build-and-test
  499. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  500. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION"
  501. ${build_generator_args}
  502. --build-project TestIronPython2
  503. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  504. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  505. )
  506. add_test(NAME FindPython.IronPython2.VERSION COMMAND
  507. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  508. --build-and-test
  509. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  510. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION"
  511. ${build_generator_args}
  512. --build-project TestIronPython2
  513. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  514. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  515. )
  516. add_test(NAME FindPython.IronPython.LOCATION COMMAND
  517. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  518. --build-and-test
  519. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  520. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION"
  521. ${build_generator_args}
  522. --build-project TestIronPython
  523. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  524. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  525. )
  526. add_test(NAME FindPython.IronPython.VERSION COMMAND
  527. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  528. --build-and-test
  529. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  530. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION"
  531. ${build_generator_args}
  532. --build-project TestIronPython
  533. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  534. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  535. )
  536. add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND
  537. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  538. --build-and-test
  539. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  540. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.LOCATION"
  541. ${build_generator_args}
  542. --build-project TestIronPython
  543. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  544. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  545. )
  546. add_test(NAME FindPython.IronPython.V2.VERSION COMMAND
  547. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  548. --build-and-test
  549. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  550. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.VERSION"
  551. ${build_generator_args}
  552. --build-project TestIronPython
  553. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  554. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  555. )
  556. add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
  557. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  558. --build-and-test
  559. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  560. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
  561. ${build_generator_args}
  562. --build-project TestVersionRange
  563. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  564. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  565. -DPython2_FIND_STRATEGY=LOCATION
  566. )
  567. add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
  568. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  569. --build-and-test
  570. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  571. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
  572. ${build_generator_args}
  573. --build-project TestVersionRange
  574. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  575. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  576. -DPython2_FIND_STRATEGY=VERSION
  577. )
  578. endif()
  579. if(CMake_TEST_FindPython_PyPy)
  580. add_test(NAME FindPython.PyPy2.LOCATION COMMAND
  581. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  582. --build-and-test
  583. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  584. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
  585. ${build_generator_args}
  586. --build-project TestPyPy2
  587. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  588. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  589. )
  590. add_test(NAME FindPython.PyPy2.VERSION COMMAND
  591. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  592. --build-and-test
  593. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  594. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
  595. ${build_generator_args}
  596. --build-project TestPyPy2
  597. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  598. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  599. )
  600. add_test(NAME FindPython.PyPy3.LOCATION COMMAND
  601. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  602. --build-and-test
  603. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  604. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
  605. ${build_generator_args}
  606. --build-project TestPyPy3
  607. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  608. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  609. )
  610. add_test(NAME FindPython.PyPy3.VERSION COMMAND
  611. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  612. --build-and-test
  613. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  614. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
  615. ${build_generator_args}
  616. --build-project TestPyPy3
  617. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  618. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  619. )
  620. add_test(NAME FindPython.PyPy.LOCATION COMMAND
  621. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  622. --build-and-test
  623. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  624. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
  625. ${build_generator_args}
  626. --build-project TestPyPy
  627. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  628. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  629. )
  630. add_test(NAME FindPython.PyPy.VERSION COMMAND
  631. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  632. --build-and-test
  633. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  634. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
  635. ${build_generator_args}
  636. --build-project TestPyPy
  637. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  638. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  639. )
  640. add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
  641. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  642. --build-and-test
  643. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  644. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
  645. ${build_generator_args}
  646. --build-project TestPyPy
  647. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  648. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  649. )
  650. add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
  651. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  652. --build-and-test
  653. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  654. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
  655. ${build_generator_args}
  656. --build-project TestPyPy
  657. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  658. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  659. )
  660. add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
  661. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  662. --build-and-test
  663. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  664. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
  665. ${build_generator_args}
  666. --build-project TestPyPy
  667. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  668. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  669. )
  670. add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
  671. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  672. --build-and-test
  673. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  674. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
  675. ${build_generator_args}
  676. --build-project TestPyPy
  677. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  678. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  679. )
  680. endif()