File: CMakeLists.txt

package info (click to toggle)
cmake 3.25.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 121,376 kB
  • sloc: ansic: 361,053; cpp: 250,806; sh: 3,828; yacc: 3,243; python: 2,707; lex: 1,328; lisp: 382; asm: 371; f90: 314; java: 266; perl: 217; objc: 212; xml: 202; cs: 200; fortran: 131; makefile: 99; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (79 lines) | stat: -rw-r--r-- 3,737 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
cmake_minimum_required(VERSION 3.1)

project(TestCustomFailureMessage LANGUAGES NONE)

include(CTest)

add_test(NAME FindPython.CustomFailureMessage.Interpreter COMMAND
  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  --build-and-test
  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Interpreter"
  ${build_generator_args}
  --build-project TestCustomFailureMessage.Check
  --build-options "-DCHECK_COMPONENTS=Interpreter"
                  "-DPython3_EXECUTABLE=/not/found/interpreter"
  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  )
set_tests_properties(FindPython.CustomFailureMessage.Interpreter PROPERTIES
  PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter")

add_test(NAME FindPython.CustomFailureMessage.Library COMMAND
  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  --build-and-test
  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Library"
  ${build_generator_args}
  --build-project TestCustomFailureMessage.Check
  --build-options "-DCHECK_COMPONENTS=Development"
                  "-DPython3_LIBRARY=/not/found/library"
  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  )
set_tests_properties(FindPython.CustomFailureMessage.Library PROPERTIES
  PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the library")

add_test(NAME FindPython.CustomFailureMessage.Include COMMAND
  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  --build-and-test
  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Include"
  ${build_generator_args}
  --build-project TestCustomFailureMessage.Check
  --build-options "-DCHECK_COMPONENTS=Development"
                  "-DPython3_INCLUDE_DIR=/not/found/include"
  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  )
set_tests_properties(FindPython.CustomFailureMessage.Include PROPERTIES
  PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the directory")

add_test(NAME FindPython.CustomFailureMessage.Multiple COMMAND
  ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
  --build-and-test
  "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
  "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Multiple"
  ${build_generator_args}
  --build-project TestCustomFailureMessage.Check
  --build-options "-DCHECK_COMPONENTS=Interpreter;Development"
                  "-DPython3_EXECUTABLE=/not/found/interpreter"
                  "-DPython3_LIBRARY=/not/found/library"
  --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
  )
set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES
  PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library")


if (CMake_TEST_FindPython_NumPy)
  add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND
    ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
    --build-and-test
    "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
    "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/NumPy"
    ${build_generator_args}
    --build-project TestCustomFailureMessage.Check
    --build-options "-DCHECK_COMPONENTS=Interpreter;Development;NumPy"
                    "-DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include"
    --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
    )
  set_tests_properties(FindPython.CustomFailureMessage.NumPy PROPERTIES
    PASS_REGULAR_EXPRESSION "Reason given by package:.+NumPy: Cannot find the directory")
endif()