CMakeLists.txt 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940
  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. set_property(TEST FindPython.Python2.LOCATION FindPython.Python2.VERSION
  161. FindPython.Python2.Development.Module FindPython.Python2Fail
  162. FindPython.Python.V2.LOCATION FindPython.Python.V2.VERSION
  163. FindPython.Python2.ExactVersion.LOCATION FindPython.Python2.ExactVersion.VERSION
  164. FindPython.Python.V2.ExactVersion.LOCATION FindPython.Python.V2.ExactVersion.VERSION
  165. FindPython.Python2.VersionRange.LOCATION FindPython.Python2.VersionRange.VERSION
  166. FindPython.Python.V2.VersionRange.LOCATION FindPython.Python.V2.VersionRange.VERSION
  167. FindPython.Python2Embedded
  168. APPEND PROPERTY LABELS Python2)
  169. endif()
  170. if(CMake_TEST_FindPython3)
  171. add_test(NAME FindPython.Python3.LOCATION COMMAND
  172. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  173. --build-and-test
  174. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
  175. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.LOCATION"
  176. ${build_generator_args}
  177. --build-project TestPython3
  178. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  179. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  180. )
  181. add_test(NAME FindPython.Python3.VERSION COMMAND
  182. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  183. --build-and-test
  184. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
  185. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VERSION"
  186. ${build_generator_args}
  187. --build-project TestPython3
  188. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  189. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  190. )
  191. add_test(NAME FindPython.Python3.Development.Module COMMAND
  192. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  193. --build-and-test
  194. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Module"
  195. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Module"
  196. ${build_generator_args}
  197. --build-project TestPython3Module
  198. --build-options ${build_options}
  199. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  200. )
  201. add_test(NAME FindPython.Python3Fail COMMAND
  202. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  203. --build-and-test
  204. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
  205. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
  206. ${build_generator_args}
  207. --build-project TestPython3Fail
  208. --build-options ${build_options}
  209. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  210. )
  211. set_tests_properties(FindPython.Python3Fail PROPERTIES
  212. PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")
  213. add_test(NAME FindPython.Python.V3.LOCATION COMMAND
  214. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  215. --build-and-test
  216. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  217. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.LOCATION"
  218. ${build_generator_args}
  219. --build-project TestPython
  220. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  221. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  222. )
  223. add_test(NAME FindPython.Python.V3.VERSION COMMAND
  224. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  225. --build-and-test
  226. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  227. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VERSION"
  228. ${build_generator_args}
  229. --build-project TestPython
  230. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  231. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  232. )
  233. add_test(NAME FindPython.Python3.ExactVersion.LOCATION COMMAND
  234. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  235. --build-and-test
  236. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  237. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.LOCATION"
  238. ${build_generator_args}
  239. --build-project TestExactVersion
  240. --build-options ${build_options} -DPython_MAJOR_VERSION=3
  241. -DPython_REQUESTED_VERSION=3.1.2
  242. -DPython3_FIND_STRATEGY=LOCATION
  243. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  244. )
  245. add_test(NAME FindPython.Python3.ExactVersion.VERSION COMMAND
  246. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  247. --build-and-test
  248. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  249. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.ExactVersion.VERSION"
  250. ${build_generator_args}
  251. --build-project TestExactVersion
  252. --build-options ${build_options} -DPython_MAJOR_VERSION=3
  253. -DPython_REQUESTED_VERSION=3.1.2
  254. -DPython3_FIND_STRATEGY=VERSION
  255. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  256. )
  257. add_test(NAME FindPython.Python.V3.ExactVersion.LOCATION COMMAND
  258. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  259. --build-and-test
  260. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  261. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.LOCATION"
  262. ${build_generator_args}
  263. --build-project TestExactVersion
  264. --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
  265. -DPython_FIND_STRATEGY=LOCATION
  266. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  267. )
  268. add_test(NAME FindPython.Python.V3.ExactVersion.VERSION COMMAND
  269. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  270. --build-and-test
  271. "${CMake_SOURCE_DIR}/Tests/FindPython/ExactVersion"
  272. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.ExactVersion.VERSION"
  273. ${build_generator_args}
  274. --build-project TestExactVersion
  275. --build-options ${build_options} -DPython_REQUESTED_VERSION=3.1.2
  276. -DPython_FIND_STRATEGY=VERSION
  277. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  278. )
  279. add_test(NAME FindPython.Python3.VersionRange.LOCATION COMMAND
  280. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  281. --build-and-test
  282. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  283. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.LOCATION"
  284. ${build_generator_args}
  285. --build-project TestVersionRange
  286. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  287. -DPython3_FIND_STRATEGY=LOCATION
  288. )
  289. add_test(NAME FindPython.Python3.VersionRange.VERSION COMMAND
  290. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  291. --build-and-test
  292. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  293. "${CMake_BINARY_DIR}/Tests/FindPython/Python3.VersionRange.VERSION"
  294. ${build_generator_args}
  295. --build-project TestVersionRange
  296. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  297. -DPython3_FIND_STRATEGY=VERSION
  298. )
  299. add_test(NAME FindPython.Python.V3.VersionRange.LOCATION COMMAND
  300. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  301. --build-and-test
  302. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  303. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.LOCATION"
  304. ${build_generator_args}
  305. --build-project TestVersionRange
  306. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
  307. -DPython_FIND_STRATEGY=LOCATION
  308. )
  309. add_test(NAME FindPython.Python.V3.VersionRange.VERSION COMMAND
  310. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  311. --build-and-test
  312. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  313. "${CMake_BINARY_DIR}/Tests/FindPython/Python.V3.VersionRange.VERSION"
  314. ${build_generator_args}
  315. --build-project TestVersionRange
  316. --build-options ${build_options} -DPython=Python -DPython_REQUESTED_VERSION=3
  317. -DPython_FIND_STRATEGY=VERSION
  318. )
  319. add_test(NAME FindPython.VirtualEnv COMMAND
  320. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  321. --build-and-test
  322. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnv"
  323. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnv"
  324. ${build_generator_args}
  325. --build-project TestVirtualEnv
  326. --build-options ${build_options}
  327. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  328. )
  329. if(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "4.8")
  330. add_test(NAME FindPython.Python3Embedded COMMAND
  331. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  332. --build-and-test
  333. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Embedded"
  334. "${CMake_BINARY_DIR}/Tests/FindPython/Python3Embedded"
  335. ${build_generator_args}
  336. --build-project TestPython3Embedded
  337. --build-options ${build_options}
  338. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  339. )
  340. endif()
  341. add_test(NAME FindPython.RequiredArtifacts COMMAND
  342. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  343. --build-and-test
  344. "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts"
  345. "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts"
  346. ${build_generator_args}
  347. --build-project TestRequiredArtifacts
  348. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  349. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  350. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  351. "-DCMake_TEST_FindPython3_SABIModule=${CMake_TEST_FindPython3_SABIModule}"
  352. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  353. )
  354. add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND
  355. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  356. --build-and-test
  357. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
  358. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON"
  359. ${build_generator_args}
  360. --build-project TestArtifactsScope
  361. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  362. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  363. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  364. "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
  365. "-DPython3_ARTIFACTS_INTERACTIVE=ON"
  366. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  367. )
  368. add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND
  369. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  370. --build-and-test
  371. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
  372. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF"
  373. ${build_generator_args}
  374. --build-project TestArtifactsScope
  375. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  376. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  377. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  378. "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
  379. "-DPython3_ARTIFACTS_INTERACTIVE=OFF"
  380. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  381. )
  382. add_test(NAME FindPython.CustomFailureMessage COMMAND
  383. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  384. --build-and-test
  385. "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
  386. "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
  387. ${build_generator_args}
  388. --build-project TestCustomFailureMessage
  389. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  390. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  391. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  392. "-DCMake_TEST_FindPython3_NumPy=${CMake_TEST_FindPython3_NumPy}"
  393. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  394. )
  395. add_test(NAME FindPython.DifferentComponents COMMAND
  396. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  397. --build-and-test
  398. "${CMake_SOURCE_DIR}/Tests/FindPython/DifferentComponents"
  399. "${CMake_BINARY_DIR}/Tests/FindPython/DifferentComponents"
  400. ${build_generator_args}
  401. --build-project DifferentComponents
  402. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  403. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  404. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  405. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  406. )
  407. set_property(TEST FindPython.Python3.LOCATION FindPython.Python3.VERSION
  408. FindPython.Python3.Development.Module FindPython.Python3Fail
  409. FindPython.Python.V3.LOCATION FindPython.Python.V3.VERSION
  410. FindPython.Python3.ExactVersion.LOCATION FindPython.Python3.ExactVersion.VERSION
  411. FindPython.Python.V3.ExactVersion.LOCATION FindPython.Python.V3.ExactVersion.VERSION
  412. FindPython.Python3.VersionRange.LOCATION FindPython.Python3.VersionRange.VERSION
  413. FindPython.Python.V3.VersionRange.LOCATION FindPython.Python.V3.VersionRange.VERSION
  414. FindPython.VirtualEnv FindPython.RequiredArtifacts
  415. FindPython.ArtifactsInteractive.ON FindPython.ArtifactsInteractive.OFF
  416. FindPython.CustomFailureMessage FindPython.DifferentComponents
  417. APPEND PROPERTY LABELS Python3)
  418. if(TEST FindPython.Python3Embedded)
  419. set_property(TEST FindPython.Python3Embedded APPEND PROPERTY LABELS Python3)
  420. endif()
  421. if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
  422. add_test(NAME FindPython.UnversionedNames COMMAND
  423. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  424. --build-and-test
  425. "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames"
  426. "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames"
  427. ${build_generator_args}
  428. --build-project UnversionedNames
  429. --build-options ${build_options}
  430. )
  431. set_property(TEST FindPython.UnversionedNames APPEND PROPERTY LABELS Python3)
  432. endif()
  433. endif()
  434. if(CMake_TEST_FindPython2 OR CMake_TEST_FindPython3)
  435. add_test(NAME FindPython.Python.LOCATION COMMAND
  436. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  437. --build-and-test
  438. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  439. "${CMake_BINARY_DIR}/Tests/FindPython/Python.LOCATION"
  440. ${build_generator_args}
  441. --build-project TestPython
  442. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  443. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  444. )
  445. add_test(NAME FindPython.Python.VERSION COMMAND
  446. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  447. --build-and-test
  448. "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
  449. "${CMake_BINARY_DIR}/Tests/FindPython/Python.VERSION"
  450. ${build_generator_args}
  451. --build-project TestPython
  452. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  453. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  454. )
  455. if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
  456. add_test(NAME FindPython.Interpreter.SOABI COMMAND
  457. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  458. --build-and-test
  459. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  460. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
  461. ${build_generator_args}
  462. --build-project TestSOABI
  463. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  464. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  465. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  466. "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
  467. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  468. )
  469. add_test(NAME FindPython.Development.SOABI COMMAND
  470. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  471. --build-and-test
  472. "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
  473. "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
  474. ${build_generator_args}
  475. --build-project TestSOABI
  476. --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
  477. "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
  478. "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
  479. "-DCMake_TEST_FindPython_COMPONENT=Development"
  480. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  481. )
  482. set_property(TEST FindPython.Interpreter.SOABI FindPython.Development.SOABI
  483. APPEND PROPERTY LABELS Python2 Python3)
  484. endif()
  485. add_test(NAME FindPython.MultiplePackages COMMAND
  486. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  487. --build-and-test
  488. "${CMake_SOURCE_DIR}/Tests/FindPython/MultiplePackages"
  489. "${CMake_BINARY_DIR}/Tests/FindPython/MultiplePackages"
  490. ${build_generator_args}
  491. --build-project TestMultiplePackages
  492. --build-options ${build_options}
  493. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  494. )
  495. set_property(TEST FindPython.Python.LOCATION FindPython.Python.VERSION FindPython.MultiplePackages
  496. APPEND PROPERTY LABELS Python2 Python3)
  497. endif()
  498. if(CMake_TEST_FindPython2_SABIModule)
  499. add_test(NAME FindPython.Python2.Development.SABIModule COMMAND
  500. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  501. --build-and-test
  502. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2SABIModule"
  503. "${CMake_BINARY_DIR}/Tests/FindPython/Python2SABIModule"
  504. ${build_generator_args}
  505. --build-project TestPython2SABIModule
  506. --build-options ${build_options}
  507. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  508. )
  509. set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES
  510. PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule")
  511. set_property(TEST FindPython.Python2.Development.SABIModule APPEND PROPERTY LABELS Python2)
  512. endif()
  513. if(CMake_TEST_FindPython3_SABIModule)
  514. # Use exclusively Release configuration because Debug is, on Windows with MSVC,
  515. # unusable with SABI: Python force link with debug version of full versioned library rather than
  516. # the stable ABI one.
  517. add_test(NAME FindPython.Python3.Development.SABIModule COMMAND
  518. ${CMAKE_CTEST_COMMAND} -C Release
  519. --build-and-test
  520. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3SABIModule"
  521. "${CMake_BINARY_DIR}/Tests/FindPython/Python3SABIModule"
  522. ${build_generator_args}
  523. --build-project TestPython3SABIModule
  524. --build-options ${build_options}
  525. --test-command ${CMAKE_CTEST_COMMAND} -V -C Release
  526. )
  527. set_property(TEST FindPython.Python3.Development.SABIModule APPEND PROPERTY LABELS Python3)
  528. endif()
  529. if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy)
  530. add_test(NAME FindPython.NumPy COMMAND
  531. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  532. --build-and-test
  533. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
  534. "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
  535. ${build_generator_args}
  536. --build-project TestNumPy
  537. --build-options ${build_options}
  538. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  539. )
  540. add_test(NAME FindPython.NumPyOnly COMMAND
  541. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  542. --build-and-test
  543. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
  544. "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
  545. ${build_generator_args}
  546. --build-project TestNumPyOnly
  547. --build-options ${build_options}
  548. )
  549. set_property(TEST FindPython.NumPy FindPython.NumPyOnly APPEND PROPERTY LABELS Python2 Python3)
  550. endif()
  551. if(CMake_TEST_FindPython3_Conda)
  552. add_test(NAME FindPython.VirtualEnvConda COMMAND
  553. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  554. --build-and-test
  555. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
  556. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
  557. ${build_generator_args}
  558. --build-project TestVirtualEnvConda
  559. --build-options ${build_options}
  560. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  561. )
  562. set_property(TEST FindPython.VirtualEnvConda APPEND PROPERTY LABELS Python3)
  563. endif()
  564. if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython)
  565. add_test(NAME FindPython.Implementation.CPython2 COMMAND
  566. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  567. --build-and-test
  568. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  569. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython2"
  570. ${build_generator_args}
  571. --build-project TestImplementationCPython
  572. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  573. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  574. )
  575. add_test(NAME FindPython.Implementation.IronPython2 COMMAND
  576. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  577. --build-and-test
  578. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  579. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython2"
  580. ${build_generator_args}
  581. --build-project TestImplementationIronPython
  582. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  583. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  584. )
  585. set_property(TEST FindPython.Implementation.CPython2 FindPython.Implementation.IronPython2
  586. APPEND PROPERTY LABELS Python2)
  587. endif()
  588. if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython)
  589. add_test(NAME FindPython.Implementation.CPython3 COMMAND
  590. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  591. --build-and-test
  592. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  593. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython3"
  594. ${build_generator_args}
  595. --build-project TestImplementationCPython
  596. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  597. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  598. )
  599. add_test(NAME FindPython.Implementation.IronPython3 COMMAND
  600. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  601. --build-and-test
  602. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  603. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython3"
  604. ${build_generator_args}
  605. --build-project TestImplementationIronPython
  606. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  607. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  608. )
  609. set_property(TEST FindPython.Implementation.CPython3 FindPython.Implementation.IronPython3
  610. APPEND PROPERTY LABELS Python3)
  611. endif()
  612. if(CMake_TEST_FindPython2_IronPython)
  613. add_test(NAME FindPython.IronPython2.LOCATION COMMAND
  614. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  615. --build-and-test
  616. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  617. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION"
  618. ${build_generator_args}
  619. --build-project TestIronPython2
  620. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  621. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  622. )
  623. add_test(NAME FindPython.IronPython2.VERSION COMMAND
  624. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  625. --build-and-test
  626. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  627. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION"
  628. ${build_generator_args}
  629. --build-project TestIronPython2
  630. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  631. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  632. )
  633. add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND
  634. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  635. --build-and-test
  636. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  637. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.LOCATION"
  638. ${build_generator_args}
  639. --build-project TestIronPython
  640. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  641. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  642. )
  643. add_test(NAME FindPython.IronPython.V2.VERSION COMMAND
  644. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  645. --build-and-test
  646. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  647. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.VERSION"
  648. ${build_generator_args}
  649. --build-project TestIronPython
  650. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  651. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  652. )
  653. add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
  654. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  655. --build-and-test
  656. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  657. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
  658. ${build_generator_args}
  659. --build-project TestVersionRange
  660. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  661. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  662. -DPython2_FIND_STRATEGY=LOCATION
  663. )
  664. add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
  665. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  666. --build-and-test
  667. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  668. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
  669. ${build_generator_args}
  670. --build-project TestVersionRange
  671. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  672. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  673. -DPython2_FIND_STRATEGY=VERSION
  674. )
  675. set_property(TEST FindPython.IronPython2.LOCATION FindPython.IronPython2.VERSION
  676. FindPython.IronPython.V2.LOCATION FindPython.IronPython.V2.VERSION
  677. FindPython.IronPython2.VersionRange.LOCATION FindPython.IronPython2.VersionRange.VERSION
  678. APPEND PROPERTY LABELS Python2)
  679. endif()
  680. if(CMake_TEST_FindPython3_IronPython)
  681. add_test(NAME FindPython.IronPython3.LOCATION COMMAND
  682. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  683. --build-and-test
  684. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
  685. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.LOCATION"
  686. ${build_generator_args}
  687. --build-project TestIronPython3
  688. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  689. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  690. )
  691. add_test(NAME FindPython.IronPython3.VERSION COMMAND
  692. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  693. --build-and-test
  694. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
  695. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VERSION"
  696. ${build_generator_args}
  697. --build-project TestIronPython3
  698. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  699. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  700. )
  701. add_test(NAME FindPython.IronPython.V3.LOCATION COMMAND
  702. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  703. --build-and-test
  704. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  705. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.LOCATION"
  706. ${build_generator_args}
  707. --build-project TestIronPython
  708. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  709. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  710. )
  711. add_test(NAME FindPython.IronPython.V3.VERSION COMMAND
  712. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  713. --build-and-test
  714. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  715. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.VERSION"
  716. ${build_generator_args}
  717. --build-project TestIronPython
  718. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  719. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  720. )
  721. add_test(NAME FindPython.IronPython3.VersionRange.LOCATION COMMAND
  722. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  723. --build-and-test
  724. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  725. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.LOCATION"
  726. ${build_generator_args}
  727. --build-project TestVersionRange
  728. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  729. -DPython3_FIND_IMPLEMENTATIONS=IronPython
  730. -DPython3_FIND_STRATEGY=LOCATION
  731. )
  732. add_test(NAME FindPython.IronPython3.VersionRange.VERSION COMMAND
  733. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  734. --build-and-test
  735. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  736. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.VERSION"
  737. ${build_generator_args}
  738. --build-project TestVersionRange
  739. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  740. -DPython3_FIND_IMPLEMENTATIONS=IronPython
  741. -DPython3_FIND_STRATEGY=VERSION
  742. )
  743. set_property(TEST FindPython.IronPython3.LOCATION FindPython.IronPython3.VERSION
  744. FindPython.IronPython.V3.LOCATION FindPython.IronPython.V3.VERSION
  745. FindPython.IronPython3.VersionRange.LOCATION FindPython.IronPython3.VersionRange.VERSION
  746. APPEND PROPERTY LABELS Python3)
  747. endif()
  748. if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython)
  749. add_test(NAME FindPython.IronPython.LOCATION COMMAND
  750. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  751. --build-and-test
  752. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  753. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION"
  754. ${build_generator_args}
  755. --build-project TestIronPython
  756. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  757. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  758. )
  759. add_test(NAME FindPython.IronPython.VERSION COMMAND
  760. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  761. --build-and-test
  762. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  763. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION"
  764. ${build_generator_args}
  765. --build-project TestIronPython
  766. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  767. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  768. )
  769. set_property(TEST FindPython.IronPython.LOCATION FindPython.IronPython.VERSION
  770. APPEND PROPERTY LABELS Python2 Python3)
  771. endif()
  772. if(CMake_TEST_FindPython2_PyPy)
  773. add_test(NAME FindPython.PyPy2.LOCATION COMMAND
  774. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  775. --build-and-test
  776. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  777. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
  778. ${build_generator_args}
  779. --build-project TestPyPy2
  780. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  781. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  782. )
  783. add_test(NAME FindPython.PyPy2.VERSION COMMAND
  784. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  785. --build-and-test
  786. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  787. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
  788. ${build_generator_args}
  789. --build-project TestPyPy2
  790. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  791. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  792. )
  793. add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
  794. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  795. --build-and-test
  796. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  797. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
  798. ${build_generator_args}
  799. --build-project TestPyPy
  800. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  801. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  802. )
  803. add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
  804. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  805. --build-and-test
  806. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  807. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
  808. ${build_generator_args}
  809. --build-project TestPyPy
  810. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  811. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  812. )
  813. set_property(TEST FindPython.PyPy2.LOCATION FindPython.PyPy2.VERSION
  814. FindPython.PyPy.V2.LOCATION FindPython.PyPy.V2.VERSION
  815. APPEND PROPERTY LABELS Python2)
  816. endif()
  817. if(CMake_TEST_FindPython3_PyPy)
  818. add_test(NAME FindPython.PyPy3.LOCATION COMMAND
  819. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  820. --build-and-test
  821. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  822. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
  823. ${build_generator_args}
  824. --build-project TestPyPy3
  825. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  826. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  827. )
  828. add_test(NAME FindPython.PyPy3.VERSION COMMAND
  829. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  830. --build-and-test
  831. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  832. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
  833. ${build_generator_args}
  834. --build-project TestPyPy3
  835. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  836. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  837. )
  838. add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
  839. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  840. --build-and-test
  841. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  842. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
  843. ${build_generator_args}
  844. --build-project TestPyPy
  845. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  846. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  847. )
  848. add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
  849. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  850. --build-and-test
  851. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  852. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
  853. ${build_generator_args}
  854. --build-project TestPyPy
  855. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  856. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  857. )
  858. set_property(TEST FindPython.PyPy3.LOCATION FindPython.PyPy3.VERSION
  859. FindPython.PyPy.V3.LOCATION FindPython.PyPy.V3.VERSION
  860. APPEND PROPERTY LABELS Python3)
  861. endif()
  862. if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy)
  863. add_test(NAME FindPython.PyPy.LOCATION COMMAND
  864. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  865. --build-and-test
  866. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  867. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
  868. ${build_generator_args}
  869. --build-project TestPyPy
  870. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  871. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  872. )
  873. add_test(NAME FindPython.PyPy.VERSION COMMAND
  874. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  875. --build-and-test
  876. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  877. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
  878. ${build_generator_args}
  879. --build-project TestPyPy
  880. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  881. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  882. )
  883. set_property(TEST FindPython.PyPy.LOCATION FindPython.PyPy.VERSION
  884. APPEND PROPERTY LABELS Python2 Python3)
  885. endif()