diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-02-27 09:52:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-02-27 09:53:02 (GMT) |
commit | 1679a60a6ed2c8f6ab33b0fc9a086c9f7a85ae7d (patch) | |
tree | 75fff726b1a0b5dccc6e2f7e88b4c1a48fdd79e6 /Tests/RunCMake | |
parent | c7c17c5f74632d0a0a10d8560050bafa46045a61 (diff) | |
parent | e131d9f974fd51d0cecb8f3e23d72f2aa8f12ec8 (diff) | |
download | CMake-1679a60a6ed2c8f6ab33b0fc9a086c9f7a85ae7d.zip CMake-1679a60a6ed2c8f6ab33b0fc9a086c9f7a85ae7d.tar.gz CMake-1679a60a6ed2c8f6ab33b0fc9a086c9f7a85ae7d.tar.bz2 |
Merge topic 'FindSWIG-components'
e131d9f974 FindSWIG: Add COMPONENTS support for SWIG target languages
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4384
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-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 |
8 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index e9f8bca..d751d24 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -188,6 +188,7 @@ add_RunCMake_test(FindBoost) add_RunCMake_test(FindLua) add_RunCMake_test(FindOpenGL) if(CMake_TEST_UseSWIG) + add_RunCMake_test(FindSWIG) add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython}) endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom") 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) |