summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-21 13:39:36 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-09-21 13:39:36 (GMT)
commitcec45e27f6dc2657b00902bcaef5bd93ae16ead7 (patch)
tree9272bb0516d13a108a3b38a072ec3ae400d0f111 /Tests/RunCMake
parent1f4358134f2cf5b9fe72088d6534084a8fb71a52 (diff)
parent51b83f1445521a210eee7e92ed03aff8fe8e9dc6 (diff)
downloadCMake-cec45e27f6dc2657b00902bcaef5bd93ae16ead7.zip
CMake-cec45e27f6dc2657b00902bcaef5bd93ae16ead7.tar.gz
CMake-cec45e27f6dc2657b00902bcaef5bd93ae16ead7.tar.bz2
Merge topic 'pkg-config-variable-function'
51b83f14 FindPkgConfig: add a command to query arbitrary variables 7f7f1eec FindPkgConfig: use execute_process to strip trailing whitespace
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt1
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake9
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake6
3 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt
new file mode 100644
index 0000000..5f211eb
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE-stdout.txt
@@ -0,0 +1 @@
+-- g_ir_scanner: .*/g-ir-scanner
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake
new file mode 100644
index 0000000..c85efaa
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_VARIABLE.cmake
@@ -0,0 +1,9 @@
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(GOBJECT_INTROSPECTION QUIET gobject-introspection-1.0)
+
+if (GOBJECT_INTROSPECTION_FOUND)
+ pkg_get_variable(g_ir_scanner gobject-introspection-1.0 g_ir_scanner)
+ message(STATUS "g_ir_scanner: ${g_ir_scanner}")
+else ()
+ message(STATUS "g_ir_scanner: skipping test; gobject-introspection-1.0 not found /g-ir-scanner")
+endif ()
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index 29301d7..bb04aa2 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -9,3 +9,9 @@ if(APPLE)
run_cmake(FindPkgConfig_CMAKE_FRAMEWORK_PATH)
run_cmake(FindPkgConfig_CMAKE_APPBUNDLE_PATH)
endif()
+
+# We need a real pkg-config to run the test for get_variable.
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+ run_cmake(FindPkgConfig_GET_VARIABLE)
+endif ()