diff options
Diffstat (limited to 'Tests/RunCMake/FindSWIG')
-rw-r--r-- | Tests/RunCMake/FindSWIG/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/FindSWIG/RunCMakeTest.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/FindSWIG/components-stdout.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/FindSWIG/components.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/FindSWIG/missing-components-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/FindSWIG/missing-components-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/FindSWIG/missing-components.cmake | 3 |
7 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindSWIG/CMakeLists.txt b/Tests/RunCMake/FindSWIG/CMakeLists.txt new file mode 100644 index 0000000..d1b0d2c --- /dev/null +++ b/Tests/RunCMake/FindSWIG/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.10) +project(${RunCMake_TEST} C) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake new file mode 100644 index 0000000..5f5f7f5 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(components) +run_cmake(missing-components) diff --git a/Tests/RunCMake/FindSWIG/components-stdout.txt b/Tests/RunCMake/FindSWIG/components-stdout.txt new file mode 100644 index 0000000..3977b08 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/components-stdout.txt @@ -0,0 +1,6 @@ +-- Found SWIG: [^ ]+ \(found version "[0-9.]+"\) found components: java python missing components: PERL +-- SWIG_VERSION='[0-9.]+' +-- SWIG_java_FOUND=TRUE +-- SWIG_python_FOUND=TRUE +-- SWIG_PERL_FOUND= +-- Configuring done diff --git a/Tests/RunCMake/FindSWIG/components.cmake b/Tests/RunCMake/FindSWIG/components.cmake new file mode 100644 index 0000000..b79a81e --- /dev/null +++ b/Tests/RunCMake/FindSWIG/components.cmake @@ -0,0 +1,9 @@ +# Note that 'perl' will not be found because it is not lowercase. +find_package(SWIG REQUIRED + COMPONENTS java + OPTIONAL_COMPONENTS python PERL) + +message(STATUS "SWIG_VERSION='${SWIG_VERSION}'") +foreach(_lang java python PERL) + message(STATUS "SWIG_${_lang}_FOUND=${SWIG_${_lang}_FOUND}") +endforeach() diff --git a/Tests/RunCMake/FindSWIG/missing-components-result.txt b/Tests/RunCMake/FindSWIG/missing-components-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/FindSWIG/missing-components-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/FindSWIG/missing-components-stderr.txt b/Tests/RunCMake/FindSWIG/missing-components-stderr.txt new file mode 100644 index 0000000..c937532 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/missing-components-stderr.txt @@ -0,0 +1 @@ +Could NOT find SWIG \(missing: invalid\) diff --git a/Tests/RunCMake/FindSWIG/missing-components.cmake b/Tests/RunCMake/FindSWIG/missing-components.cmake new file mode 100644 index 0000000..1d05ae4 --- /dev/null +++ b/Tests/RunCMake/FindSWIG/missing-components.cmake @@ -0,0 +1,3 @@ +find_package(SWIG REQUIRED + COMPONENTS invalid + OPTIONAL_COMPONENTS alsoinvalid) |