CMakeLists.txt 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955
  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 AND CMake_TEST_FindPython3)
  499. add_test(NAME FindPython.ArtifactsPrefix COMMAND
  500. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  501. --build-and-test
  502. "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsPrefix"
  503. "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsPrefix"
  504. ${build_generator_args}
  505. --build-project TestArtifactsPrefix
  506. --build-options ${build_options}
  507. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  508. )
  509. set_property(TEST FindPython.ArtifactsPrefix
  510. APPEND PROPERTY LABELS Python2 Python3)
  511. endif()
  512. if(CMake_TEST_FindPython2_SABIModule)
  513. add_test(NAME FindPython.Python2.Development.SABIModule COMMAND
  514. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  515. --build-and-test
  516. "${CMake_SOURCE_DIR}/Tests/FindPython/Python2SABIModule"
  517. "${CMake_BINARY_DIR}/Tests/FindPython/Python2SABIModule"
  518. ${build_generator_args}
  519. --build-project TestPython2SABIModule
  520. --build-options ${build_options}
  521. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  522. )
  523. set_tests_properties(FindPython.Python2.Development.SABIModule PROPERTIES
  524. PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: .*Development\\.SABIModule")
  525. set_property(TEST FindPython.Python2.Development.SABIModule APPEND PROPERTY LABELS Python2)
  526. endif()
  527. if(CMake_TEST_FindPython3_SABIModule)
  528. # Use exclusively Release configuration because Debug is, on Windows with MSVC,
  529. # unusable with SABI: Python force link with debug version of full versioned library rather than
  530. # the stable ABI one.
  531. add_test(NAME FindPython.Python3.Development.SABIModule COMMAND
  532. ${CMAKE_CTEST_COMMAND} -C Release
  533. --build-and-test
  534. "${CMake_SOURCE_DIR}/Tests/FindPython/Python3SABIModule"
  535. "${CMake_BINARY_DIR}/Tests/FindPython/Python3SABIModule"
  536. ${build_generator_args}
  537. --build-project TestPython3SABIModule
  538. --build-options ${build_options}
  539. --test-command ${CMAKE_CTEST_COMMAND} -V -C Release
  540. )
  541. set_property(TEST FindPython.Python3.Development.SABIModule APPEND PROPERTY LABELS Python3)
  542. endif()
  543. if(CMake_TEST_FindPython2_NumPy OR CMake_TEST_FindPython3_NumPy)
  544. add_test(NAME FindPython.NumPy COMMAND
  545. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  546. --build-and-test
  547. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
  548. "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
  549. ${build_generator_args}
  550. --build-project TestNumPy
  551. --build-options ${build_options}
  552. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  553. )
  554. add_test(NAME FindPython.NumPyOnly COMMAND
  555. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  556. --build-and-test
  557. "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
  558. "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
  559. ${build_generator_args}
  560. --build-project TestNumPyOnly
  561. --build-options ${build_options}
  562. )
  563. set_property(TEST FindPython.NumPy FindPython.NumPyOnly APPEND PROPERTY LABELS Python2 Python3)
  564. endif()
  565. if(CMake_TEST_FindPython3_Conda)
  566. add_test(NAME FindPython.VirtualEnvConda COMMAND
  567. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  568. --build-and-test
  569. "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
  570. "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
  571. ${build_generator_args}
  572. --build-project TestVirtualEnvConda
  573. --build-options ${build_options}
  574. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  575. )
  576. set_property(TEST FindPython.VirtualEnvConda APPEND PROPERTY LABELS Python3)
  577. endif()
  578. if (CMake_TEST_FindPython2 AND CMake_TEST_FindPython2_IronPython)
  579. add_test(NAME FindPython.Implementation.CPython2 COMMAND
  580. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  581. --build-and-test
  582. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  583. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython2"
  584. ${build_generator_args}
  585. --build-project TestImplementationCPython
  586. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  587. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  588. )
  589. add_test(NAME FindPython.Implementation.IronPython2 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.IronPython2"
  594. ${build_generator_args}
  595. --build-project TestImplementationIronPython
  596. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  597. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  598. )
  599. set_property(TEST FindPython.Implementation.CPython2 FindPython.Implementation.IronPython2
  600. APPEND PROPERTY LABELS Python2)
  601. endif()
  602. if (CMake_TEST_FindPython3 AND CMake_TEST_FindPython3_IronPython)
  603. add_test(NAME FindPython.Implementation.CPython3 COMMAND
  604. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  605. --build-and-test
  606. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  607. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython3"
  608. ${build_generator_args}
  609. --build-project TestImplementationCPython
  610. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
  611. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  612. )
  613. add_test(NAME FindPython.Implementation.IronPython3 COMMAND
  614. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  615. --build-and-test
  616. "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
  617. "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython3"
  618. ${build_generator_args}
  619. --build-project TestImplementationIronPython
  620. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_REQUESTED_IMPLEMENTATION=IronPython
  621. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  622. )
  623. set_property(TEST FindPython.Implementation.CPython3 FindPython.Implementation.IronPython3
  624. APPEND PROPERTY LABELS Python3)
  625. endif()
  626. if(CMake_TEST_FindPython2_IronPython)
  627. add_test(NAME FindPython.IronPython2.LOCATION COMMAND
  628. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  629. --build-and-test
  630. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  631. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.LOCATION"
  632. ${build_generator_args}
  633. --build-project TestIronPython2
  634. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  635. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  636. )
  637. add_test(NAME FindPython.IronPython2.VERSION COMMAND
  638. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  639. --build-and-test
  640. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython2"
  641. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VERSION"
  642. ${build_generator_args}
  643. --build-project TestIronPython2
  644. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  645. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  646. )
  647. add_test(NAME FindPython.IronPython.V2.LOCATION COMMAND
  648. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  649. --build-and-test
  650. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  651. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.LOCATION"
  652. ${build_generator_args}
  653. --build-project TestIronPython
  654. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  655. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  656. )
  657. add_test(NAME FindPython.IronPython.V2.VERSION COMMAND
  658. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  659. --build-and-test
  660. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  661. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V2.VERSION"
  662. ${build_generator_args}
  663. --build-project TestIronPython
  664. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  665. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  666. )
  667. add_test(NAME FindPython.IronPython2.VersionRange.LOCATION COMMAND
  668. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  669. --build-and-test
  670. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  671. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.LOCATION"
  672. ${build_generator_args}
  673. --build-project TestVersionRange
  674. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  675. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  676. -DPython2_FIND_STRATEGY=LOCATION
  677. )
  678. add_test(NAME FindPython.IronPython2.VersionRange.VERSION COMMAND
  679. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  680. --build-and-test
  681. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  682. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython2.VersionRange.VERSION"
  683. ${build_generator_args}
  684. --build-project TestVersionRange
  685. --build-options ${build_options} -DPython=Python2 -DPython_REQUESTED_VERSION=2
  686. -DPython2_FIND_IMPLEMENTATIONS=IronPython
  687. -DPython2_FIND_STRATEGY=VERSION
  688. )
  689. set_property(TEST FindPython.IronPython2.LOCATION FindPython.IronPython2.VERSION
  690. FindPython.IronPython.V2.LOCATION FindPython.IronPython.V2.VERSION
  691. FindPython.IronPython2.VersionRange.LOCATION FindPython.IronPython2.VersionRange.VERSION
  692. APPEND PROPERTY LABELS Python2)
  693. endif()
  694. if(CMake_TEST_FindPython3_IronPython)
  695. add_test(NAME FindPython.IronPython3.LOCATION COMMAND
  696. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  697. --build-and-test
  698. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
  699. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.LOCATION"
  700. ${build_generator_args}
  701. --build-project TestIronPython3
  702. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  703. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  704. )
  705. add_test(NAME FindPython.IronPython3.VERSION COMMAND
  706. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  707. --build-and-test
  708. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython3"
  709. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VERSION"
  710. ${build_generator_args}
  711. --build-project TestIronPython3
  712. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  713. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  714. )
  715. add_test(NAME FindPython.IronPython.V3.LOCATION COMMAND
  716. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  717. --build-and-test
  718. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  719. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.LOCATION"
  720. ${build_generator_args}
  721. --build-project TestIronPython
  722. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  723. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  724. )
  725. add_test(NAME FindPython.IronPython.V3.VERSION COMMAND
  726. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  727. --build-and-test
  728. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  729. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.V3.VERSION"
  730. ${build_generator_args}
  731. --build-project TestIronPython
  732. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  733. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  734. )
  735. add_test(NAME FindPython.IronPython3.VersionRange.LOCATION COMMAND
  736. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  737. --build-and-test
  738. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  739. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.LOCATION"
  740. ${build_generator_args}
  741. --build-project TestVersionRange
  742. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  743. -DPython3_FIND_IMPLEMENTATIONS=IronPython
  744. -DPython3_FIND_STRATEGY=LOCATION
  745. )
  746. add_test(NAME FindPython.IronPython3.VersionRange.VERSION COMMAND
  747. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  748. --build-and-test
  749. "${CMake_SOURCE_DIR}/Tests/FindPython/VersionRange"
  750. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython3.VersionRange.VERSION"
  751. ${build_generator_args}
  752. --build-project TestVersionRange
  753. --build-options ${build_options} -DPython=Python3 -DPython_REQUESTED_VERSION=3
  754. -DPython3_FIND_IMPLEMENTATIONS=IronPython
  755. -DPython3_FIND_STRATEGY=VERSION
  756. )
  757. set_property(TEST FindPython.IronPython3.LOCATION FindPython.IronPython3.VERSION
  758. FindPython.IronPython.V3.LOCATION FindPython.IronPython.V3.VERSION
  759. FindPython.IronPython3.VersionRange.LOCATION FindPython.IronPython3.VersionRange.VERSION
  760. APPEND PROPERTY LABELS Python3)
  761. endif()
  762. if(CMake_TEST_FindPython2_IronPython OR CMake_TEST_FindPython3_IronPython)
  763. add_test(NAME FindPython.IronPython.LOCATION COMMAND
  764. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  765. --build-and-test
  766. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  767. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.LOCATION"
  768. ${build_generator_args}
  769. --build-project TestIronPython
  770. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  771. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  772. )
  773. add_test(NAME FindPython.IronPython.VERSION COMMAND
  774. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  775. --build-and-test
  776. "${CMake_SOURCE_DIR}/Tests/FindPython/IronPython"
  777. "${CMake_BINARY_DIR}/Tests/FindPython/IronPython.VERSION"
  778. ${build_generator_args}
  779. --build-project TestIronPython
  780. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  781. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  782. )
  783. set_property(TEST FindPython.IronPython.LOCATION FindPython.IronPython.VERSION
  784. APPEND PROPERTY LABELS Python2 Python3)
  785. endif()
  786. if(CMake_TEST_FindPython2_PyPy)
  787. add_test(NAME FindPython.PyPy2.LOCATION COMMAND
  788. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  789. --build-and-test
  790. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  791. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
  792. ${build_generator_args}
  793. --build-project TestPyPy2
  794. --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
  795. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  796. )
  797. add_test(NAME FindPython.PyPy2.VERSION COMMAND
  798. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  799. --build-and-test
  800. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
  801. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
  802. ${build_generator_args}
  803. --build-project TestPyPy2
  804. --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
  805. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  806. )
  807. add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
  808. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  809. --build-and-test
  810. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  811. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
  812. ${build_generator_args}
  813. --build-project TestPyPy
  814. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
  815. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  816. )
  817. add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
  818. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  819. --build-and-test
  820. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  821. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
  822. ${build_generator_args}
  823. --build-project TestPyPy
  824. --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
  825. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  826. )
  827. set_property(TEST FindPython.PyPy2.LOCATION FindPython.PyPy2.VERSION
  828. FindPython.PyPy.V2.LOCATION FindPython.PyPy.V2.VERSION
  829. APPEND PROPERTY LABELS Python2)
  830. endif()
  831. if(CMake_TEST_FindPython3_PyPy)
  832. add_test(NAME FindPython.PyPy3.LOCATION COMMAND
  833. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  834. --build-and-test
  835. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  836. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
  837. ${build_generator_args}
  838. --build-project TestPyPy3
  839. --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
  840. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  841. )
  842. add_test(NAME FindPython.PyPy3.VERSION COMMAND
  843. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  844. --build-and-test
  845. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
  846. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
  847. ${build_generator_args}
  848. --build-project TestPyPy3
  849. --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
  850. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  851. )
  852. add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
  853. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  854. --build-and-test
  855. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  856. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
  857. ${build_generator_args}
  858. --build-project TestPyPy
  859. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
  860. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  861. )
  862. add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
  863. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  864. --build-and-test
  865. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  866. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
  867. ${build_generator_args}
  868. --build-project TestPyPy
  869. --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
  870. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  871. )
  872. set_property(TEST FindPython.PyPy3.LOCATION FindPython.PyPy3.VERSION
  873. FindPython.PyPy.V3.LOCATION FindPython.PyPy.V3.VERSION
  874. APPEND PROPERTY LABELS Python3)
  875. endif()
  876. if(CMake_TEST_FindPython2_PyPy OR CMake_TEST_FindPython3_PyPy)
  877. add_test(NAME FindPython.PyPy.LOCATION COMMAND
  878. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  879. --build-and-test
  880. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  881. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
  882. ${build_generator_args}
  883. --build-project TestPyPy
  884. --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
  885. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  886. )
  887. add_test(NAME FindPython.PyPy.VERSION COMMAND
  888. ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  889. --build-and-test
  890. "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
  891. "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
  892. ${build_generator_args}
  893. --build-project TestPyPy
  894. --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
  895. --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  896. )
  897. set_property(TEST FindPython.PyPy.LOCATION FindPython.PyPy.VERSION
  898. APPEND PROPERTY LABELS Python2 Python3)
  899. endif()